Skip to main content

ShardingViewProvider

Trait ShardingViewProvider 

Source
pub trait ShardingViewProvider:
    Send
    + Sync
    + 'static {
    // Required methods
    fn allocate_shard(
        &self,
        request: ShardAllocationRequest,
        timeout: Duration,
    ) -> ClusterViewFuture<'_, ShardAllocation>;
    fn remember_shard_allocations(
        &self,
        request: RememberShardAllocations,
    ) -> ClusterViewFuture<'_, ()>;
    fn get_shard_allocations(
        &self,
        type_name: String,
        timeout: Duration,
    ) -> ClusterViewFuture<'_, ShardAllocationTable>;
    fn forward_shard_envelopes(
        &self,
        request: ForwardShardEnvelopes,
        timeout: Duration,
    ) -> ClusterViewFuture<'_, ShardEnvelopeBatchResult>;
    fn complete_sharding_ask(
        &self,
        request: CompleteShardingAsk,
    ) -> ClusterViewFuture<'_, ()>;
}
Expand description

Provider installed by cluster sharding to serve shard allocation, region forwarding, and remote ask replies over the existing node-to-node DCP sessions.

Required Methods§

Source

fn allocate_shard( &self, request: ShardAllocationRequest, timeout: Duration, ) -> ClusterViewFuture<'_, ShardAllocation>

Allocate or return the cached owner for one shard. Only the deterministic coordinator should accept this request.

Source

fn remember_shard_allocations( &self, request: RememberShardAllocations, ) -> ClusterViewFuture<'_, ()>

Remember allocation-table rows replicated by the active coordinator.

Source

fn get_shard_allocations( &self, type_name: String, timeout: Duration, ) -> ClusterViewFuture<'_, ShardAllocationTable>

Return this region’s cached allocation table for coordinator takeover.

Source

fn forward_shard_envelopes( &self, request: ForwardShardEnvelopes, timeout: Duration, ) -> ClusterViewFuture<'_, ShardEnvelopeBatchResult>

Enqueue a batch of serialized envelopes at this region.

Source

fn complete_sharding_ask( &self, request: CompleteShardingAsk, ) -> ClusterViewFuture<'_, ()>

Complete an ask whose reply port originated on this region.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§