@PublicEvolving public final class FixedKinesisPartitioner<T> extends KinesisPartitioner<T>
This is achieved by using the index of the producer task as a PartitionKey
.
Constructor and Description |
---|
FixedKinesisPartitioner() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getPartitionId(T record)
Return a partition id based on the input.
|
int |
hashCode() |
void |
initialize(int indexOfThisSubtask,
int numberOfParallelSubtasks)
Optional initializer.
|
getExplicitHashKey
public void initialize(int indexOfThisSubtask, int numberOfParallelSubtasks)
KinesisPartitioner
initialize
in class KinesisPartitioner<T>
indexOfThisSubtask
- Index of this partitioner instancenumberOfParallelSubtasks
- Total number of parallel instancespublic String getPartitionId(T record)
KinesisPartitioner
getPartitionId
in class KinesisPartitioner<T>
record
- Element to partitionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.