public class MetricFetcherManager extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BROKER_CAPACITY_CONFIG_RESOLVER_OBJECT_CONFIG |
static String |
DEFAULT_BROKER_CAPACITY_CONFIG_RESOLVER_OBJECT_CONFIG |
Constructor and Description |
---|
MetricFetcherManager(KafkaCruiseControlConfig config,
KafkaReplicaMetricSampleAggregator replicaMetricSampleAggregator,
KafkaPartitionMetricSampleAggregator partitionMetricSampleAggregator,
KafkaBrokerMetricSampleAggregator brokerMetricSampleAggregator,
MetadataClient metadataClient,
org.apache.kafka.common.utils.Time time,
DataBalancerMetricsRegistry metricRegistry,
BrokerCapacityConfigResolver brokerCapacityConfigResolver,
MetricSampler sampler)
Create a metric fetcher manager.
|
Modifier and Type | Method and Description |
---|---|
boolean |
fetchPartitionMetricSamples(long startMs,
long endMs,
long timeoutMs)
Fetch the partition metric samples for a given period.
|
void |
shutdown()
Shutdown the metric fetcher manager.
|
void |
start() |
public static final String BROKER_CAPACITY_CONFIG_RESOLVER_OBJECT_CONFIG
public static final String DEFAULT_BROKER_CAPACITY_CONFIG_RESOLVER_OBJECT_CONFIG
public MetricFetcherManager(KafkaCruiseControlConfig config, KafkaReplicaMetricSampleAggregator replicaMetricSampleAggregator, KafkaPartitionMetricSampleAggregator partitionMetricSampleAggregator, KafkaBrokerMetricSampleAggregator brokerMetricSampleAggregator, MetadataClient metadataClient, org.apache.kafka.common.utils.Time time, DataBalancerMetricsRegistry metricRegistry, BrokerCapacityConfigResolver brokerCapacityConfigResolver, MetricSampler sampler)
config
- The load monitor configurations.partitionMetricSampleAggregator
- The KafkaPartitionMetricSampleAggregator
to aggregate partition metrics.brokerMetricSampleAggregator
- The KafkaBrokerMetricSampleAggregator
to aggregate the broker metrics.metadataClient
- The metadata of the cluster.time
- The time object.metricRegistry
- The Metric Registry object.brokerCapacityConfigResolver
- The resolver for retrieving broker capacities.public void start()
public void shutdown()
public boolean fetchPartitionMetricSamples(long startMs, long endMs, long timeoutMs)
startMs
- the starting time of the fetching period.endMs
- the end time of the fetching period.timeoutMs
- the timeout.