this.taskRunnerManager = taskRunnerManager;
this.connPool = RpcConnectionPool.getPool(conf);
this.fetchLauncher = Executors.newFixedThreadPool(
conf.getIntVar(ConfVars.SHUFFLE_FETCHER_PARALLEL_EXECUTION_MAX_NUM));
try {
final ExecutionBlockId executionBlockId = TajoIdUtils.createExecutionBlockId(args[1]);
LOG.info("Tajo Root Dir: " + conf.getVar(ConfVars.ROOT_DIR));
LOG.info("Worker Local Dir: " + conf.getVar(ConfVars.WORKER_TEMPORAL_DIR));
UserGroupInformation.setConfiguration(conf);
// QueryBlockId from String
// NodeId has a form of hostname:port.
NodeId nodeId = ConverterUtils.toNodeId(args[2]);
this.containerId = ConverterUtils.toContainerId(args[3]);
// QueryMaster's address
String host = args[4];
int port = Integer.parseInt(args[5]);
this.qmMasterAddr = NetUtils.createSocketAddrForHost(host, port);
LOG.info("QueryMaster Address:" + qmMasterAddr);
// TODO - 'load credential' should be implemented
// Getting taskOwner
UserGroupInformation taskOwner = UserGroupInformation.createRemoteUser(conf.getVar(ConfVars.USERNAME));
//taskOwner.addToken(token);
// initialize MasterWorkerProtocol as an actual task owner.
// this.client =
// taskOwner.doAs(new PrivilegedExceptionAction<AsyncRpcClient>() {
// @Override
// public AsyncRpcClient run() throws Exception {
// return new AsyncRpcClient(TajoWorkerProtocol.class, masterAddr);
// }
// });
// this.master = client.getStub();
this.executionBlockId = executionBlockId;
this.queryId = executionBlockId.getQueryId();
this.nodeId = nodeId;
this.taskOwner = taskOwner;
this.taskRunnerContext = new TaskRunnerContext();
} catch (Exception e) {