Package com.google.protobuf

Examples of com.google.protobuf.BlockingService


  public void doRpc(SocketRpcProtos.Request rpcRequest,
      final RpcCallback<SocketRpcProtos.Response> rpcCallback)
      throws RpcException {

    // Get the service, first try BlockingService
    BlockingService blockingService = blockingServiceMap.get(
        rpcRequest.getServiceName());
    if (blockingService != null) {
      Response response = forwardToBlockingService(rpcRequest, blockingService);
      rpcCallback.run(response);
      return;
View Full Code Here


      if (initialIsa.getAddress() == null) {
        throw new IllegalArgumentException("Failed resolve of " + initialIsa);
      }
      final List<BlockingServiceAndInterface> sai =
        new ArrayList<BlockingServiceAndInterface>(1);
      BlockingService service =
        AuthenticationProtos.AuthenticationService.newReflectiveBlockingService(this);
      sai.add(new BlockingServiceAndInterface(service,
        AuthenticationProtos.AuthenticationService.BlockingInterface.class));
      this.rpcServer =
        new RpcServer(this, "tokenServer", sai, initialIsa, 3, 1, conf, HConstants.QOS_THRESHOLD);
View Full Code Here

    log.setLevel(Level.DEBUG);
    log = Logger.getLogger("org.apache.hadoop.ipc.HBaseServer.trace");
    log.setLevel(Level.TRACE);
    // Create server side implementation
    PBServerImpl serverImpl = new PBServerImpl();
    BlockingService service =
      TestRpcServiceProtos.TestProtobufRpcProto.newReflectiveBlockingService(serverImpl);
    // Get RPC server for server side implementation
    this.server = new RpcServer(null, "testrpc",
        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        new InetSocketAddress(ADDRESS, PORT), 10, 10, conf, 0);
View Full Code Here

  private void testDelayedRpc(boolean delayReturnValue) throws Exception {
    LOG.info("Running testDelayedRpc delayReturnValue=" + delayReturnValue);
    Configuration conf = HBaseConfiguration.create();
    InetSocketAddress isa = new InetSocketAddress("localhost", 0);
    TestDelayedImplementation instance = new TestDelayedImplementation(delayReturnValue);
    BlockingService service =
      TestDelayedRpcProtos.TestDelayedService.newReflectiveBlockingService(instance);
    rpcServer = new RpcServer(null, "testDelayedRpc",
        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
View Full Code Here

    log.setLevel(Level.WARN);


    InetSocketAddress isa = new InetSocketAddress("localhost", 0);
    TestDelayedImplementation instance = new TestDelayedImplementation(true);
    BlockingService service =
      TestDelayedRpcProtos.TestDelayedService.newReflectiveBlockingService(instance);
    rpcServer = new RpcServer(null, "testTooManyDelayedRpcs",
      Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
View Full Code Here

  @Test
  public void testEndDelayThrowing() throws IOException {
    Configuration conf = HBaseConfiguration.create();
    InetSocketAddress isa = new InetSocketAddress("localhost", 0);
    FaultyTestDelayedImplementation instance = new FaultyTestDelayedImplementation();
    BlockingService service =
      TestDelayedRpcProtos.TestDelayedService.newReflectiveBlockingService(instance);
    rpcServer = new RpcServer(null, "testEndDelayThrowing",
        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
View Full Code Here

    if (!this.serverName.equals(serverName)) {
      return delegate.getClient(serverName);
    }
    // the client is attempting to write to the same regionserver, we can short-circuit to our
    // local regionserver
    final BlockingService blocking = ClientService.newReflectiveBlockingService(this.server);
    final RpcServerInterface rpc = this.server.getRpcServer();

    final MonitoredRPCHandler status =
        TaskMonitor.get().createRPCStatus(Thread.currentThread().getName());
    status.pause("Setting up server-local call");
View Full Code Here

  private void testDelayedRpc(boolean delayReturnValue) throws Exception {
    LOG.info("Running testDelayedRpc delayReturnValue=" + delayReturnValue);
    Configuration conf = HBaseConfiguration.create();
    InetSocketAddress isa = new InetSocketAddress("localhost", 0);
    TestDelayedImplementation instance = new TestDelayedImplementation(delayReturnValue);
    BlockingService service =
      TestDelayedRpcProtos.TestDelayedService.newReflectiveBlockingService(instance);
    rpcServer = new RpcServer(null, "testDelayedRpc",
        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
View Full Code Here

    log.setLevel(Level.WARN);


    InetSocketAddress isa = new InetSocketAddress("localhost", 0);
    TestDelayedImplementation instance = new TestDelayedImplementation(true);
    BlockingService service =
      TestDelayedRpcProtos.TestDelayedService.newReflectiveBlockingService(instance);
    rpcServer = new RpcServer(null, "testTooManyDelayedRpcs",
      Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
View Full Code Here

  @Test
  public void testEndDelayThrowing() throws IOException {
    Configuration conf = HBaseConfiguration.create();
    InetSocketAddress isa = new InetSocketAddress("localhost", 0);
    FaultyTestDelayedImplementation instance = new FaultyTestDelayedImplementation();
    BlockingService service =
      TestDelayedRpcProtos.TestDelayedService.newReflectiveBlockingService(instance);
    rpcServer = new RpcServer(null, "testEndDelayThrowing",
        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
View Full Code Here

TOP

Related Classes of com.google.protobuf.BlockingService

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.