@PublicEvolving public interface KinesisShardAssigner extends Serializable
assign(StreamShardHandle, int) for details.| Modifier and Type | Method and Description |
|---|---|
int |
assign(StreamShardHandle shard,
int numParallelSubtasks)
Returns the index of the target subtask that a specific shard should be
assigned to.
|
int assign(StreamShardHandle shard, int numParallelSubtasks)
The resulting distribution of shards should have the following contract:
The above contract is crucial and cannot be broken. Consumer subtasks rely on this contract to filter out shards that they should not subscribe to, guaranteeing that each shard of a stream will always be assigned to one subtask in a uniformly distributed manner.
shard - the shard to determinenumParallelSubtasks - total number of subtasksCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.