pub struct ShardRuntime { /* private fields */ }Implementations§
Source§impl ShardRuntime
impl ShardRuntime
pub fn spawn(config: RuntimeConfig) -> Result<Self, RuntimeError>
pub fn spawn_with_engine_factory( config: RuntimeConfig, engine_factory: impl GroupEngineFactory, ) -> Result<Self, RuntimeError>
pub fn spawn_with_engine_factory_and_cold_store( config: RuntimeConfig, engine_factory: impl GroupEngineFactory, cold_store: Option<ColdStoreHandle>, ) -> Result<Self, RuntimeError>
pub fn locate(&self, stream_id: &BucketStreamId) -> ShardPlacement
pub fn has_cold_store(&self) -> bool
pub fn cold_store(&self) -> Option<ColdStoreHandle>
pub fn cold_store_info(&self) -> Option<ColdStoreInfo>
pub async fn wait_read_stream( &self, request: ReadStreamRequest, ) -> Result<ReadStreamResponse, RuntimeError>
pub async fn require_local_live_read_owner( &self, stream_id: &BucketStreamId, ) -> Result<(), RuntimeError>
pub async fn flush_cold_once( &self, request: PlanColdFlushRequest, ) -> Result<Option<FlushColdResponse>, RuntimeError>
pub async fn flush_cold_group_once( &self, raft_group_id: RaftGroupId, request: PlanGroupColdFlushRequest, ) -> Result<Option<FlushColdResponse>, RuntimeError>
pub async fn flush_cold_group_batch_once( &self, raft_group_id: RaftGroupId, request: PlanGroupColdFlushRequest, max_candidates: usize, ) -> Result<Vec<FlushColdResponse>, RuntimeError>
Sourcepub async fn purge_bucket_all_groups(
&self,
bucket_id: &str,
) -> Result<PurgeBucketReport, RuntimeError>
pub async fn purge_bucket_all_groups( &self, bucket_id: &str, ) -> Result<PurgeBucketReport, RuntimeError>
Sums per-bucket committed usage across every Raft group on this node.
Groups are read serially from their local applied state (leader or follower); usage export consumers tolerate replication lag, so this never requires leadership and never blocks on quorum. Purges one tenant bucket from every Raft group: streams, bucket, and usage entries. Idempotent — a re-run over an already purged bucket reports zero removals. Cold objects are reclaimed by the enqueued GC entries; callers wanting synchronous reclamation run the cold GC pass afterwards.
pub async fn bucket_usage_all_groups( &self, ) -> Result<Vec<BucketUsageSnapshot>, RuntimeError>
Sourcepub async fn set_bucket_quota_all_groups(
&self,
bucket_id: &str,
max_streams: Option<u64>,
max_retained_bytes: Option<u64>,
) -> Result<(), RuntimeError>
pub async fn set_bucket_quota_all_groups( &self, bucket_id: &str, max_streams: Option<u64>, max_retained_bytes: Option<u64>, ) -> Result<(), RuntimeError>
Replicates one bucket’s quota record to every Raft group so each enforces the same local backstop. Serial like the other all-group admin sweeps; quota changes are rare control-plane writes.
pub async fn flush_cold_all_groups_once( &self, request: PlanGroupColdFlushRequest, ) -> Result<usize, RuntimeError>
pub async fn flush_cold_all_groups_once_bounded( &self, request: PlanGroupColdFlushRequest, max_concurrency: usize, ) -> Result<usize, RuntimeError>
Sourcepub async fn compact_cold_once(
&self,
target_bytes: u64,
max_bytes: u64,
max_streams: usize,
gc_grace_ms: u64,
) -> Result<usize, RuntimeError>
pub async fn compact_cold_once( &self, target_bytes: u64, max_bytes: u64, max_streams: usize, gc_grace_ms: u64, ) -> Result<usize, RuntimeError>
Rewrites undersized, contiguous objects from the same stream into target-sized immutable chunks. Discovery reads only cold-index pages.
Sourcepub async fn run_cold_gc_group_once(
&self,
raft_group_id: RaftGroupId,
max_entries: usize,
) -> Result<usize, RuntimeError>
pub async fn run_cold_gc_group_once( &self, raft_group_id: RaftGroupId, max_entries: usize, ) -> Result<usize, RuntimeError>
Drains the leader-side cold-GC queue for one group: physically reclaims each queued target from cold storage, then replicates an ack that pops the reclaimed entries. Deletions are idempotent, so a crash or leader change between reclaim and ack simply re-runs them next tick.
pub async fn run_cold_gc_all_groups_once( &self, max_entries_per_group: usize, ) -> Result<usize, RuntimeError>
Sourcepub fn raft_group_count(&self) -> u32
pub fn raft_group_count(&self) -> u32
Number of raft groups this runtime is sharded into. Backup tooling
iterates 0..raft_group_count() to cover the whole keyspace.
pub async fn install_group_snapshot( &self, snapshot: GroupSnapshot, ) -> Result<(), RuntimeError>
pub async fn warm_group( &self, raft_group_id: RaftGroupId, ) -> Result<ShardPlacement, RuntimeError>
pub async fn warm_all_groups(&self) -> Result<(), RuntimeError>
pub fn metrics(&self) -> RuntimeMetrics
pub fn mailbox_snapshot(&self) -> RuntimeMailboxSnapshot
Source§impl ShardRuntime
impl ShardRuntime
pub async fn create_stream( &self, request: CreateStreamRequest, ) -> Result<CreateStreamResponse, RuntimeError>
pub async fn create_stream_external( &self, request: CreateStreamExternalRequest, ) -> Result<CreateStreamResponse, RuntimeError>
pub async fn head_stream( &self, request: HeadStreamRequest, ) -> Result<HeadStreamResponse, RuntimeError>
pub async fn get_stream_attrs( &self, request: GetStreamAttrsRequest, ) -> Result<GetStreamAttrsResponse, RuntimeError>
pub async fn read_stream( &self, request: ReadStreamRequest, ) -> Result<ReadStreamResponse, RuntimeError>
pub async fn publish_snapshot( &self, request: PublishSnapshotRequest, ) -> Result<PublishSnapshotResponse, RuntimeError>
pub async fn advance_retention( &self, request: AdvanceRetentionRequest, ) -> Result<AdvanceRetentionResponse, RuntimeError>
pub async fn read_snapshot( &self, request: ReadSnapshotRequest, ) -> Result<ReadSnapshotResponse, RuntimeError>
pub async fn delete_snapshot( &self, request: DeleteSnapshotRequest, ) -> Result<(), RuntimeError>
pub async fn bootstrap_stream( &self, request: BootstrapStreamRequest, ) -> Result<BootstrapStreamResponse, RuntimeError>
pub async fn close_stream( &self, request: CloseStreamRequest, ) -> Result<CloseStreamResponse, RuntimeError>
pub async fn update_stream_attrs( &self, request: UpdateStreamAttrsRequest, ) -> Result<UpdateStreamAttrsResponse, RuntimeError>
pub async fn delete_stream( &self, request: DeleteStreamRequest, ) -> Result<DeleteStreamResponse, RuntimeError>
pub async fn flush_cold( &self, request: FlushColdRequest, ) -> Result<FlushColdResponse, RuntimeError>
pub async fn compact_cold( &self, request: CompactColdRequest, ) -> Result<CompactColdResponse, RuntimeError>
pub async fn plan_cold_flush( &self, request: PlanColdFlushRequest, ) -> Result<Option<ColdFlushCandidate>, RuntimeError>
pub async fn plan_next_cold_flush_batch( &self, raft_group_id: RaftGroupId, request: PlanGroupColdFlushRequest, max_candidates: usize, ) -> Result<Vec<ColdFlushCandidate>, RuntimeError>
pub async fn bucket_usage( &self, raft_group_id: RaftGroupId, ) -> Result<Vec<BucketUsageSnapshot>, RuntimeError>
pub async fn set_bucket_quota( &self, raft_group_id: RaftGroupId, request: SetBucketQuotaRequest, ) -> Result<SetBucketQuotaResponse, RuntimeError>
pub async fn purge_bucket( &self, raft_group_id: RaftGroupId, bucket_id: String, ) -> Result<PurgeBucketResponse, RuntimeError>
pub async fn append( &self, request: AppendRequest, ) -> Result<AppendResponse, RuntimeError>
pub async fn append_external( &self, request: AppendExternalRequest, ) -> Result<AppendResponse, RuntimeError>
pub async fn append_batch( &self, request: AppendBatchRequest, ) -> Result<AppendBatchResponse, RuntimeError>
pub async fn snapshot_group( &self, raft_group_id: RaftGroupId, ) -> Result<GroupSnapshot, RuntimeError>
pub async fn import_group_state( &self, raft_group_id: RaftGroupId, request: ImportGroupStateRequest, ) -> Result<ImportGroupStateResponse, RuntimeError>
Trait Implementations§
Source§impl Clone for ShardRuntime
impl Clone for ShardRuntime
Source§fn clone(&self) -> ShardRuntime
fn clone(&self) -> ShardRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more