Search in sources :

Example 1 with LoadMonitor

use of com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor in project cruise-control by linkedin.

the class BrokerFailureDetectorTest method createBrokerFailureDetector.

private BrokerFailureDetector createBrokerFailureDetector(Queue<Anomaly> anomalies, Time time) {
    LoadMonitor mockLoadMonitor = EasyMock.mock(LoadMonitor.class);
    EasyMock.expect(mockLoadMonitor.brokersWithPartitions(anyLong())).andAnswer(() -> new HashSet<>(Arrays.asList(0, 1))).anyTimes();
    EasyMock.replay(mockLoadMonitor);
    Properties props = KafkaCruiseControlUnitTestUtils.getKafkaCruiseControlProperties();
    props.setProperty(KafkaCruiseControlConfig.ZOOKEEPER_CONNECT_CONFIG, zookeeper().getConnectionString());
    KafkaCruiseControlConfig kafkaCruiseControlConfig = new KafkaCruiseControlConfig(props);
    return new BrokerFailureDetector(kafkaCruiseControlConfig, mockLoadMonitor, anomalies, time);
}
Also used : KafkaCruiseControlConfig(com.linkedin.kafka.cruisecontrol.config.KafkaCruiseControlConfig) Properties(java.util.Properties) LoadMonitor(com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor) HashSet(java.util.HashSet)

Aggregations

KafkaCruiseControlConfig (com.linkedin.kafka.cruisecontrol.config.KafkaCruiseControlConfig)1 LoadMonitor (com.linkedin.kafka.cruisecontrol.monitor.LoadMonitor)1 HashSet (java.util.HashSet)1 Properties (java.util.Properties)1