Package org.apache.drill.exec.rpc

Examples of org.apache.drill.exec.rpc.RpcException


    SendBatchAsyncFuture b = new SendBatchAsyncFuture(batch, context);
    try{
      sendingSemaphore.acquire();
      manager.runCommand(b);
    }catch(InterruptedException e){
      b.connectionFailed(FailureType.CONNECTION, new RpcException("Interrupted while trying to get sending semaphore.", e));
    }
    return b.getFuture();
  }
View Full Code Here


      @Override
      public MessageLite getHandshakeResponse(BitClientHandshake inbound) throws Exception {
        // logger.debug("Handling handshake from other bit. {}", inbound);
        if (inbound.getRpcVersion() != DataRpcConfig.RPC_VERSION)
          throw new RpcException(String.format("Invalid rpc version.  Expected %d, actual %d.",
              inbound.getRpcVersion(), DataRpcConfig.RPC_VERSION));
        if (inbound.getChannel() != RpcChannel.BIT_DATA)
          throw new RpcException(String.format("Invalid NodeMode.  Expected BIT_DATA but received %s.",
              inbound.getChannel()));

        return BitServerHandshake.newBuilder().setRpcVersion(DataRpcConfig.RPC_VERSION).build();
      }
View Full Code Here

      QueryProfile profile;
      if (foreman == null) {
        try {
          profile = bee.getContext().getPersistentStoreProvider().getPStore(QueryStatus.QUERY_PROFILE).get(QueryIdHelper.getQueryId(queryId));
        } catch (IOException e) {
          throw new RpcException("Failed to get persistent store", e);
        }
      } else {
        profile = bee.getForemanForQueryId(queryId).getQueryStatus().getAsProfile(true);
      }
      return new Response(RpcType.RESP_QUERY_STATUS, profile);

    default:
      throw new RpcException("Not yet supported.");
    }

  }
View Full Code Here

        sendCount.decrement();
        if(value.getOk()) return;

        logger.error("Downstream fragment was not accepted.  Stopping future sends.");
        // if we didn't get ack ok, we'll need to kill the query.
        context.fail(new RpcException("A downstream fragment batch wasn't accepted.  This fragment thus fails."));
        stop();
      }
View Full Code Here

    if (result.getData() != null) {
      count.addAndGet(rows);
      try {
        loader.load(result.getHeader().getDef(), result.getData());
      } catch (SchemaChangeException e) {
        submissionFailed(new RpcException(e));
      }

      switch(format) {
        case TABLE:
          VectorUtil.showVectorAccessibleContent(loader, columnWidth);
View Full Code Here

            recordsInBatch = valuesChecked.get(s);
          } else {
            assertEquals("Mismatched record counts in vectors.", recordsInBatch, valuesChecked.get(s).intValue());
          }
          assertEquals("Record count incorrect for column: " + s, totalRecords, (long) valuesChecked.get(s));
        } catch (AssertionError e) { submissionFailed(new RpcException(e)); }
      }

      assert valuesChecked.keySet().size() > 0;
      batchLoader.clear();
      result.release();
View Full Code Here

      if (result.getHeader().getIsLastChunk()) {
        completed = true;
      }

      if (result.getHeader().getErrorCount() > 0) {
        submissionFailed(new RpcException(String.format("%s", result.getHeader().getErrorList())));
      }

      releaseIfFirst();

    }
View Full Code Here

      if (result.getHeader().getIsLastChunk()) {
        completed = true;
      }

      if (result.getHeader().getErrorCount() > 0) {
        submissionFailed(new RpcException(String.format("%s", result.getHeader().getErrorList())));
      }

      releaseIfFirst();

    }
View Full Code Here

    if (result.getData() != null) {
      count.addAndGet(rows);
      try {
        loader.load(result.getHeader().getDef(), result.getData());
      } catch (SchemaChangeException e) {
        submissionFailed(new RpcException(e));
      }

      switch(format) {
        case TABLE:
          VectorUtil.showVectorAccessibleContent(loader, columnWidth);
View Full Code Here

    if (ownsZkConnection) {
      try {
        this.clusterCoordinator = new ZKClusterCoordinator(this.config, connect);
        this.clusterCoordinator.start(10000);
      } catch (Exception e) {
        throw new RpcException("Failure setting up ZK for client.", e);
      }
    }

    if (props != null) {
      UserProperties.Builder upBuilder = UserProperties.newBuilder();
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.rpc.RpcException

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.