Exemplo n.º 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);
  }
Exemplo n.º 2
0
 @Override
 public void handle(Event event) {
   dispatcher.getEventHandler().handle(event);
 }