Examples of DrillPBError


Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

  private void fail(String message, Throwable t) {
    if(isFinished()){
      logger.error("Received a failure message query finished of: {}", message, t);
    }
    DrillPBError error = ErrorHelper.logAndConvertError(context.getCurrentEndpoint(), message, t, logger);
    QueryResult result = QueryResult //
        .newBuilder() //
        .addError(error) //
        .setIsLastChunk(true) //
        .setQueryState(QueryState.FAILED) //
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

      if (!state.updateState(QueryState.PENDING, QueryState.FAILED))
      logger.warn("Tried to update query state to FAILED, but was not RUNNING");
    }

    boolean verbose = getContext().getOptions().getOption(ExecConstants.ENABLE_VERBOSE_ERRORS_KEY).bool_val;
    DrillPBError error = ErrorHelper.logAndConvertError(context.getCurrentEndpoint(), message, t, logger, verbose);
    QueryResult result = QueryResult //
        .newBuilder() //
        .addError(error) //
        .setIsLastChunk(true) //
        .setQueryState(QueryState.FAILED) //
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

      if (!state.updateState(QueryState.PENDING, QueryState.FAILED)) {
        logger.warn("Tried to update query state to FAILED, but was not RUNNING");
      }
    }

    DrillPBError error = ErrorHelper.logAndConvertError(context.getCurrentEndpoint(), message, t, logger);
    QueryResult result = QueryResult //
        .newBuilder() //
        .addError(error) //
        .setIsLastChunk(true) //
        .setQueryState(QueryState.FAILED) //
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

        // handle message and ack.
        ResponseSender sender = new ResponseSenderImpl(connection, msg.coordinationId);
        try {
          handle(connection, msg.rpcType, msg.pBody, msg.dBody, sender);
        } catch(UserRpcException e){
          DrillPBError error = ErrorHelper.logAndConvertError(e.getEndpoint(), e.getUserMessage(), e, logger);
          OutboundRpcMessage outMessage = new OutboundRpcMessage(RpcMode.RESPONSE_FAILURE, 0, msg.coordinationId, error);
          if (RpcConstants.EXTRA_DEBUGGING) {
            logger.debug("Adding message to outbound buffer. {}", outMessage);
          }
          connection.getChannel().writeAndFlush(outMessage);
        }
        msg.release()// we release our ownership.  Handle could have taken over ownership.
        break;
      }

      case RESPONSE:
        try{
        MessageLite m = getResponseDefaultInstance(msg.rpcType);
        assert rpcConfig.checkReceive(msg.rpcType, m.getClass());
        RpcOutcome<?> rpcFuture = queue.getFuture(msg.rpcType, msg.coordinationId, m.getClass());
        Parser<?> parser = m.getParserForType();
        Object value = parser.parseFrom(new ByteBufInputStream(msg.pBody, msg.pBody.readableBytes()));
        rpcFuture.set(value, msg.dBody);
        msg.release()// we release our ownership.  Handle could have taken over ownership.
        if (RpcConstants.EXTRA_DEBUGGING) {
          logger.debug("Updated rpc future {} with value {}", rpcFuture, value);
        }
        }catch(Exception ex) {
          logger.error("Failure while handling response.", ex);
          throw ex;
        }
        break;

      case RESPONSE_FAILURE:
        DrillPBError failure = DrillPBError.parseFrom(new ByteBufInputStream(msg.pBody, msg.pBody.readableBytes()));
        queue.updateFailedFuture(msg.coordinationId, failure);
        msg.release();
        if (RpcConstants.EXTRA_DEBUGGING) {
          logger.debug("Updated rpc future with coordinationId {} with failure ", msg.coordinationId, failure);
        }
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

    return msg.toString();
  }

  public static void main(String[] args ){
    DrillPBError e = logAndConvertError(DrillbitEndpoint.newBuilder().setAddress("host1").setControlPort(1234).build(), "RpcFailure", new Exception("Excep 1", new Exception("excep2")), logger);
    System.out.println(getErrorMessage(e, false));
    System.out.println("\n\n\n");
    System.out.println(getErrorMessage(e, true));

  }
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

   * @param verbose
   * @return
   */
  public static DrillPBError logAndConvertMessageError(DrillbitEndpoint endpoint, String message, Throwable t, Logger logger, boolean verbose) {

    DrillPBError baseError = t instanceof RemoteRpcException ? ((RemoteRpcException) t).getRemoteError() : logAndConvertError(endpoint, message, t, logger);
    String userMessage = getErrorMessage(baseError, verbose);
    return DrillPBError.newBuilder() //
      .setEndpoint(baseError.getEndpoint()) //
      .setErrorId(baseError.getErrorId()) //
      .setMessage(userMessage) //
      .build();
  }
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.DrillPBError

      if (!state.updateState(QueryState.PENDING, QueryState.FAILED))
      logger.warn("Tried to update query state to FAILED, but was not RUNNING");
    }

    boolean verbose = getContext().getOptions().getOption(ExecConstants.ENABLE_VERBOSE_ERRORS_KEY).bool_val;
    DrillPBError error = ErrorHelper.logAndConvertError(context.getCurrentEndpoint(), message, t, logger, verbose);
    QueryResult result = QueryResult //
        .newBuilder() //
        .addError(error) //
        .setIsLastChunk(true) //
        .setQueryState(QueryState.FAILED) //
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.