Search in sources :

Example 1 with BrokerServerView

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();
}
Also used : BatchServerInventoryView(org.apache.druid.client.BatchServerInventoryView) Executor(java.util.concurrent.Executor) HighestPriorityTierSelectorStrategy(org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy) BrokerServerView(org.apache.druid.client.BrokerServerView) NoopServiceEmitter(org.apache.druid.server.metrics.NoopServiceEmitter) DruidServerMetadata(org.apache.druid.server.coordination.DruidServerMetadata) DataSegment(org.apache.druid.timeline.DataSegment) BrokerSegmentWatcherConfig(org.apache.druid.client.BrokerSegmentWatcherConfig) RandomServerSelectorStrategy(org.apache.druid.client.selector.RandomServerSelectorStrategy)

Aggregations

Executor (java.util.concurrent.Executor)1 BatchServerInventoryView (org.apache.druid.client.BatchServerInventoryView)1 BrokerSegmentWatcherConfig (org.apache.druid.client.BrokerSegmentWatcherConfig)1 BrokerServerView (org.apache.druid.client.BrokerServerView)1 HighestPriorityTierSelectorStrategy (org.apache.druid.client.selector.HighestPriorityTierSelectorStrategy)1 RandomServerSelectorStrategy (org.apache.druid.client.selector.RandomServerSelectorStrategy)1 DruidServerMetadata (org.apache.druid.server.coordination.DruidServerMetadata)1 NoopServiceEmitter (org.apache.druid.server.metrics.NoopServiceEmitter)1 DataSegment (org.apache.druid.timeline.DataSegment)1