public static CoprocessorServiceRequest getCoprocessorServiceRequest( final Descriptors.MethodDescriptor method, final Message request) { return getCoprocessorServiceRequest(method, request, HConstants.EMPTY_BYTE_ARRAY, HConstants.EMPTY_BYTE_ARRAY); }
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, ClientService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); stub.execRegionServerService( controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, MasterService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); stub.execMasterService( controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
@Override protected CoprocessorServiceResponse rpcCall() throws Exception { byte [] regionName = getLocation().getRegionInfo().getRegionName(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request, row, regionName); return getStub().execService(getRpcController(), csr); } };
@Override protected Message callExecService(RpcController controller, Descriptors.MethodDescriptor method, Message request, Message responsePrototype) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Call: " + method.getName() + ", " + request.toString()); } CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); // TODO: Are we retrying here? Does not seem so. We should use RetryingRpcCaller // TODO: Make this same as RegionCoprocessorRpcChannel and MasterCoprocessorRpcChannel. They // are all different though should do same thing; e.g. RpcChannel setup. ClientProtos.ClientService.BlockingInterface stub = connection.getClient(serverName); CoprocessorServiceResponse result; try { result = stub. execRegionServerService(connection.getRpcControllerFactory().newController(), csr); return CoprocessorRpcUtils.getResponse(result, responsePrototype); } catch (ServiceException e) { throw ProtobufUtil.handleRemoteException(e); } } };
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, HRegionLocation loc, ClientService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); if (region != null && !Bytes.equals(loc.getRegionInfo().getRegionName(), region.getRegionName())) { future.completeExceptionally(new DoNotRetryIOException( "Region name is changed, expected " + region.getRegionNameAsString() + ", actual " + loc.getRegionInfo().getRegionNameAsString())); return future; } CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request, row, loc.getRegionInfo().getRegionName()); stub.execService(controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
public static CoprocessorServiceRequest getCoprocessorServiceRequest( final Descriptors.MethodDescriptor method, final Message request) { return getCoprocessorServiceRequest(method, request, HConstants.EMPTY_BYTE_ARRAY, HConstants.EMPTY_BYTE_ARRAY); }
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, MasterService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); stub.execMasterService( controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, ClientService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); stub.execRegionServerService( controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
@Override protected CoprocessorServiceResponse rpcCall() throws Exception { byte [] regionName = getLocation().getRegionInfo().getRegionName(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request, row, regionName); return getStub().execService(getRpcController(), csr); } };
@Override protected Message callExecService(RpcController controller, Descriptors.MethodDescriptor method, Message request, Message responsePrototype) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Call: " + method.getName() + ", " + request.toString()); } CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); // TODO: Are we retrying here? Does not seem so. We should use RetryingRpcCaller // TODO: Make this same as RegionCoprocessorRpcChannel and MasterCoprocessorRpcChannel. They // are all different though should do same thing; e.g. RpcChannel setup. ClientProtos.ClientService.BlockingInterface stub = connection.getClient(serverName); CoprocessorServiceResponse result; try { result = stub. execRegionServerService(connection.getRpcControllerFactory().newController(), csr); return CoprocessorRpcUtils.getResponse(result, responsePrototype); } catch (ServiceException e) { throw ProtobufUtil.handleRemoteException(e); } } };
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, HRegionLocation loc, ClientService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); if (region != null && !Bytes.equals(loc.getRegionInfo().getRegionName(), region.getRegionName())) { future.completeExceptionally(new DoNotRetryIOException( "Region name is changed, expected " + region.getRegionNameAsString() + ", actual " + loc.getRegionInfo().getRegionNameAsString())); return future; } CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request, row, loc.getRegionInfo().getRegionName()); stub.execService(controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
public static CoprocessorServiceRequest getCoprocessorServiceRequest( final Descriptors.MethodDescriptor method, final Message request) { return getCoprocessorServiceRequest(method, request, HConstants.EMPTY_BYTE_ARRAY, HConstants.EMPTY_BYTE_ARRAY); }
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, ClientService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); stub.execRegionServerService( controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, MasterService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); stub.execMasterService( controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }
@Override protected CoprocessorServiceResponse rpcCall() throws Exception { byte [] regionName = getLocation().getRegionInfo().getRegionName(); CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request, row, regionName); return getStub().execService(getRpcController(), csr); } };
@Override protected Message callExecService(RpcController controller, Descriptors.MethodDescriptor method, Message request, Message responsePrototype) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Call: " + method.getName() + ", " + request.toString()); } CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request); // TODO: Are we retrying here? Does not seem so. We should use RetryingRpcCaller // TODO: Make this same as RegionCoprocessorRpcChannel and MasterCoprocessorRpcChannel. They // are all different though should do same thing; e.g. RpcChannel setup. ClientProtos.ClientService.BlockingInterface stub = connection.getClient(serverName); CoprocessorServiceResponse result; try { result = stub. execRegionServerService(connection.getRpcControllerFactory().newController(), csr); return CoprocessorRpcUtils.getResponse(result, responsePrototype); } catch (ServiceException e) { throw ProtobufUtil.handleRemoteException(e); } } };
private CompletableFuture<Message> rpcCall(MethodDescriptor method, Message request, Message responsePrototype, HBaseRpcController controller, HRegionLocation loc, ClientService.Interface stub) { CompletableFuture<Message> future = new CompletableFuture<>(); if (region != null && !Bytes.equals(loc.getRegionInfo().getRegionName(), region.getRegionName())) { future.completeExceptionally(new DoNotRetryIOException( "Region name is changed, expected " + region.getRegionNameAsString() + ", actual " + loc.getRegionInfo().getRegionNameAsString())); return future; } CoprocessorServiceRequest csr = CoprocessorRpcUtils.getCoprocessorServiceRequest(method, request, row, loc.getRegionInfo().getRegionName()); stub.execService(controller, csr, new org.apache.hbase.thirdparty.com.google.protobuf.RpcCallback<CoprocessorServiceResponse>() { @Override public void run(CoprocessorServiceResponse resp) { if (controller.failed()) { future.completeExceptionally(controller.getFailed()); } else { try { future.complete(CoprocessorRpcUtils.getResponse(resp, responsePrototype)); } catch (IOException e) { future.completeExceptionally(e); } } } }); return future; }