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 {
impl BlockHashValue {
pub fn into_u64(self) -> u64 {
match self {
BlockHashValue::Signed(v) => v as u64,
BlockHashValue::Signed(v) => v.cast_unsigned(),
BlockHashValue::Unsigned(v) => v,
}
}
......
......@@ -303,7 +303,9 @@ pub(crate) async fn start_kv_router_background(
let jitter_ms =
rand::rng().random_range(-CHECK_INTERVAL_JITTER_MS..=CHECK_INTERVAL_JITTER_MS);
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);
check_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);
......
......@@ -135,7 +135,7 @@ impl PrefillRouter {
})
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub fn new(
activation_rx: oneshot::Receiver<Endpoint>,
model_manager: Arc<ModelManager>,
......@@ -335,7 +335,7 @@ impl PrefillRouter {
let host = endpoint.bootstrap_host?;
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!(
worker_id = worker_id,
......
......@@ -646,7 +646,7 @@ pub async fn start_zmq_listener(
}
let mut consecutive_errors = 0u32;
#[allow(unused_assignments)]
#[expect(unused_assignments)]
let mut exit_reason = "unknown";
let mut messages_processed = 0u64;
......@@ -730,7 +730,7 @@ pub async fn start_zmq_listener(
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() {
// Use shared monotonic event_id counter instead of engine's sequence number
let event_id = next_event_id.fetch_add(1, Ordering::SeqCst);
......@@ -1964,7 +1964,7 @@ mod test_exponential_backoff {
}
#[test]
#[allow(clippy::assertions_on_constants)]
#[expect(clippy::assertions_on_constants)]
fn test_backoff_constants_are_sane() {
// Verify our constants make sense together
assert!(INITIAL_BACKOFF_MS > 0);
......
......@@ -147,7 +147,7 @@ impl KvScheduler {
})
}
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
pub async fn schedule(
&self,
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