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–2022 The Apache Software Foundation. All rights reserved.