public class DefaultMetricSamplerPartitionAssignor extends 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 |
---|---|
Set<org.apache.kafka.common.TopicPartition> |
assignPartitions(org.apache.kafka.common.Cluster cluster)
Assign the partitions in the cluster to the single metric fetcher.
|
List<Set<org.apache.kafka.common.TopicPartition>> |
assignPartitions(org.apache.kafka.common.Cluster cluster,
int numMetricFetchers) |
void |
configure(Map<String,?> configs)
Configure this class with the given key-value pairs
|
public DefaultMetricSamplerPartitionAssignor()
public void configure(Map<String,?> configs)
CruiseControlConfigurable
configure
in interface CruiseControlConfigurable
public List<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 Set<org.apache.kafka.common.TopicPartition> assignPartitions(org.apache.kafka.common.Cluster cluster)
MetricSamplerPartitionAssignor
assignPartitions
in interface MetricSamplerPartitionAssignor
cluster
- The Kafka cluster