Package org.apache.tajo.rpc.RpcProtos

Examples of org.apache.tajo.rpc.RpcProtos.RpcResponse


    }

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {
      RpcResponse response = (RpcResponse) e.getMessage();
      ResponseCallback callback = requests.remove(response.getId());

      if (callback == null) {
        LOG.warn("Dangling rpc call");
      } else {
        callback.run(response);
View Full Code Here


    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {

      RpcResponse rpcResponse = (RpcResponse) e.getMessage();
      ProtoCallFuture callback = requests.remove(rpcResponse.getId());

      if (callback == null) {
        LOG.warn("Dangling rpc call");
      } else {
        if (rpcResponse.hasErrorMessage()) {
          callback.setFailed(rpcResponse.getErrorMessage(),
              new ServiceException(getErrorMessage(rpcResponse.getErrorMessage())));
          throw new RemoteException(
              getErrorMessage(rpcResponse.getErrorMessage()));
        } else {
          Message responseMessage;

          if (!rpcResponse.hasResponseMessage()) {
            responseMessage = null;
          } else {
            responseMessage =
                callback.returnType.newBuilderForType().
                    mergeFrom(rpcResponse.getResponseMessage()).build();
          }

          callback.setResponse(responseMessage);
        }
      }
View Full Code Here

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {

      RpcResponse response = (RpcResponse) e.getMessage();
      ResponseCallback callback = requests.remove(response.getId());

      if (callback == null) {
        LOG.warn("Dangling rpc call");
      } else {
        callback.run(response);
View Full Code Here

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
        throws Exception {

      RpcResponse rpcResponse = (RpcResponse) e.getMessage();
      ProtoCallFuture callback = requests.remove(rpcResponse.getId());

      if (callback == null) {
        LOG.warn("Dangling rpc call");
      } else {
        if (rpcResponse.hasErrorMessage()) {
          if (callback.controller != null) {
            callback.setFailed(rpcResponse.getErrorMessage());
          }
          throw new RemoteException(
              getErrorMessage(rpcResponse.getErrorMessage()));
        } else {
          Message responseMessage;

          if (!rpcResponse.hasResponseMessage()) {
            responseMessage = null;
          } else {
            responseMessage =
                callback.returnType.newBuilderForType().
                    mergeFrom(rpcResponse.getResponseMessage()).build();
          }

          callback.setResponse(responseMessage);
        }
      }
View Full Code Here

TOP

Related Classes of org.apache.tajo.rpc.RpcProtos.RpcResponse

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.