Source:
public void start() throws ISE { synchronized (lifecycleLock) { if (!lifecycleLock.canStart()) { throw new ISE("can't start."); } log.info("Starting HttpServerInventoryView."); try { executor = ScheduledExecutors.fixed( config.getNumThreads(), "HttpServerInventoryView-%s" ); DruidNodeDiscovery druidNodeDiscovery = druidNodeDiscoveryProvider.getForService(DataNodeService.DISCOVERY_SERVICE_KEY); druidNodeDiscovery.registerListener( new DruidNodeDiscovery.Listener() { private final AtomicBoolean initialized = new AtomicBoolean(false); @Override public void nodesAdded(Collection<DiscoveryDruidNode> nodes) { nodes.forEach(node -> serverAdded(toDruidServer(node))); } @Override public void nodesRemoved(Collection<DiscoveryDruidNode> nodes) { nodes.forEach(node -> serverRemoved(toDruidServer(node))); } @Override public void nodeViewInitialized() { if (!initialized.getAndSet(true)) { executor.execute(HttpServerInventoryView.this::serverInventoryInitialized); } } private DruidServer toDruidServer(DiscoveryDruidNode node) { return new DruidServer( node.getDruidNode().getHostAndPortToUse(), node.getDruidNode().getHostAndPort(), node.getDruidNode().getHostAndTlsPort(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getMaxSize(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getType(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getTier(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getPriority() ); } } ); scheduleSyncMonitoring(); lifecycleLock.started(); } finally { lifecycleLock.exitStart(); } log.info("Started HttpServerInventoryView."); } }

Target:
public void start() { synchronized (lifecycleLock) { if (!lifecycleLock.canStart()) { throw new ISE("can't start."); } log.info("Starting HttpServerInventoryView."); try { executor = ScheduledExecutors.fixed( config.getNumThreads(), "HttpServerInventoryView-%s" ); DruidNodeDiscovery druidNodeDiscovery = druidNodeDiscoveryProvider.getForService(DataNodeService.DISCOVERY_SERVICE_KEY); druidNodeDiscovery.registerListener( new DruidNodeDiscovery.Listener() { private final AtomicBoolean initialized = new AtomicBoolean(false); @Override public void nodesAdded(Collection<DiscoveryDruidNode> nodes) { nodes.forEach(node -> serverAdded(toDruidServer(node))); } @Override public void nodesRemoved(Collection<DiscoveryDruidNode> nodes) { nodes.forEach(node -> serverRemoved(toDruidServer(node))); } @Override public void nodeViewInitialized() { if (!initialized.getAndSet(true)) { executor.execute(HttpServerInventoryView.this::serverInventoryInitialized); } } private DruidServer toDruidServer(DiscoveryDruidNode node) { return new DruidServer( node.getDruidNode().getHostAndPortToUse(), node.getDruidNode().getHostAndPort(), node.getDruidNode().getHostAndTlsPort(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getMaxSize(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getType(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getTier(), ((DataNodeService) node.getServices().get(DataNodeService.DISCOVERY_SERVICE_KEY)).getPriority() ); } } ); scheduleSyncMonitoring(); lifecycleLock.started(); } finally { lifecycleLock.exitStart(); } log.info("Started HttpServerInventoryView."); } }