pub trait RegionHook:
Send
+ Sync
+ Debug {
// Provided methods
fn on_sst_files_written<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
region_id: RegionId,
region_metadata: &'life1 RegionMetadataRef,
files: &'life2 [SstFileInfo<'life3>],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
fn on_manifest_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
region_id: RegionId,
action_list: &'life1 RegionMetaActionList,
manifest_version: ManifestVersion,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Hook for observing region mutations in mito2.
Implementations can be registered via the Plugins system:
ⓘ
use std::sync::Arc;
use common_base::Plugins;
use mito2::engine::region_hook::{RegionHook, RegionHookRef};
plugins.insert(Arc::new(MyHook) as RegionHookRef);Provided Methods§
Sourcefn on_sst_files_written<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
region_id: RegionId,
region_metadata: &'life1 RegionMetadataRef,
files: &'life2 [SstFileInfo<'life3>],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn on_sst_files_written<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
region_id: RegionId,
region_metadata: &'life1 RegionMetadataRef,
files: &'life2 [SstFileInfo<'life3>],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Called after SST data files are physically written, before manifest commit.
This fires only when mito2 itself writes SST files (flush and compaction). It does not fire when SST files are pre-written externally (bulk ingestion, copy region) or when only index files are written (async index build).
Sourcefn on_manifest_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
region_id: RegionId,
action_list: &'life1 RegionMetaActionList,
manifest_version: ManifestVersion,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_manifest_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
region_id: RegionId,
action_list: &'life1 RegionMetaActionList,
manifest_version: ManifestVersion,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called after the region manifest is successfully committed.
Fires for all manifest write paths: flush, compaction, region edit, copy region, alter, truncate, enter staging, index build, etc.
Does not fire for:
- Manifest reads / follower sync (no write)
- GC / checkpoint (internal bookkeeping)
- Failed manifest updates