Package com.google.protobuf

Examples of com.google.protobuf.BlockingRpcChannel


      @Override
      public Object run() throws Exception {
        HTable aclmeta = new HTable(TEST_UTIL.getConfiguration(),
            AccessControlLists.ACL_TABLE_NAME);
        byte[] table = Bytes.toBytes(name.getMethodName());
        BlockingRpcChannel service = aclmeta.coprocessorService(table);
        AccessControlService.BlockingInterface protocol =
          AccessControlService.newBlockingStub(service);
        ProtobufUtil.grant(protocol, READER.getShortName(),
          TABLE, null, null, Permission.Action.READ);
        ProtobufUtil.grant(protocol, LIMITED.getShortName(),
View Full Code Here


        RpcClient rpcClient = new RpcClient(c, clusterId.toString());
        ServerName sn =
            ServerName.valueOf(server.getAddress().getHostName(), server.getAddress().getPort(),
                System.currentTimeMillis());
        try {
          BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(sn,
            User.getCurrent(), HConstants.DEFAULT_HBASE_RPC_TIMEOUT);
          AuthenticationProtos.AuthenticationService.BlockingInterface stub =
            AuthenticationProtos.AuthenticationService.newBlockingStub(channel);
          AuthenticationProtos.WhoAmIResponse response =
            stub.whoAmI(null, AuthenticationProtos.WhoAmIRequest.getDefaultInstance());
View Full Code Here

          connectionLock.putIfAbsent(key, key);
          Object stub = null;
          synchronized (connectionLock.get(key)) {
            stub = stubs.get(key);
            if (stub == null) {
              BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(sn,
                user, rpcTimeout);
              stub = makeStub(channel);
              isMasterRunning();
              stubs.put(key, stub);
            }
View Full Code Here

  @Test
  public void testProtoBufRpc() throws Exception {
    RpcClient rpcClient = new RpcClient(conf, HConstants.CLUSTER_ID_DEFAULT);
    try {
      BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
          ServerName.valueOf(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis()),
        User.getCurrent(), 0);
      TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub =
        TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel);
      // Test ping method
View Full Code Here

        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
    RpcClient rpcClient = new RpcClient(conf, HConstants.DEFAULT_CLUSTER_ID.toString());
    try {
      BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
          ServerName.valueOf(rpcServer.getListenerAddress().getHostName(),
              rpcServer.getListenerAddress().getPort(), System.currentTimeMillis()),
          User.getCurrent(), RPC_CLIENT_TIMEOUT);
      TestDelayedRpcProtos.TestDelayedService.BlockingInterface stub =
        TestDelayedRpcProtos.TestDelayedService.newBlockingStub(channel);
View Full Code Here

      Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
    RpcClient rpcClient = new RpcClient(conf, HConstants.DEFAULT_CLUSTER_ID.toString());
    try {
      BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
          ServerName.valueOf(rpcServer.getListenerAddress().getHostName(),
              rpcServer.getListenerAddress().getPort(), System.currentTimeMillis()),
          User.getCurrent(), RPC_CLIENT_TIMEOUT);
      TestDelayedRpcProtos.TestDelayedService.BlockingInterface stub =
        TestDelayedRpcProtos.TestDelayedService.newBlockingStub(channel);
View Full Code Here

        Lists.newArrayList(new RpcServer.BlockingServiceAndInterface(service, null)),
        isa, 1, 0, conf, 0);
    rpcServer.start();
    RpcClient rpcClient = new RpcClient(conf, HConstants.DEFAULT_CLUSTER_ID.toString());
    try {
      BlockingRpcChannel channel = rpcClient.createBlockingRpcChannel(
          ServerName.valueOf(rpcServer.getListenerAddress().getHostName(),
              rpcServer.getListenerAddress().getPort(), System.currentTimeMillis()),
        User.getCurrent(), 1000);
      TestDelayedRpcProtos.TestDelayedService.BlockingInterface stub =
        TestDelayedRpcProtos.TestDelayedService.newBlockingStub(channel);
View Full Code Here

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

    final long timestamp = EnvironmentEdgeManager.currentTimeMillis();
    BlockingRpcChannel channel = new BlockingRpcChannel() {

      @Override
      public Message callBlockingMethod(MethodDescriptor method, RpcController controller,
          Message request, Message responsePrototype) throws ServiceException {
        try {
View Full Code Here

        continue;
      }

      new InetSocketAddress(sn.getHostname(), sn.getPort());
      try {
        BlockingRpcChannel channel =
            this.rpcClient.createBlockingRpcChannel(sn, userProvider.getCurrent(), this.rpcTimeout);
        intf = RegionServerStatusService.newBlockingStub(channel);
        break;
      } catch (IOException e) {
        e = e instanceof RemoteException ?
View Full Code Here

      this.connectionLock.putIfAbsent(key, key);
      AdminService.BlockingInterface stub = null;
      synchronized (this.connectionLock.get(key)) {
        stub = (AdminService.BlockingInterface)this.stubs.get(key);
        if (stub == null) {
          BlockingRpcChannel channel = this.rpcClient.createBlockingRpcChannel(serverName,
            user, this.rpcTimeout);
          stub = AdminService.newBlockingStub(channel);
          this.stubs.put(key, stub);
        }
      }
View Full Code Here

TOP

Related Classes of com.google.protobuf.BlockingRpcChannel

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.