Struct raftstore::coprocessor::region_info_accessor::RegionCollector [−][src]
RegionCollector
is the place where we hold all region information we collected, and the
underlying runner of RegionInfoAccessor
. It listens on events sent by the RegionEventListener
and
keeps information of all regions. Role of each region are also tracked.
Fields
regions: HashMap<u64, RegionInfo>
region_ranges: BTreeMap<Vec<u8>, u64>
Implementations
impl RegionCollector
[src]
pub fn new() -> Self
[src]
pub fn create_region(&mut self, region: Region, role: StateRole)
[src]
fn update_region(&mut self, region: Region)
[src]
fn handle_create_region(&mut self, region: Region, role: StateRole)
[src]
fn handle_update_region(&mut self, region: Region, role: StateRole)
[src]
fn handle_destroy_region(&mut self, region: Region)
[src]
fn handle_role_change(&mut self, region: Region, new_role: StateRole)
[src]
fn is_region_epoch_stale(
&self,
region_to_check: &Region,
current: &Region
) -> bool
[src]
&self,
region_to_check: &Region,
current: &Region
) -> bool
Determines whether region_to_check
’s epoch is stale compared to current
’s epoch
fn check_region_range(
&mut self,
region: &Region,
clear_regions_in_range: bool
) -> bool
[src]
&mut self,
region: &Region,
clear_regions_in_range: bool
) -> bool
For all regions whose range overlaps with the given region
or region_id is the same as
region
’s, checks whether the given region
’s epoch is not older than theirs.
Returns false if the given region
is stale, which means, at least one region above has
newer epoch.
If the given region
is not stale, all other regions in the collection that overlaps with
the given region
must be stale. Returns true in this case, and if clear_regions_in_range
is true, those out-of-date regions will be removed from the collection.
pub fn handle_seek_region(
&self,
from_key: Vec<u8>,
callback: SeekRegionCallback
)
[src]
&self,
from_key: Vec<u8>,
callback: SeekRegionCallback
)
pub fn handle_find_region_by_id(
&self,
region_id: u64,
callback: Callback<Option<RegionInfo>>
)
[src]
&self,
region_id: u64,
callback: Callback<Option<RegionInfo>>
)
pub fn handle_get_regions_in_range(
&self,
start_key: Vec<u8>,
end_key: Vec<u8>,
callback: Callback<Vec<Region>>
)
[src]
&self,
start_key: Vec<u8>,
end_key: Vec<u8>,
callback: Callback<Vec<Region>>
)
fn handle_raftstore_event(&mut self, event: RaftStoreEvent)
[src]
Trait Implementations
impl Runnable for RegionCollector
[src]
type Task = RegionInfoQuery
fn run(&mut self, task: RegionInfoQuery)
[src]
pub fn on_tick(&mut self)
[src]
pub fn shutdown(&mut self)
[src]
impl RunnableWithTimer for RegionCollector
[src]
fn on_timeout(&mut self)
[src]
fn get_interval(&self) -> Duration
[src]
Auto Trait Implementations
impl RefUnwindSafe for RegionCollector
impl Send for RegionCollector
impl Sync for RegionCollector
impl Unpin for RegionCollector
impl UnwindSafe for RegionCollector
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<V, W> ConvertFrom<W> for V where
W: ConvertTo<V>,
[src]
W: ConvertTo<V>,
pub fn convert_from(ctx: &mut EvalContext, from: W) -> Result<V, Error>
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T> Sealed<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,