Interface KinesisPartitioner.ExplicitPartitioner<T>

All Superinterfaces:
KinesisPartitioner<T>, Serializable
Enclosing interface:
KinesisPartitioner<T>

public static interface KinesisPartitioner.ExplicitPartitioner<T> extends KinesisPartitioner<T>
An explicit partitioner that always returns a Nonnull explicit hash key. The partition key is irrelevant in this case, though it cannot be null.
  • Method Details

    • getPartitionKey

      @Nonnull default String getPartitionKey(T record)
      Description copied from interface: KinesisPartitioner
      Determines which shard in the stream the record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis Data Streams uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard.
      Specified by:
      getPartitionKey in interface KinesisPartitioner<T>
    • getExplicitHashKey

      @Nonnull String getExplicitHashKey(T record)
      Required hash value (128-bit integer) to determine explicitly the shard a record is assigned to based on the hash key range of each shard. The explicit hash key overrides the partition key hash.
      Specified by:
      getExplicitHashKey in interface KinesisPartitioner<T>