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