Package com.google.protobuf

Examples of com.google.protobuf.BlockingService


  @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,
        conf,
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, conf, new FifoRpcScheduler(conf, 1));
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), conf,
View Full Code Here

    if (!this.serverName.equals(serverName)) {
      return super.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");
    final long timestamp = EnvironmentEdgeManager.currentTimeMillis();
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,
        conf,
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,
        conf,
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,
        conf,
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, conf, new FifoRpcScheduler(conf, 1));
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), conf,
View Full Code Here

    // Set RPC engine to protobuf RPC engine
    RPC.setProtocolEngine(conf, TestRpcService.class, ProtobufRpcEngine.class);

    // Create server side implementation
    PBServerImpl serverImpl = new PBServerImpl();
    BlockingService service = TestProtobufRpcProto
        .newReflectiveBlockingService(serverImpl);

    // Get RPC server for server side implementation
    server = new RPC.Builder(conf).setProtocol(TestRpcService.class)
        .setInstance(service).setBindAddress(ADDRESS).setPort(PORT).build();
    addr = NetUtils.getConnectAddress(server);
   
    // now the second protocol
    PBServer2Impl server2Impl = new PBServer2Impl();
    BlockingService service2 = TestProtobufRpc2Proto
        .newReflectiveBlockingService(server2Impl);
   
    server.addProtocol(RPC.RpcKind.RPC_PROTOCOL_BUFFER, TestRpcService2.class,
        service2);
    server.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.