Interface ShardCoordinator

All Known Implementing Classes:
LocalShardCoordinator

public interface ShardCoordinator
A ShardCoordinator defines key operations to leverage shard coordination across boundaries.
  • Method Details

    • getIdentifyLimiter

      PayloadTransformer getIdentifyLimiter(ShardInfo shardInfo, int maxConcurrency)
      Returns a transformation function for a sequence of payloads that can be held or delayed in order to successfully identify multiple shards in a coordinated manner.
      Parameters:
      shardInfo - the shard from where to retrieve the limiter
      maxConcurrency - the number of shards that can be concurrently identified
      Returns:
      a PayloadTransformer allowing IDENTIFY payload coordination across shards
    • publishConnected

      Mono<Void> publishConnected(ShardInfo shardInfo)
      Notifies this coordinator that a given shard has connected successfully. Can be used to signal other shards for authentication.
      Parameters:
      shardInfo - the connected shard details
      Returns:
      a Mono indicating when this operation has completed
    • publishDisconnected

      Mono<Void> publishDisconnected(ShardInfo shardInfo, @Nullable SessionInfo sessionInfo)
      Notifies this coordinator that a given shard has disconnected.
      Parameters:
      shardInfo - the disconnected shard details
      sessionInfo - the disconnected shard session details to resume, or null if resume is not available
      Returns:
      a Mono indicating when this operation has completed
    • getConnectedCount

      Mono<Integer> getConnectedCount()
      Return the number of currently connected shards.
      Returns:
      a Mono with the number of connected shards