@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 | Interface and Description |
---|---|
static class |
RangeGenerator.KeySharedMode
Different Key_Shared mode means different split assignment behaviors.
|
Modifier and Type | Method and Description |
---|---|
default RangeGenerator.KeySharedMode |
keyShareMode(TopicMetadata metadata,
int parallelism)
Defines the default behavior for Key_Shared subscription in Flink.
|
default void |
open(Configuration configuration,
SourceConfiguration sourceConfiguration)
Deprecated.
Use
open(SourceConfiguration) instead. |
default void |
open(SourceConfiguration sourceConfiguration)
Initialize some extra resources 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 RangeGenerator.KeySharedMode keyShareMode(TopicMetadata metadata, int parallelism)
RangeGenerator.KeySharedMode
for the detailed usage of the key share mode.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–2022 The Apache Software Foundation. All rights reserved.