Skip to content

Commit

Permalink
Rename grpc field interval to interval_secs
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Sep 19, 2024
1 parent 4da6215 commit 44290ef
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions quickwit/quickwit-control-plane/src/control_plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -789,8 +789,8 @@ impl Handler<PruneShardsRequest> for ControlPlane {
_ctx: &ActorContext<Self>,
) -> Result<ControlPlaneResult<EmptyResponse>, ActorExitStatus> {
let interval = request
.interval
.map(|interval| Duration::from_secs(interval as u64))
.interval_secs
.map(|interval_secs| Duration::from_secs(interval_secs as u64))
.unwrap_or_else(|| PRUNE_SHARDS_DEFAULT_COOLDOWN_PERIOD);

// A very basic debounce is enough here, missing one call to the pruning API is fine
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl QueueSharedState {
source_id: source_id.clone(),
max_age_secs,
max_count,
interval: Some(pruning_interval.as_secs() as u32),
interval_secs: Some(pruning_interval.as_secs() as u32),
})
.await;
if let Err(err) = result {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ mod tests {
source_id: source_id.clone(),
max_age_secs: None,
max_count: None,
interval: None,
interval_secs: None,
};
let MutationOccurred::No(()) = shards.prune_shards(request).unwrap() else {
panic!("expected `MutationOccurred::No`");
Expand All @@ -653,7 +653,7 @@ mod tests {
source_id: source_id.clone(),
max_age_secs: Some(50),
max_count: None,
interval: None,
interval_secs: None,
};
let MutationOccurred::No(()) = shards.prune_shards(request).unwrap() else {
panic!("expected `MutationOccurred::No`");
Expand Down Expand Up @@ -690,7 +690,7 @@ mod tests {
source_id: source_id.clone(),
max_age_secs: Some(150),
max_count: None,
interval: None,
interval_secs: None,
};
let MutationOccurred::Yes(()) = shards.prune_shards(request).unwrap() else {
panic!("expected `MutationOccurred::Yes`");
Expand All @@ -701,7 +701,7 @@ mod tests {
source_id: source_id.clone(),
max_age_secs: Some(150),
max_count: None,
interval: None,
interval_secs: None,
};
let MutationOccurred::No(()) = shards.prune_shards(request).unwrap() else {
panic!("expected `MutationOccurred::No`");
Expand Down
10 changes: 5 additions & 5 deletions quickwit/quickwit-metastore/src/tests/shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ pub async fn test_metastore_prune_shards<
source_id: test_index.source_id.clone(),
max_age_secs: None,
max_count: None,
interval: None,
interval_secs: None,
};
metastore.prune_shards(prune_index_request).await.unwrap();
let all_shards = metastore
Expand All @@ -670,7 +670,7 @@ pub async fn test_metastore_prune_shards<
source_id: test_index.source_id.clone(),
max_age_secs: Some(oldest_shard_age - 350),
max_count: None,
interval: None,
interval_secs: None,
};
metastore.prune_shards(prune_index_request).await.unwrap();

Expand All @@ -690,7 +690,7 @@ pub async fn test_metastore_prune_shards<
source_id: test_index.source_id.clone(),
max_age_secs: None,
max_count: Some(90),
interval: None,
interval_secs: None,
};
metastore.prune_shards(prune_index_request).await.unwrap();
let mut all_shards = metastore
Expand All @@ -708,7 +708,7 @@ pub async fn test_metastore_prune_shards<
source_id: test_index.source_id.clone(),
max_age_secs: Some(oldest_shard_age - 2950),
max_count: Some(80),
interval: None,
interval_secs: None,
};
metastore.prune_shards(prune_index_request).await.unwrap();
let all_shards = metastore
Expand All @@ -722,7 +722,7 @@ pub async fn test_metastore_prune_shards<
source_id: test_index.source_id.clone(),
max_age_secs: Some(oldest_shard_age - 4000),
max_count: Some(50),
interval: None,
interval_secs: None,
};
metastore.prune_shards(prune_index_request).await.unwrap();
let all_shards = metastore
Expand Down
2 changes: 1 addition & 1 deletion quickwit/quickwit-proto/protos/quickwit/metastore.proto
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ message PruneShardsRequest {
// The maximum number of the shards to keep. Delete older shards first.
optional uint32 max_count = 6;
// The interval between two pruning operations, in seconds.
optional uint32 interval = 7;
optional uint32 interval_secs = 7;
}

message ListShardsRequest {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 44290ef

Please sign in to comment.