@PublicEvolving @FunctionalInterface public interface RangeGenerator extends Serializable
TopicRange
for given topic. It was used for pulsar's
SubscriptionType.Key_Shared
mode. TopicRange
would be used in KeySharedPolicy
for different pulsar source readers.
If you implement this interface, make sure that each TopicRange
would be assigned to a
specified source reader. Since flink parallelism is provided, make sure the pulsar message key's
hashcode is evenly distributed among these topic ranges.
Modifier and Type | Method and Description |
---|---|
default void |
open(Configuration configuration,
SourceConfiguration sourceConfiguration)
Deprecated.
Use
open(SourceConfiguration) instead. |
default void |
open(SourceConfiguration sourceConfiguration)
Initialize some extra resource when bootstrap the source.
|
List<TopicRange> |
range(TopicMetadata metadata,
int parallelism)
Generate range for the given topic.
|
List<TopicRange> range(TopicMetadata metadata, int parallelism)
metadata
- The metadata of the topic.parallelism
- The reader size for this topic.default void open(SourceConfiguration sourceConfiguration)
@Deprecated default void open(Configuration configuration, SourceConfiguration sourceConfiguration)
open(SourceConfiguration)
instead.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.