本文整理汇总了Java中org.apache.tajo.master.querymaster.QueryMasterTask类的典型用法代码示例。如果您正苦于以下问题:Java QueryMasterTask类的具体用法?Java QueryMasterTask怎么用?Java QueryMasterTask使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
QueryMasterTask类属于org.apache.tajo.master.querymaster包,在下文中一共展示了QueryMasterTask类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sortQueryMasterTask
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public static List<QueryMasterTask> sortQueryMasterTask(Collection<QueryMasterTask> queryMasterTasks,
final boolean desc) {
List<QueryMasterTask> queryMasterTaskList = new ArrayList<QueryMasterTask>(queryMasterTasks);
Collections.sort(queryMasterTaskList, new Comparator<QueryMasterTask>() {
@Override
public int compare(QueryMasterTask task1, QueryMasterTask task2) {
if(desc) {
return task2.getQueryId().toString().compareTo(task1.getQueryId().toString());
} else {
return task1.getQueryId().toString().compareTo(task2.getQueryId().toString());
}
}
});
return queryMasterTaskList;
}
示例2: YarnContainerProxy
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnContainerProxy(QueryMasterTask.QueryMasterTaskContext context, Configuration conf, YarnRPC yarnRPC,
Container container, ExecutionBlockId executionBlockId) {
super(context, conf, executionBlockId, container);
this.yarnRPC = yarnRPC;
NodeId nodeId = container.getNodeId();
this.containerMgrAddress = nodeId.getHost() + ":" + nodeId.getPort();
this.containerToken = container.getContainerToken();
}
示例3: releaseWorkerResource
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public static void releaseWorkerResource(QueryMasterTask.QueryMasterTaskContext context,
ExecutionBlockId executionBlockId,
ContainerId containerId) throws Exception {
List<ContainerId> containerIds = new ArrayList<ContainerId>();
containerIds.add(containerId);
releaseWorkerResource(context, executionBlockId, containerIds);
}
示例4: ContainerProxy
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public ContainerProxy(QueryMasterTask.QueryMasterTaskContext context, Configuration conf,
ExecutionBlockId executionBlockId, Container container) {
this.context = context;
this.conf = conf;
this.state = ContainerState.PREP;
this.container = container;
this.executionBlockId = executionBlockId;
this.containerID = container.getId();
}
示例5: YarnTaskRunnerLauncherImpl
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnTaskRunnerLauncherImpl(QueryMasterTask.QueryMasterTaskContext context, YarnRPC yarnRPC) {
super(YarnTaskRunnerLauncherImpl.class.getName());
this.context = context;
this.yarnRPC = yarnRPC;
executorService = Executors.newFixedThreadPool(
context.getConf().getIntVar(TajoConf.ConfVars.YARN_RM_TASKRUNNER_LAUNCH_PARALLEL_NUM));
}
示例6: TajoResourceAllocator
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public TajoResourceAllocator(QueryMasterTask.QueryMasterTaskContext queryTaskContext) {
this.queryTaskContext = queryTaskContext;
executorService = Executors.newFixedThreadPool(
queryTaskContext.getConf().getIntVar(TajoConf.ConfVars.YARN_RM_TASKRUNNER_LAUNCH_PARALLEL_NUM));
}
示例7: YarnResourceAllocator
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnResourceAllocator(QueryMasterTask.QueryMasterTaskContext queryTaskContext) {
this.queryTaskContext = queryTaskContext;
}
示例8: YarnContainerProxy
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnContainerProxy(QueryMasterTask.QueryMasterTaskContext context, Configuration conf, YarnRPC yarnRPC,
Container container, ExecutionBlockId executionBlockId) {
super(context, conf, executionBlockId, container);
this.yarnRPC = yarnRPC;
NodeId nodeId = container.getNodeId();
this.containerMgrAddress = nodeId.getHost() + ":" + nodeId.getPort();
this.containerToken = container.getContainerToken();
}
示例9: TaskSchedulerContext
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public TaskSchedulerContext(QueryMasterTask.QueryMasterTaskContext masterContext, boolean isLeafQuery,
ExecutionBlockId blockId) {
this.masterContext = masterContext;
this.isLeafQuery = isLeafQuery;
this.blockId = blockId;
}
示例10: getQueryPlan
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
private MasterPlan getQueryPlan(QueryId queryId) {
for (TajoWorker eachWorker: testingCluster.getTajoWorkers()) {
QueryMasterTask queryMasterTask = eachWorker.getWorkerContext().getQueryMaster().getQueryMasterTask(queryId, true);
if (queryMasterTask != null) {
return queryMasterTask.getQuery().getPlan();
}
}
fail("Can't find query from workers" + queryId);
return null;
}
示例11: TajoContainerProxy
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public TajoContainerProxy(QueryMasterTask.QueryMasterTaskContext context,
Configuration conf, Container container,
ExecutionBlockId executionBlockId) {
super(context, conf, executionBlockId, container);
}
示例12: getMasterContext
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public QueryMasterTask.QueryMasterTaskContext getMasterContext() {
return masterContext;
}
示例13: YarnRMContainerAllocator
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnRMContainerAllocator(QueryMasterTask.QueryMasterTaskContext context) {
super();
this.context = context;
this.appAttemptId = ApplicationIdUtils.createApplicationAttemptId(context.getQueryId());
this.eventHandler = context.getDispatcher().getEventHandler();
}
示例14: getQueryStatus
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
@Override
public ClientProtos.GetQueryStatusResponse getQueryStatus(
RpcController controller,
ClientProtos.GetQueryStatusRequest request) throws ServiceException {
ClientProtos.GetQueryStatusResponse.Builder builder
= ClientProtos.GetQueryStatusResponse.newBuilder();
QueryId queryId = new QueryId(request.getQueryId());
builder.setQueryId(request.getQueryId());
if (queryId.equals(QueryIdFactory.NULL_QUERY_ID)) {
builder.setResultCode(ClientProtos.ResultCode.OK);
builder.setState(TajoProtos.QueryState.QUERY_SUCCEEDED);
} else {
QueryMasterTask queryMasterTask = workerContext.getQueryMaster().getQueryMasterTask(queryId);
builder.setResultCode(ClientProtos.ResultCode.OK);
builder.setQueryMasterHost(bindAddr.getHostName());
builder.setQueryMasterPort(bindAddr.getPort());
if (queryMasterTask == null) {
queryMasterTask = workerContext.getQueryMaster().getQueryMasterTask(queryId, true);
}
if (queryMasterTask == null) {
builder.setState(TajoProtos.QueryState.QUERY_NOT_ASSIGNED);
return builder.build();
}
queryMasterTask.touchSessionTime();
Query query = queryMasterTask.getQuery();
builder.setState(query.getState());
builder.setProgress(query.getProgress());
builder.setSubmitTime(query.getAppSubmitTime());
builder.setHasResult(
!(queryMasterTask.getQueryTaskContext().getQueryContext().isCreateTable() ||
queryMasterTask.getQueryTaskContext().getQueryContext().isInsert())
);
if (query.getState() == TajoProtos.QueryState.QUERY_SUCCEEDED) {
builder.setFinishTime(query.getFinishTime());
} else {
builder.setFinishTime(System.currentTimeMillis());
}
}
return builder.build();
}
示例15: YarnRMContainerAllocator
import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnRMContainerAllocator(QueryMasterTask.QueryMasterTaskContext context) {
super(ApplicationIdUtils.createApplicationAttemptId(context.getQueryId()));
this.context = context;
this.eventHandler = context.getDispatcher().getEventHandler();
}