@PublicEvolving
public interface PulsarContextAware<T>
PulsarSerializationSchema that need information
about the context where the Kafka Producer is running along with information about the available
partitions.
You only need to override the methods for the information that you need. However, getTargetTopic(Object) is required because it is used to determine the available partitions.
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getKey(T element) |
String |
getTargetTopic(T element)
Returns the topic that the presented element should be sent to.
|
default void |
setNumParallelInstances(int numParallelInstances)
Sets the parallelism with which the parallel task of the Pulsar Sink runs.
|
default void |
setParallelInstanceId(int parallelInstanceId)
Sets the number of the parallel subtask that the Kafka Producer is running on.
|
default void |
setPartitions(int[] partitions)
Sets the available partitions for the topic returned from
getTargetTopic(Object). |
default void setParallelInstanceId(int parallelInstanceId)
setNumParallelInstances(int)).default void setNumParallelInstances(int numParallelInstances)
default void setPartitions(int[] partitions)
getTargetTopic(Object).String getTargetTopic(T element)
byte[] getKey(T element)
Copyright © 2019–2021 The Apache Software Foundation. All rights reserved.