Example #1
0
  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);
  }
Example #2
0
 @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");
 }
Example #3
0
  @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();
  }
Example #4
0
  @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);
  }
Example #5
0
  @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);
    }
  }
Example #6
0
 @Override
 protected synchronized void serviceStop() throws Exception {
   stopServer();
   super.serviceStop();
 }
Example #7
0
 public void serviceStop() throws Exception {
   super.serviceStop();
   ShuffleHandler.shutdown();
   shutdown();
   LOG.info("LlapDaemon shutdown complete");
 }
Example #8
0
 @Override
 public void serviceInit(Configuration conf) throws Exception {
   super.serviceInit(conf);
   LlapIoProxy.setDaemon(true);
   LlapIoProxy.initializeLlapIo(conf);
 }