T
- record type@PublicEvolving public abstract class KinesisPartitioner<T> extends Object implements Serializable, PartitionKeyGenerator<T>
Constructor and Description |
---|
KinesisPartitioner() |
Modifier and Type | Method and Description |
---|---|
String |
apply(T element) |
String |
getExplicitHashKey(T element)
Optional method for setting an explicit hash key.
|
abstract String |
getPartitionId(T element)
Return a partition id based on the input.
|
void |
initialize(int indexOfThisSubtask,
int numberOfParallelSubtasks)
Optional initializer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
andThen, compose, identity
public abstract String getPartitionId(T element)
element
- Element to partitionpublic String getExplicitHashKey(T element)
element
- Element to get the hash key forpublic void initialize(int indexOfThisSubtask, int numberOfParallelSubtasks)
indexOfThisSubtask
- Index of this partitioner instancenumberOfParallelSubtasks
- Total number of parallel instancespublic String apply(T element)
apply
in interface java.util.function.Function<T,String>
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.