public void callMethod(final MethodDescriptor method, final RpcController controller, final Message param, final Message responseType, final RpcCallback<Message> done) { int nextSeqId = sequence.getAndIncrement(); RpcProtos.RpcRequest rpcRequest = buildRequest(nextSeqId, method, param); invoke(rpcRequest, new ResponseCallback(controller, responseType, done), 0); } }
public void callMethod(final MethodDescriptor method, final RpcController controller, final Message param, final Message responseType, final RpcCallback<Message> done) { int nextSeqId = sequence.getAndIncrement(); RpcProtos.RpcRequest rpcRequest = buildRequest(nextSeqId, method, param); invoke(rpcRequest, new ResponseCallback(controller, responseType, done), 0); } }
@Override public Message callBlockingMethod(final MethodDescriptor method, final RpcController controller, final Message param, final Message responsePrototype) throws TajoServiceException { int nextSeqId = sequence.getAndIncrement(); RpcProtos.RpcRequest rpcRequest = buildRequest(nextSeqId, method, param); ProtoCallFuture callFuture = new ProtoCallFuture(controller, responsePrototype); invoke(rpcRequest, callFuture, 0); try { return callFuture.get(); } catch (Throwable t) { if (t instanceof ExecutionException) { Throwable cause = t.getCause(); if (cause != null && cause instanceof TajoServiceException) { throw (TajoServiceException) cause; } } throw new TajoServiceException(t.getMessage()); } } }
@Override public Message callBlockingMethod(final MethodDescriptor method, final RpcController controller, final Message param, final Message responsePrototype) throws TajoServiceException { int nextSeqId = sequence.getAndIncrement(); RpcProtos.RpcRequest rpcRequest = buildRequest(nextSeqId, method, param); ProtoCallFuture callFuture = new ProtoCallFuture(controller, responsePrototype); invoke(rpcRequest, callFuture, 0); try { return callFuture.get(); } catch (Throwable t) { if (t instanceof ExecutionException) { Throwable cause = t.getCause(); if (cause != null && cause instanceof TajoServiceException) { throw (TajoServiceException) cause; } } throw new TajoServiceException(t.getMessage()); } } }