Package org.apache.tajo

Examples of org.apache.tajo.QueryId


    @Override
    public ClientProtos.GetQueryResultResponse getQueryResult(
            RpcController controller,
            ClientProtos.GetQueryResultRequest request) throws ServiceException {
      QueryId queryId = new QueryId(request.getQueryId());
      Query query = workerContext.getQueryMaster().getQueryMasterTask(queryId, true).getQuery();

      ClientProtos.GetQueryResultResponse.Builder builder = ClientProtos.GetQueryResultResponse.newBuilder();
      try {
        builder.setTajoUserName(UserGroupInformation.getCurrentUser().getUserName());
View Full Code Here


    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);
View Full Code Here

    @Override
    public PrimitiveProtos.BoolProto closeQuery (
            RpcController controller,
            TajoIdProtos.QueryIdProto request) throws ServiceException {
      final QueryId queryId = new QueryId(request);
      LOG.info("Stop Query:" + queryId);
      return BOOL_TRUE;
    }
View Full Code Here

import static junit.framework.Assert.assertEquals;

public class TestRepartitioner {
  @Test
  public void testCreateHashFetchURL() throws Exception {
    QueryId q1 = TestTajoIds.createQueryId(1315890136000l, 2);
    String hostName = "tajo1";
    int port = 1234;
    ExecutionBlockId sid = new ExecutionBlockId(q1, 2);
    int partitionId = 2;
View Full Code Here

    final int minMemory = 256;
    final int maxMemory = 512;
    float diskSlots = 1.0f;

    QueryId queryId = QueryIdFactory.newQueryId(queryIdTime, 1);
    ExecutionBlockId ebId = QueryIdFactory.newExecutionBlockId(queryId);

    WorkerResourceAllocationRequest request = WorkerResourceAllocationRequest.newBuilder()
        .setResourceRequestPriority(ResourceRequestPriority.MEMORY)
        .setNumContainers(60)
View Full Code Here

    final int minMemory = 200;
    final int maxMemory = 500;
    float diskSlots = 1.0f;

    QueryId queryId = QueryIdFactory.newQueryId(queryIdTime, 2);
    ExecutionBlockId ebId = QueryIdFactory.newExecutionBlockId(queryId);

    int requiredContainers = 60;

    int numAllocatedContainers = 0;
View Full Code Here

    TajoWorkerResourceManager tajoWorkerResourceManager = initResourceManager(false);
    final float minDiskSlots = 1.0f;
    final float maxDiskSlots = 2.0f;
    int memoryMB = 256;

    QueryId queryId = QueryIdFactory.newQueryId(queryIdTime, 3);
    ExecutionBlockId ebId = QueryIdFactory.newExecutionBlockId(queryId);

    WorkerResourceAllocationRequest request = WorkerResourceAllocationRequest.newBuilder()
        .setResourceRequestPriority(ResourceRequestPriority.DISK)
        .setNumContainers(60)
View Full Code Here

    TajoWorkerResourceManager tajoWorkerResourceManager = initResourceManager(true);

    int qmDefaultMemoryMB = tajoConf.getIntVar(TajoConf.ConfVars.TAJO_QUERYMASTER_MEMORY_MB);
    float qmDefaultDiskSlots = tajoConf.getFloatVar(TajoConf.ConfVars.TAJO_QUERYMASTER_DISK_SLOT);

    QueryId queryId = QueryIdFactory.newQueryId(queryIdTime, 4);

    tajoWorkerResourceManager.allocateQueryMaster(queryId);

    // assert after callback
    int totalUsedMemory = 0;
View Full Code Here

    if(yarnContainerMode && queryMasterMode) {
      tajoMasterAddress = NetUtils.createSocketAddr(cmdArgs[2]);
      connectToCatalog();

      QueryId queryId = TajoIdUtils.parseQueryId(cmdArgs[1]);
      queryMasterManagerService.getQueryMaster().reportQueryStatusToQueryMaster(
          queryId, TajoProtos.QueryState.QUERY_MASTER_LAUNCHED);
    } else if(yarnContainerMode && taskRunnerMode) { //TaskRunner mode
      taskRunnerManager.startTask(cmdArgs);
    } else {
View Full Code Here

    @Override
    public GetQueryResultResponse getQueryResult(RpcController controller,
                                                 GetQueryResultRequest request) throws ServiceException {
      try {
        context.getSessionManager().touch(request.getSessionId().getId());
        QueryId queryId = new QueryId(request.getQueryId());
        QueryInProgress queryInProgress = context.getQueryJobManager().getQueryInProgress(queryId);

        // if we cannot get a QueryInProgress instance from QueryJobManager,
        // the instance can be in the finished query list.
        if (queryInProgress == null) {
          queryInProgress = context.getQueryJobManager().getFinishedQuery(queryId);
        }

        GetQueryResultResponse.Builder builder = GetQueryResultResponse.newBuilder();

        // If we cannot the QueryInProgress instance from the finished list,
        // the query result was expired due to timeout.
        // In this case, we will result in error.
        if (queryInProgress == null) {
          builder.setErrorMessage("No such query: " + queryId.toString());
          return builder.build();
        }

        QueryInfo queryInfo = queryInProgress.getQueryInfo();
View Full Code Here

TOP

Related Classes of org.apache.tajo.QueryId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.