public class DefaultMetricSamplerPartitionAssignor extends java.lang.Object implements MetricSamplerPartitionAssignor
The assignment tries to achieve the following goals: 1. All the partitions of the same topic goes to one metric fetcher. 2. The number of partitions assigned to each fetcher should be about the same.
Constructor and Description |
---|
DefaultMetricSamplerPartitionAssignor() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<org.apache.kafka.common.TopicPartition> |
assignPartitions(org.apache.kafka.common.Cluster cluster)
Assign the partitions in the cluster to the single metric fetcher.
|
java.util.List<java.util.Set<org.apache.kafka.common.TopicPartition>> |
assignPartitions(org.apache.kafka.common.Cluster cluster,
int numMetricFetchers) |
void |
configure(java.util.Map<java.lang.String,?> configs)
Configure this class with the given key-value pairs
|
public DefaultMetricSamplerPartitionAssignor()
public void configure(java.util.Map<java.lang.String,?> configs)
CruiseControlConfigurable
configure
in interface CruiseControlConfigurable
public java.util.List<java.util.Set<org.apache.kafka.common.TopicPartition>> assignPartitions(org.apache.kafka.common.Cluster cluster, int numMetricFetchers)
assignPartitions
in interface MetricSamplerPartitionAssignor
cluster
- The Kafka cluster.numMetricFetchers
- The number of metric fetchers.public java.util.Set<org.apache.kafka.common.TopicPartition> assignPartitions(org.apache.kafka.common.Cluster cluster)
MetricSamplerPartitionAssignor
assignPartitions
in interface MetricSamplerPartitionAssignor
cluster
- The Kafka cluster