pub struct CoordinatorServiceClient<Stub = Channel<CoordinatorServiceRequest, CoordinatorServiceResponse>>(/* private fields */);Expand description
The client stub that makes RPC calls to the server. All request methods return Futures.
Implementations§
Source§impl CoordinatorServiceClient
impl CoordinatorServiceClient
Sourcepub fn new<T>(
config: Config,
transport: T,
) -> NewClient<Self, RequestDispatch<CoordinatorServiceRequest, CoordinatorServiceResponse, T>>
pub fn new<T>( config: Config, transport: T, ) -> NewClient<Self, RequestDispatch<CoordinatorServiceRequest, CoordinatorServiceResponse, T>>
Returns a new client stub that sends requests over the given transport.
Source§impl<Stub> CoordinatorServiceClient<Stub>
impl<Stub> CoordinatorServiceClient<Stub>
Sourcepub fn register(
&self,
ctx: Context,
info: ShardInfo,
) -> impl Future<Output = Result<RpcResult<ShardId>, RpcError>> + '_
pub fn register( &self, ctx: Context, info: ShardInfo, ) -> impl Future<Output = Result<RpcResult<ShardId>, RpcError>> + '_
Register a new shard with the coordinator.
Returns the assigned shard ID. The coordinator will include this shard in subsequent tick coordination.
Sourcepub fn unregister(
&self,
ctx: Context,
shard_id: ShardId,
) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_
pub fn unregister( &self, ctx: Context, shard_id: ShardId, ) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_
Unregister a shard from the coordinator.
Should be called during graceful shutdown. The coordinator will stop routing requests to this shard.
Sourcepub fn phase_complete(
&self,
ctx: Context,
shard_id: ShardId,
phase: TickPhase,
tick: u64,
) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_
pub fn phase_complete( &self, ctx: Context, shard_id: ShardId, phase: TickPhase, tick: u64, ) -> impl Future<Output = Result<RpcResult<()>, RpcError>> + '_
Report that a shard has completed a tick phase.
Used for barrier synchronization. The coordinator tracks completion across all shards before advancing to the next phase.
Sourcepub fn route_document(
&self,
ctx: Context,
doc_id: DocumentId,
) -> impl Future<Output = Result<ShardId, RpcError>> + '_
pub fn route_document( &self, ctx: Context, doc_id: DocumentId, ) -> impl Future<Output = Result<ShardId, RpcError>> + '_
Get the shard responsible for a document.
Uses consistent hashing to determine which shard owns a document.
Sourcepub fn route_node(
&self,
ctx: Context,
node_id: NodeId,
) -> impl Future<Output = Result<ShardId, RpcError>> + '_
pub fn route_node( &self, ctx: Context, node_id: NodeId, ) -> impl Future<Output = Result<ShardId, RpcError>> + '_
Get the shard responsible for a node.
Uses consistent hashing based on node ID.
Sourcepub fn get_global_df(
&self,
ctx: Context,
terms: Vec<String>,
) -> impl Future<Output = Result<RpcResult<HashMap<String, u64>>, RpcError>> + '_
pub fn get_global_df( &self, ctx: Context, terms: Vec<String>, ) -> impl Future<Output = Result<RpcResult<HashMap<String, u64>>, RpcError>> + '_
Get global document frequencies for TF-IDF.
Returns aggregated term frequencies across all shards.
Sourcepub fn barrier_ready(
&self,
ctx: Context,
shard_id: ShardId,
phase: TickPhase,
tick: u64,
) -> impl Future<Output = Result<RpcResult<bool>, RpcError>> + '_
pub fn barrier_ready( &self, ctx: Context, shard_id: ShardId, phase: TickPhase, tick: u64, ) -> impl Future<Output = Result<RpcResult<bool>, RpcError>> + '_
Signal ready for next phase (barrier).
Returns true when all shards are ready and the phase can proceed.
Sourcepub fn current_tick(
&self,
ctx: Context,
) -> impl Future<Output = Result<u64, RpcError>> + '_
pub fn current_tick( &self, ctx: Context, ) -> impl Future<Output = Result<u64, RpcError>> + '_
Get current tick number.
Returns the global tick counter maintained by the coordinator.
Sourcepub fn list_shards(
&self,
ctx: Context,
) -> impl Future<Output = Result<Vec<ShardInfo>, RpcError>> + '_
pub fn list_shards( &self, ctx: Context, ) -> impl Future<Output = Result<Vec<ShardInfo>, RpcError>> + '_
Get all registered shards.
Returns information about all shards in the cluster.
Sourcepub fn start_tick(
&self,
ctx: Context,
) -> impl Future<Output = Result<RpcResult<u64>, RpcError>> + '_
pub fn start_tick( &self, ctx: Context, ) -> impl Future<Output = Result<RpcResult<u64>, RpcError>> + '_
Request to start a new tick.
Only succeeds if no tick is currently in progress.
Sourcepub fn tick_status(
&self,
ctx: Context,
) -> impl Future<Output = Result<RpcResult<TickStatus>, RpcError>> + '_
pub fn tick_status( &self, ctx: Context, ) -> impl Future<Output = Result<RpcResult<TickStatus>, RpcError>> + '_
Get the status of the current tick.
Returns the current phase and which shards have completed it.
Trait Implementations§
Source§impl<Stub: Clone> Clone for CoordinatorServiceClient<Stub>
impl<Stub: Clone> Clone for CoordinatorServiceClient<Stub>
Source§fn clone(&self) -> CoordinatorServiceClient<Stub>
fn clone(&self) -> CoordinatorServiceClient<Stub>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more