当前位置: 首页>>代码示例>>Java>>正文


Java QueryMasterTask类代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:19,代码来源:JSPUtil.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:10,代码来源:YarnContainerProxy.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:9,代码来源:TajoContainerProxy.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:10,代码来源:ContainerProxy.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:8,代码来源:YarnTaskRunnerLauncherImpl.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:6,代码来源:TajoResourceAllocator.java

示例7: YarnResourceAllocator

import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public YarnResourceAllocator(QueryMasterTask.QueryMasterTaskContext queryTaskContext) {
  this.queryTaskContext = queryTaskContext;
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:4,代码来源:YarnResourceAllocator.java

示例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();
}
 
开发者ID:gruter,项目名称:tajo-cdh,代码行数:10,代码来源:YarnContainerProxy.java

示例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;
}
 
开发者ID:gruter,项目名称:tajo-cdh,代码行数:7,代码来源:TaskSchedulerContext.java

示例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;
}
 
开发者ID:gruter,项目名称:tajo-cdh,代码行数:12,代码来源:TestJoinBroadcast.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:6,代码来源:TajoContainerProxy.java

示例12: getMasterContext

import org.apache.tajo.master.querymaster.QueryMasterTask; //导入依赖的package包/类
public QueryMasterTask.QueryMasterTaskContext getMasterContext() {
  return masterContext;
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:4,代码来源:TaskSchedulerContext.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:7,代码来源:YarnRMContainerAllocator.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-tajo,代码行数:47,代码来源:TajoWorkerClientService.java

示例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();
}
 
开发者ID:gruter,项目名称:tajo-cdh,代码行数:6,代码来源:YarnRMContainerAllocator.java


注:本文中的org.apache.tajo.master.querymaster.QueryMasterTask类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。