Unverified Commit b94cb543 authored by Yan Ru Pei's avatar Yan Ru Pei Committed by GitHub
Browse files

chore(kv-router): split monolithic indexer.rs into indexer/ directory (#6870)


Signed-off-by: default avatarPeaBrane <yanrpei@gmail.com>
Co-authored-by: default avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 2ae9c290
...@@ -58,7 +58,7 @@ pub enum BlockHashValue { ...@@ -58,7 +58,7 @@ pub enum BlockHashValue {
impl BlockHashValue { impl BlockHashValue {
pub fn into_u64(self) -> u64 { pub fn into_u64(self) -> u64 {
match self { match self {
BlockHashValue::Signed(v) => v as u64, BlockHashValue::Signed(v) => v.cast_unsigned(),
BlockHashValue::Unsigned(v) => v, BlockHashValue::Unsigned(v) => v,
} }
} }
......
...@@ -303,7 +303,9 @@ pub(crate) async fn start_kv_router_background( ...@@ -303,7 +303,9 @@ pub(crate) async fn start_kv_router_background(
let jitter_ms = let jitter_ms =
rand::rng().random_range(-CHECK_INTERVAL_JITTER_MS..=CHECK_INTERVAL_JITTER_MS); rand::rng().random_range(-CHECK_INTERVAL_JITTER_MS..=CHECK_INTERVAL_JITTER_MS);
let interval_duration = Duration::from_millis( let interval_duration = Duration::from_millis(
(CHECK_INTERVAL_BASE.as_millis() as i64 + jitter_ms).max(1) as u64, (CHECK_INTERVAL_BASE.as_millis() as i64 + jitter_ms)
.max(1)
.cast_unsigned(),
); );
let mut check_interval = tokio::time::interval(interval_duration); let mut check_interval = tokio::time::interval(interval_duration);
check_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip); check_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);
......
...@@ -135,7 +135,7 @@ impl PrefillRouter { ...@@ -135,7 +135,7 @@ impl PrefillRouter {
}) })
} }
#[allow(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
pub fn new( pub fn new(
activation_rx: oneshot::Receiver<Endpoint>, activation_rx: oneshot::Receiver<Endpoint>,
model_manager: Arc<ModelManager>, model_manager: Arc<ModelManager>,
...@@ -335,7 +335,7 @@ impl PrefillRouter { ...@@ -335,7 +335,7 @@ impl PrefillRouter {
let host = endpoint.bootstrap_host?; let host = endpoint.bootstrap_host?;
let port = endpoint.bootstrap_port?; let port = endpoint.bootstrap_port?;
let bootstrap_room: u64 = rand::random_range(0..=i64::MAX as u64); let bootstrap_room: u64 = rand::random_range(0..=i64::MAX.cast_unsigned());
tracing::debug!( tracing::debug!(
worker_id = worker_id, worker_id = worker_id,
......
...@@ -646,7 +646,7 @@ pub async fn start_zmq_listener( ...@@ -646,7 +646,7 @@ pub async fn start_zmq_listener(
} }
let mut consecutive_errors = 0u32; let mut consecutive_errors = 0u32;
#[allow(unused_assignments)] #[expect(unused_assignments)]
let mut exit_reason = "unknown"; let mut exit_reason = "unknown";
let mut messages_processed = 0u64; let mut messages_processed = 0u64;
...@@ -730,7 +730,7 @@ pub async fn start_zmq_listener( ...@@ -730,7 +730,7 @@ pub async fn start_zmq_listener(
batch.data_parallel_rank.unwrap_or(0) batch.data_parallel_rank.unwrap_or(0)
); );
let dp_rank = batch.data_parallel_rank.unwrap_or(0) as u32; let dp_rank = batch.data_parallel_rank.unwrap_or(0).cast_unsigned();
for raw_event in batch.events.into_iter() { for raw_event in batch.events.into_iter() {
// Use shared monotonic event_id counter instead of engine's sequence number // Use shared monotonic event_id counter instead of engine's sequence number
let event_id = next_event_id.fetch_add(1, Ordering::SeqCst); let event_id = next_event_id.fetch_add(1, Ordering::SeqCst);
...@@ -1964,7 +1964,7 @@ mod test_exponential_backoff { ...@@ -1964,7 +1964,7 @@ mod test_exponential_backoff {
} }
#[test] #[test]
#[allow(clippy::assertions_on_constants)] #[expect(clippy::assertions_on_constants)]
fn test_backoff_constants_are_sane() { fn test_backoff_constants_are_sane() {
// Verify our constants make sense together // Verify our constants make sense together
assert!(INITIAL_BACKOFF_MS > 0); assert!(INITIAL_BACKOFF_MS > 0);
......
...@@ -147,7 +147,7 @@ impl KvScheduler { ...@@ -147,7 +147,7 @@ impl KvScheduler {
}) })
} }
#[allow(clippy::too_many_arguments)] #[expect(clippy::too_many_arguments)]
pub async fn schedule( pub async fn schedule(
&self, &self,
maybe_request_id: Option<String>, maybe_request_id: Option<String>,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment