@PublicEvolving public interface KinesisShardAssigner extends Serializable
assign(StreamShardHandle, int)for details.
|Modifier and Type||Method and Description|
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 determine
numParallelSubtasks- total number of subtasks
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.