Multistream support for leases.
This commit is contained in:
parent
1ccbe614eb
commit
0052b5799c
1 changed files with 4 additions and 2 deletions
|
|
@ -839,12 +839,14 @@ public class HierarchicalShardSyncer {
|
||||||
* regardless of if they are open or closed. Closed shards will be unblocked via child shard information upon
|
* regardless of if they are open or closed. Closed shards will be unblocked via child shard information upon
|
||||||
* reaching SHARD_END.
|
* reaching SHARD_END.
|
||||||
*/
|
*/
|
||||||
private List<Lease> getLeasesToCreateForOpenAndClosedShards(InitialPositionInStreamExtended initialPosition, List<Shard> shards) {
|
private List<Lease> getLeasesToCreateForOpenAndClosedShards(InitialPositionInStreamExtended initialPosition,
|
||||||
|
List<Shard> shards, MultiStreamArgs multiStreamArgs) {
|
||||||
final Map<String, Lease> shardIdToNewLeaseMap = new HashMap<>();
|
final Map<String, Lease> shardIdToNewLeaseMap = new HashMap<>();
|
||||||
|
|
||||||
for (Shard shard : shards) {
|
for (Shard shard : shards) {
|
||||||
final String shardId = shard.shardId();
|
final String shardId = shard.shardId();
|
||||||
final Lease lease = newKCLLease(shard);
|
final Lease lease = multiStreamArgs.isMultiStreamMode() ?
|
||||||
|
newKCLMultiStreamLease(shard, multiStreamArgs.streamIdentifier) : newKCLLease(shard);
|
||||||
lease.checkpoint(convertToCheckpoint(initialPosition));
|
lease.checkpoint(convertToCheckpoint(initialPosition));
|
||||||
|
|
||||||
log.debug("Need to create a lease for shard with shardId {}", shardId);
|
log.debug("Need to create a lease for shard with shardId {}", shardId);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue