use of org.apache.druid.client.BrokerServerView in project druid by druid-io.
the class DatasourceOptimizerTest method setupViews.
private void setupViews() throws Exception {
baseView = new BatchServerInventoryView(zkPathsConfig, curator, jsonMapper, Predicates.alwaysTrue(), "test") {
@Override
public void registerSegmentCallback(Executor exec, final SegmentCallback callback) {
super.registerSegmentCallback(exec, new SegmentCallback() {
@Override
public CallbackAction segmentAdded(DruidServerMetadata server, DataSegment segment) {
return callback.segmentAdded(server, segment);
}
@Override
public CallbackAction segmentRemoved(DruidServerMetadata server, DataSegment segment) {
return callback.segmentRemoved(server, segment);
}
@Override
public CallbackAction segmentViewInitialized() {
return callback.segmentViewInitialized();
}
});
}
};
brokerServerView = new BrokerServerView(EasyMock.createMock(QueryToolChestWarehouse.class), EasyMock.createMock(QueryWatcher.class), getSmileMapper(), EasyMock.createMock(HttpClient.class), baseView, new HighestPriorityTierSelectorStrategy(new RandomServerSelectorStrategy()), new NoopServiceEmitter(), new BrokerSegmentWatcherConfig());
baseView.start();
}
Aggregations