Class KinesisPartitioner<T>
- java.lang.Object
-
- org.apache.flink.streaming.connectors.kinesis.KinesisPartitioner<T>
-
- Type Parameters:
T- record type
- All Implemented Interfaces:
Serializable,java.util.function.Function<T,String>,org.apache.flink.connector.kinesis.sink.PartitionKeyGenerator<T>
@PublicEvolving public abstract class KinesisPartitioner<T> extends Object implements Serializable, org.apache.flink.connector.kinesis.sink.PartitionKeyGenerator<T>
An interface for partitioning records.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KinesisPartitioner()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Stringapply(T element)StringgetExplicitHashKey(T element)Optional method for setting an explicit hash key.abstract StringgetPartitionId(T element)Return a partition id based on the input.voidinitialize(int indexOfThisSubtask, int numberOfParallelSubtasks)Optional initializer.
-
-
-
Method Detail
-
getPartitionId
public abstract String getPartitionId(T element)
Return a partition id based on the input.- Parameters:
element- Element to partition- Returns:
- A string representing the partition id
-
getExplicitHashKey
public String getExplicitHashKey(T element)
Optional method for setting an explicit hash key.- Parameters:
element- Element to get the hash key for- Returns:
- the hash key for the element
-
initialize
public void initialize(int indexOfThisSubtask, int numberOfParallelSubtasks)Optional initializer.- Parameters:
indexOfThisSubtask- Index of this partitioner instancenumberOfParallelSubtasks- Total number of parallel instances
-
-