Skip to content

Commit

Permalink
refactor: replace InactiveRegionManager with RegionLeaseKeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Nov 10, 2023
1 parent 22ee45f commit 1a92ff1
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 90 deletions.
9 changes: 7 additions & 2 deletions src/meta-srv/src/handler/node_stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use api::v1::meta::HeartbeatRequest;
use common_time::util as time_util;
use serde::{Deserialize, Serialize};
use store_api::region_engine::RegionRole;
use store_api::storage::RegionId;

use crate::error::{Error, InvalidHeartbeatRequestSnafu};
use crate::keys::StatKey;
Expand Down Expand Up @@ -72,8 +73,12 @@ impl Stat {
}
}

pub fn region_ids(&self) -> Vec<u64> {
self.region_stats.iter().map(|s| s.id).collect()
/// Returns a tuple array containing [RegionId] and [RegionRole].
pub fn regions(&self) -> Vec<(RegionId, RegionRole)> {
self.region_stats
.iter()
.map(|s| (RegionId::from(s.id), s.role.into()))
.collect()
}

pub fn retain_active_region_stats(&mut self, inactive_region_ids: &HashSet<u64>) {
Expand Down
Loading

0 comments on commit 1a92ff1

Please sign in to comment.