public TaskRunner(TaskRunnerManager taskRunnerManager, TajoConf conf, String[] args) {
super(TaskRunner.class.getName());
this.taskRunnerManager = taskRunnerManager;
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]);
final InetSocketAddress masterAddr = NetUtils.createSocketAddrForHost(host, port);
LOG.info("QueryMaster Address:" + masterAddr);
// 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) {