Skip to content

Partitioner

Partitioner is an abstraction of partitioners for a KafkaProducer to determine the partition of records (to be sent out).

Configurable

Partitioner is a Configurable.

Closeable

Partitioner is a Closeable (Java).

Contract

onNewBatch

void onNewBatch(
  String topic,
  Cluster cluster,
  int prevPartition)

Used when:

Computing Partition

int partition(
  String topic,
  Object key,
  byte[] keyBytes,
  Object value,
  byte[] valueBytes,
  Cluster cluster)

Used when:

Implementations