public class LoadMonitorTaskRunner extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LoadMonitorTaskRunner.LoadMonitorTaskRunnerState |
Constructor and Description |
---|
LoadMonitorTaskRunner(KafkaCruiseControlConfig config,
KafkaReplicaMetricSampleAggregator replicaMetricSampleAggregator,
KafkaPartitionMetricSampleAggregator partitionMetricSampleAggregator,
KafkaBrokerMetricSampleAggregator brokerMetricSampleAggregator,
MetadataClient metadataClient,
org.apache.kafka.common.utils.Time time,
DataBalancerMetricsRegistry metricRegistry,
BrokerCapacityConfigResolver brokerCapacityConfigResolver)
Private constructor to avoid duplicate code.
|
Modifier and Type | Method and Description |
---|---|
boolean |
awaitingPauseSampling()
Allow tasks to know if another thread, e.g.
|
void |
pauseSampling(String reason)
Pause the scheduled sampling tasks..
|
String |
reasonOfLatestPauseOrResume() |
void |
resumeSampling(String reason)
Resume the scheduled sampling tasks.
|
void |
shutdown()
Shutdown the task runner.
|
void |
start()
Start the metric fetchers and sampling scheduler thread.
|
LoadMonitorTaskRunner.LoadMonitorTaskRunnerState |
state()
Get the state of the task runner.
|
public LoadMonitorTaskRunner(KafkaCruiseControlConfig config, KafkaReplicaMetricSampleAggregator replicaMetricSampleAggregator, KafkaPartitionMetricSampleAggregator partitionMetricSampleAggregator, KafkaBrokerMetricSampleAggregator brokerMetricSampleAggregator, MetadataClient metadataClient, org.apache.kafka.common.utils.Time time, DataBalancerMetricsRegistry metricRegistry, BrokerCapacityConfigResolver brokerCapacityConfigResolver)
config
- The load monitor configurations.partitionMetricSampleAggregator
- The KafkaPartitionMetricSampleAggregator
to aggregate partition metrics.brokerMetricSampleAggregator
- The KafkaBrokerMetricSampleAggregator
to aggregate broker metrics.metadataClient
- The metadata of the cluster.time
- The time object.metricRegistry
- The metric registry that holds all the metrics for monitoring Cruise Control.brokerCapacityConfigResolver
- The resolver for retrieving broker capacities.public LoadMonitorTaskRunner.LoadMonitorTaskRunnerState state()
public void start()
public void shutdown()
public void pauseSampling(String reason)
reason
- The reason for pausing metric sampling.public void resumeSampling(String reason)
reason
- The reason for resuming metric sampling.public String reasonOfLatestPauseOrResume()
public boolean awaitingPauseSampling()