public class RandomBrokerPartitionSubsetPartitioner extends Object implements org.apache.kafka.clients.producer.Partitioner
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_SUBSET_PARTITIONER_PARTITION_PERCENTAGE |
static String |
SUBSET_PARTITIONER_PARTITION_PERCENTAGE_CONFIG |
| Constructor and Description |
|---|
RandomBrokerPartitionSubsetPartitioner() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Map<String,?> configs) |
void |
onNewBatch(String topic,
org.apache.kafka.common.Cluster cluster,
int prevPartition)
We need to deal with topology changes and redefine which partitions to write to.
|
int |
partition(String topic,
Object key,
byte[] keyBytes,
Object value,
byte[] valueBytes,
org.apache.kafka.common.Cluster cluster)
Choose the partition for a record from partitions found on a limited number of brokers
according to `subset.partitioner.partition.percentage`.
|
public static final String SUBSET_PARTITIONER_PARTITION_PERCENTAGE_CONFIG
public static final double DEFAULT_SUBSET_PARTITIONER_PARTITION_PERCENTAGE
public RandomBrokerPartitionSubsetPartitioner()
public int partition(String topic, Object key, byte[] keyBytes, Object value, byte[] valueBytes, org.apache.kafka.common.Cluster cluster)
partition in interface org.apache.kafka.clients.producer.Partitionerpublic void onNewBatch(String topic, org.apache.kafka.common.Cluster cluster, int prevPartition)
onNewBatch in interface org.apache.kafka.clients.producer.Partitionerpublic void configure(Map<String,?> configs)
configure in interface org.apache.kafka.common.Configurablepublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.apache.kafka.clients.producer.Partitioner