@Internal public class SharedSplitAssigner extends Object implements SplitAssigner
SubscriptionType.Shared
subscriptions.Constructor and Description |
---|
SharedSplitAssigner(StopCursor stopCursor,
SourceConfiguration sourceConfiguration,
PulsarSourceEnumState sourceEnumState) |
Modifier and Type | Method and Description |
---|---|
void |
addSplitsBack(List<PulsarPartitionSplit> splits,
int subtaskId)
Add a split back to the split assigner if the reader fails.
|
Optional<SplitsAssignment<PulsarPartitionSplit>> |
createAssignment(List<Integer> readers)
Create a split assignment from the current readers.
|
boolean |
noMoreSplits(Integer reader)
It would return true only if periodically partition discovery is disabled, the initializing
partition discovery has finished AND there is no pending splits for assignment.
|
List<TopicPartition> |
registerTopicPartitions(Set<TopicPartition> fetchedPartitions)
Add the current available partitions into assigner.
|
PulsarSourceEnumState |
snapshotState()
Snapshot the current assign state into checkpoint.
|
public SharedSplitAssigner(StopCursor stopCursor, SourceConfiguration sourceConfiguration, PulsarSourceEnumState sourceEnumState)
public List<TopicPartition> registerTopicPartitions(Set<TopicPartition> fetchedPartitions)
SplitAssigner
registerTopicPartitions
in interface SplitAssigner
fetchedPartitions
- The available partitions queried from Pulsar broker.public void addSplitsBack(List<PulsarPartitionSplit> splits, int subtaskId)
SplitAssigner
addSplitsBack
in interface SplitAssigner
public Optional<SplitsAssignment<PulsarPartitionSplit>> createAssignment(List<Integer> readers)
SplitAssigner
createAssignment
in interface SplitAssigner
public boolean noMoreSplits(Integer reader)
SplitAssigner
noMoreSplits
in interface SplitAssigner
public PulsarSourceEnumState snapshotState()
SplitAssigner
snapshotState
in interface SplitAssigner
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.