Source:
public BrokerServerView( final QueryToolChestWarehouse warehouse, final QueryWatcher queryWatcher, final @Smile ObjectMapper smileMapper, final @EscalatedClient HttpClient httpClient, final FilteredServerInventoryView baseView, final TierSelectorStrategy tierSelectorStrategy, final ServiceEmitter emitter, final BrokerSegmentWatcherConfig segmentWatcherConfig ) { this.warehouse = warehouse; this.queryWatcher = queryWatcher; this.smileMapper = smileMapper; this.httpClient = httpClient; this.baseView = baseView; this.tierSelectorStrategy = tierSelectorStrategy; this.emitter = emitter; this.segmentWatcherConfig = segmentWatcherConfig; this.clients = new ConcurrentHashMap<>(); this.selectors = new HashMap<>(); this.timelines = new HashMap<>(); this.segmentFilter = metadataAndSegment -> { if (segmentWatcherConfig.getWatchedTiers() != null && !segmentWatcherConfig.getWatchedTiers().contains(metadataAndSegment.lhs.getTier())) { return false; } if (segmentWatcherConfig.getWatchedDataSources() != null && !segmentWatcherConfig.getWatchedDataSources().contains(metadataAndSegment.rhs.getDataSource())) { return false; } return true; }; ExecutorService exec = Execs.singleThreaded("BrokerServerView-%s"); baseView.registerSegmentCallback( exec, new ServerView.SegmentCallback() { @Override public ServerView.CallbackAction segmentAdded(DruidServerMetadata server, DataSegment segment) { serverAddedSegment(server, segment); return ServerView.CallbackAction.CONTINUE; } @Override public ServerView.CallbackAction segmentRemoved(final DruidServerMetadata server, DataSegment segment) { serverRemovedSegment(server, segment); return ServerView.CallbackAction.CONTINUE; } @Override public CallbackAction segmentViewInitialized() { initialized.countDown(); runTimelineCallbacks(TimelineCallback::timelineInitialized); return ServerView.CallbackAction.CONTINUE; } }, segmentFilter ); baseView.registerServerRemovedCallback( exec, server -> { removeServer(server); return CallbackAction.CONTINUE; } ); }

Target:
public BrokerServerView( final QueryToolChestWarehouse warehouse, final QueryWatcher queryWatcher, final @Smile ObjectMapper smileMapper, final @EscalatedClient HttpClient httpClient, final FilteredServerInventoryView baseView, final TierSelectorStrategy tierSelectorStrategy, final ServiceEmitter emitter, final BrokerSegmentWatcherConfig segmentWatcherConfig ) { this.warehouse = warehouse; this.queryWatcher = queryWatcher; this.smileMapper = smileMapper; this.httpClient = httpClient; this.baseView = baseView; this.tierSelectorStrategy = tierSelectorStrategy; this.emitter = emitter; this.segmentWatcherConfig = segmentWatcherConfig; this.clients = new ConcurrentHashMap<>(); this.selectors = new HashMap<>(); this.timelines = new HashMap<>(); this.segmentFilter = (Pair<DruidServerMetadata, DataSegment> metadataAndSegment) -> { if (segmentWatcherConfig.getWatchedTiers() != null && !segmentWatcherConfig.getWatchedTiers().contains(metadataAndSegment.lhs.getTier())) { return false; } if (segmentWatcherConfig.getWatchedDataSources() != null && !segmentWatcherConfig.getWatchedDataSources().contains(metadataAndSegment.rhs.getDataSource())) { return false; } return true; }; ExecutorService exec = Execs.singleThreaded("BrokerServerView-%s"); baseView.registerSegmentCallback( exec, new ServerView.SegmentCallback() { @Override public ServerView.CallbackAction segmentAdded(DruidServerMetadata server, DataSegment segment) { serverAddedSegment(server, segment); return ServerView.CallbackAction.CONTINUE; } @Override public ServerView.CallbackAction segmentRemoved(final DruidServerMetadata server, DataSegment segment) { serverRemovedSegment(server, segment); return ServerView.CallbackAction.CONTINUE; } @Override public CallbackAction segmentViewInitialized() { initialized.countDown(); runTimelineCallbacks(TimelineCallback::timelineInitialized); return ServerView.CallbackAction.CONTINUE; } }, segmentFilter ); baseView.registerServerRemovedCallback( exec, server -> { removeServer(server); return CallbackAction.CONTINUE; } ); }