@Override public void run() { logger.info("Closing DistributedLog Server."); server.close(); logger.info("Closed DistributedLog Server."); statsProvider.stop(); } });
public void shutdown() { DistributedLogServer.closeServer(dlServer, 0, TimeUnit.MILLISECONDS); } }
DynamicDistributedLogConfiguration dynDlConf = getServiceDynConf(dlConf); getStreamConfigProvider(dlConf, converter); preRun(dlConf, serverConf); Pair<DistributedLogServiceImpl, Server> serverPair = runServer( serverConf, dlConf,
final DistributedLogServer server = DistributedLogServer.runServer( getOptionalStringArg(cmdline, "u"), confOptional, server.join(); } catch (InterruptedException e) { logger.warn("Interrupted when waiting distributedlog server to be finished : ", e); server.close(); logger.info("Closed DistributedLog Server."); statsProvider.stop();
throws ConfigurationException, IllegalArgumentException, IOException { final DistributedLogServer server = new DistributedLogServer( uri, conf, statsProvider); server.runServer(); return server;
static Pair<DistributedLogServiceImpl, Server> runServer( ServerConfiguration serverConf, DistributedLogConfiguration dlConf, URI dlUri, StreamPartitionConverter converter, StatsProvider provider, int port) throws IOException { return runServer(serverConf, dlConf, ConfUtils.getConstDynConf(dlConf), dlUri, converter, provider, port, new CountDownLatch(0), new NullStatsReceiver(), false, new NullStreamConfigProvider()); }
serverConf.loadConf(dlConf); serverConf.setServerShardId(proxyPort); serverPair = DistributedLogServer.runServer( serverConf, dlConf,
/** * Close the server. */ public void close() { if (null != announcer) { try { announcer.unannounce(); } catch (IOException e) { logger.warn("Error on unannouncing service : ", e); } announcer.close(); } closeServer(Pair.of(dlService, server), gracefulShutdownMs, TimeUnit.MILLISECONDS); if (null != statsProvider) { statsProvider.stop(); } SchedulerUtils.shutdownScheduler(configExecutorService, 60, TimeUnit.SECONDS); keepAliveLatch.countDown(); }