public void init(Configuration conf) { LOG.info("QueryMaster init"); try { this.systemConf = (TajoConf) conf; this.connPool = RpcConnectionPool.getPool(systemConf); querySessionTimeout = systemConf.getIntVar(TajoConf.ConfVars.QUERY_SESSION_TIMEOUT); queryMasterContext = new QueryMasterContext(systemConf); clock = new SystemClock(); this.dispatcher = new TajoAsyncDispatcher("querymaster_" + System.currentTimeMillis()); addIfService(dispatcher); this.storageManager = StorageManagerFactory.getStorageManager(systemConf); globalPlanner = new GlobalPlanner(systemConf, workerContext); dispatcher.register(QueryStartEvent.EventType.class, new QueryStartEventHandler()); } catch (Throwable t) { LOG.error(t.getMessage(), t); throw new RuntimeException(t); } super.init(conf); }
@Override public void serviceStart() throws Exception { // Start the Shuffle service before the listener - until it's a service as well. ShuffleHandler.initializeAndStart(shuffleHandlerConf); LOG.info("Setting shuffle port to: " + ShuffleHandler.get().getPort()); this.shufflePort.set(ShuffleHandler.get().getPort()); super.serviceStart(); LOG.info("LlapDaemon serviceStart complete"); }
@Override public void start() { LOG.info("QueryMaster start"); queryHeartbeatThread = new QueryHeartbeatThread(); queryHeartbeatThread.start(); clientSessionTimeoutCheckThread = new ClientSessionTimeoutCheckThread(); clientSessionTimeoutCheckThread.start(); finishedQueryMasterTaskCleanThread = new FinishedQueryMasterTaskCleanThread(); finishedQueryMasterTaskCleanThread.start(); super.start(); }
@Override public synchronized void serviceInit(Configuration conf) throws Exception { if (rmContext.isHAEnabled()) { autoFailoverEnabled = HAUtil.isAutomaticFailoverEnabled(conf); } masterServiceAddress = conf.getSocketAddr( YarnConfiguration.RM_ADMIN_ADDRESS, YarnConfiguration.DEFAULT_RM_ADMIN_ADDRESS, YarnConfiguration.DEFAULT_RM_ADMIN_PORT); adminAcl = new AccessControlList( conf.get(YarnConfiguration.YARN_ADMIN_ACL, YarnConfiguration.DEFAULT_YARN_ADMIN_ACL)); rmId = conf.get(YarnConfiguration.RM_HA_ID); super.serviceInit(conf); }
@Override public void stop() { if (queryMasterStop.getAndSet(true)) { return; } if (queryHeartbeatThread != null) { queryHeartbeatThread.interrupt(); } if (clientSessionTimeoutCheckThread != null) { clientSessionTimeoutCheckThread.interrupt(); } if (finishedQueryMasterTaskCleanThread != null) { finishedQueryMasterTaskCleanThread.interrupt(); } super.stop(); LOG.info("QueryMaster stop"); if (queryMasterContext.getWorkerContext().isYarnContainerMode()) { queryMasterContext.getWorkerContext().stopWorker(true); } }
@Override protected synchronized void serviceStop() throws Exception { stopServer(); super.serviceStop(); }
public void serviceStop() throws Exception { super.serviceStop(); ShuffleHandler.shutdown(); shutdown(); LOG.info("LlapDaemon shutdown complete"); }
@Override public void serviceInit(Configuration conf) throws Exception { super.serviceInit(conf); LlapIoProxy.setDaemon(true); LlapIoProxy.initializeLlapIo(conf); }