本文整理汇总了Java中org.apache.tajo.master.rm.TajoWorkerContainerId类的典型用法代码示例。如果您正苦于以下问题:Java TajoWorkerContainerId类的具体用法?Java TajoWorkerContainerId怎么用?Java TajoWorkerContainerId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TajoWorkerContainerId类属于org.apache.tajo.master.rm包,在下文中一共展示了TajoWorkerContainerId类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: releaseWorkerResource
import org.apache.tajo.master.rm.TajoWorkerContainerId; //导入依赖的package包/类
public static void releaseWorkerResource(QueryMasterTask.QueryMasterTaskContext context,
ExecutionBlockId executionBlockId,
List<ContainerId> containerIds) throws Exception {
List<YarnProtos.ContainerIdProto> containerIdProtos =
new ArrayList<YarnProtos.ContainerIdProto>();
for(ContainerId eachContainerId: containerIds) {
containerIdProtos.add(TajoWorkerContainerId.getContainerIdProto(eachContainerId));
}
RpcConnectionPool connPool = RpcConnectionPool.getPool(context.getConf());
NettyClientBase tmClient = null;
try {
tmClient = connPool.getConnection(context.getQueryMasterContext().getWorkerContext().getTajoMasterAddress(),
TajoMasterProtocol.class, true);
TajoMasterProtocol.TajoMasterProtocolService masterClientService = tmClient.getStub();
masterClientService.releaseWorkerResource(null,
TajoMasterProtocol.WorkerResourceReleaseRequest.newBuilder()
.setExecutionBlockId(executionBlockId.getProto())
.addAllContainerIds(containerIdProtos)
.build(),
NullCallback.get());
} catch (Exception e) {
LOG.error(e.getMessage(), e);
} finally {
connPool.releaseConnection(tmClient);
}
}
示例2: makeContainerId
import org.apache.tajo.master.rm.TajoWorkerContainerId; //导入依赖的package包/类
@Override
public ContainerId makeContainerId(YarnProtos.ContainerIdProto containerIdProto) {
TajoWorkerContainerId containerId = new TajoWorkerContainerId();
ApplicationAttemptId appAttemptId = new ApplicationAttemptIdPBImpl(containerIdProto.getAppAttemptId());
containerId.setApplicationAttemptId(appAttemptId);
containerId.setId(containerIdProto.getId());
return containerId;
}