Package org.apache.drill.exec.rpc

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


  }
 
  public void addFragmentStatusListener(FragmentHandle handle, FragmentStatusListener listener) throws RpcException{
    logger.debug("Adding framgent status listener for handle {}.", handle);
    FragmentStatusListener old = listeners.putIfAbsent(handle.getQueryId(), listener);
    if(old != null) throw new RpcException("Failure.  The provided handle already exists in the listener pool.  You need to remove one listener before adding another.");
  }
View Full Code Here


      int rows = result.getHeader().getRowCount();
      if (result.getData() != null) {
        try {
          loader.load(result.getHeader().getDef(), result.getData());
        } catch (SchemaChangeException e) {
          submissionFailed(new RpcException(e));
        }
        List<String> columns = Lists.newArrayList();
        for (VectorWrapper vw : loader) {
          columns.add(vw.getValueVector().getField().getName());
        }
View Full Code Here

          }
          if (checkValues) {
            try {
              assertField(vv, j, (TypeProtos.MinorType) currentField.type,
                currentField.values[(int) (columnValCounter % 3)], (String) currentField.name + "/");
            } catch (AssertionError e) { submissionFailed(new RpcException(e)); }
          }
          columnValCounter++;
        }
        if (VERBOSE_DEBUG){
          System.out.println("\n" + ((BaseDataValueVector)vv).getAccessor().getValueCount());
        }
        valuesChecked.remove(vv.getField().getName());
        valuesChecked.put(vv.getField().getName(), columnValCounter);
      }
     
     
      if (VERBOSE_DEBUG){
        for (i = 0; i < batchLoader.getRecordCount(); i++) {
          if (i % 50 == 0){
            System.out.println();
            for (VectorWrapper<?> vw : batchLoader) {
              ValueVector v = vw.getValueVector();
              System.out.print(pad(v.getField().getName(), 20) + " ");
            }
            System.out.println();
            System.out.println();
          }

          for (VectorWrapper<?> vw : batchLoader) {
            ValueVector v = vw.getValueVector();
            System.out.print(pad(v.getAccessor().getObject(i).toString(), 20) + " ");
          }
          System.out.println(

          );
        }
      }

      for(VectorWrapper<?> vw : batchLoader){
        vw.clear();
      }
      result.release();
     
      batchCounter++;
      if(result.getHeader().getIsLastChunk()){
        for (String s : valuesChecked.keySet()) {
          try {
          assertEquals("Record count incorrect for column: " + s, totalRecords, (long) valuesChecked.get(s));
          } catch (AssertionError e) { submissionFailed(new RpcException(e)); }
        }
       
        assert valuesChecked.keySet().size() > 0;
        future.set(null);
      }
View Full Code Here

    queue.add(result);
    if(result.getHeader().getIsLastChunk()){
      completed = true;
    }
    if (result.getHeader().getErrorCount() > 0) {
      submissionFailed(new RpcException(String.format("%s", result.getHeader().getErrorList())));
    }
  }
View Full Code Here

      public void success(Ack value, ByteBuf buf) {
        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 (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

    FutureHandler f = new FutureHandler();
    try {
      client.connect(f, endpoint, props);
      f.checkedGet();
    } catch (InterruptedException e) {
      throw new RpcException(e);
    }
  }
View Full Code Here

      getInner().set(null);
    }

    @Override
    public void connectionFailed(FailureType type, Throwable t) {
      getInner().setException(new RpcException(String.format("Failure connecting to server. Failure of type %s.", type.name()), t));
    }
View Full Code Here

    return handler.handle(connection, rpcType, pBody, dBody);
  }

  @Override
  protected void validateHandshake(BitControlHandshake handshake) throws RpcException {
    if(handshake.getRpcVersion() != ControlRpcConfig.RPC_VERSION) throw new RpcException(String.format("Invalid rpc version.  Expected %d, actual %d.", handshake.getRpcVersion(), ControlRpcConfig.RPC_VERSION));
  }
View Full Code Here

    return new ServerHandshakeHandler<BitControlHandshake>(RpcType.HANDSHAKE, BitControlHandshake.PARSER){
     
      @Override
      public MessageLite getHandshakeResponse(BitControlHandshake inbound) throws Exception {
//        logger.debug("Handling handshake from other bit. {}", inbound);
        if(inbound.getRpcVersion() != ControlRpcConfig.RPC_VERSION) throw new RpcException(String.format("Invalid rpc version.  Expected %d, actual %d.", inbound.getRpcVersion(), ControlRpcConfig.RPC_VERSION));
        if(!inbound.hasEndpoint() || inbound.getEndpoint().getAddress().isEmpty() || inbound.getEndpoint().getControlPort() < 1) throw new RpcException(String.format("RPC didn't provide valid counter endpoint information.  Received %s.", inbound.getEndpoint()));
        connection.setEndpoint(inbound.getEndpoint());

        // add the
        ControlConnectionManager manager = connectionRegistry.getConnectionManager(inbound.getEndpoint());
       
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.