Examples of BlockingInterface


Examples of com.googlecode.protobuf.socketrpc.TestProtos.TestService.BlockingInterface

      ServiceException, IOException {
    BlockingRpcChannel blockingChannel = RpcChannels
        .newBlockingRpcChannel(clientConnectionFactory);
    RpcChannel channel = RpcChannels.newRpcChannel(clientConnectionFactory,
        threadPool);
    BlockingInterface blockingStub = TestService
        .newBlockingStub(blockingChannel);
    TestService stub = TestService.newStub(channel);

    try {
      rpcServer.startServer();
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.TestProtos.TestService.BlockingInterface

    return callback;
  }

  private Response callBlockingRpc(Request request, ErrorReason reason) {
    SocketRpcController controller = new SocketRpcController();
    BlockingInterface service = TestService.newBlockingStub(rpcChannel);
    try {
      Response response = service.testMethod(controller, request);
      assertNull(reason);
      return response;
    } catch (ServiceException e) {
      assertEquals(reason, controller.errorReason());
      return null;
View Full Code Here

Examples of com.googlecode.protobuf.socketrpc.TestProtos.TestService.BlockingInterface

  }

  private Response callSync(SocketRpcChannel rpcChannel,
      Request request, ErrorReason reason) {
    SocketRpcController controller = rpcChannel.newRpcController();
    BlockingInterface service = TestService.newBlockingStub(rpcChannel);
    try {
      Response response = service.testMethod(controller, request);
      assertNull(reason);
      return response;
    } catch (ServiceException e) {
      assertEquals(reason, controller.errorReason());
      return null;
View Full Code Here

Examples of echo.EchoProto.EchoService.BlockingInterface

        @Override
        public void run() {
            System.out.println(Thread.currentThread());
            RpcClient client = new RpcClient(channelFactory);
            RpcChannel channel = client.blockingConnect(serverAddr);
            BlockingInterface remoteService = EchoService.newBlockingStub(channel);
            String payload = new String(new byte[100]);
            payload = "Hello";
            EchoRequest request = EchoRequest.newBuilder().setPayload(payload).build();

            allConnected.countDown();
            try {
                startLatch.await();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            for (int i = 0; i < kRequests; ++i) {
                EchoResponse response;
                try {
                    response = remoteService.echo(null, request);
                    assert response.getPayload().equals(payload);
                } catch (ServiceException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface

      TableName aclTableName =
          TableName.valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "acl");
      ha = new HBaseAdmin(conf);
      ht = new HTable(conf, aclTableName.getName());
      CoprocessorRpcChannel service = ht.coprocessorService(HConstants.EMPTY_START_ROW);
      BlockingInterface protocol =
          AccessControlProtos.AccessControlService.newBlockingStub(service);
      HTableDescriptor[] htds = null;
     
      if (tableRegex != null) {
        htds = ha.listTables(Pattern.compile(tableRegex));
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface

      TableName aclTableName =
          TableName.valueOf(NamespaceDescriptor.SYSTEM_NAMESPACE_NAME_STR, "acl");
      ha = new HBaseAdmin(conf);
      ht = new HTable(conf, aclTableName.getName());
      CoprocessorRpcChannel service = ht.coprocessorService(HConstants.EMPTY_START_ROW);
      BlockingInterface protocol =
          AccessControlProtos.AccessControlService.newBlockingStub(service);
      HTableDescriptor[] htds = null;
     
      if (tableRegex != null) {
        htds = ha.listTables(Pattern.compile(tableRegex));
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface

  }

  private static BlockingInterface getAccessControlServiceStub(HTable ht)
      throws IOException {
    CoprocessorRpcChannel service = ht.coprocessorService(HConstants.EMPTY_START_ROW);
    BlockingInterface protocol =
        AccessControlProtos.AccessControlService.newBlockingStub(service);
    return protocol;
  }
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.AccessControlService.BlockingInterface

    Admin ha = null;
    try {
      ha = new HBaseAdmin(conf);
      ht = new HTable(conf, ACL_TABLE_NAME);
      CoprocessorRpcChannel service = ht.coprocessorService(HConstants.EMPTY_START_ROW);
      BlockingInterface protocol = AccessControlProtos.AccessControlService
          .newBlockingStub(service);
      HTableDescriptor[] htds = null;

      if (tableRegex == null || tableRegex.isEmpty()) {
        permList = ProtobufUtil.getUserPermissions(protocol);
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface

              new Pair<HRegionInfo, List<ServerName>>(region, favoredServerList));
          }
        }
        if (singleServerPlan != null) {
          // Update the current region server with its updated favored nodes
          BlockingInterface currentRegionServer = connection.getAdmin(entry.getKey());
          UpdateFavoredNodesRequest request =
              RequestConverter.buildUpdateFavoredNodesRequest(regionUpdateInfos);
         
          UpdateFavoredNodesResponse updateFavoredNodesResponse =
              currentRegionServer.updateFavoredNodes(null, request);
          LOG.info("Region server " +
              ProtobufUtil.getServerInfo(currentRegionServer).getServerName() +
              " has updated " + updateFavoredNodesResponse.getResponse() + " / " +
              singleServerPlan.getAssignmentMap().size() +
              " regions with the assignment plan");
View Full Code Here

Examples of org.apache.hadoop.hbase.protobuf.generated.AdminProtos.AdminService.BlockingInterface

          // Try and get regioninfo from the hosting server.
          HConnection hconn = getConnectionByTableName(tableName);
          if(reloadLocation) {
            loc = hconn.getRegionLocation(tableName, row, true);
          }
          BlockingInterface remoteSvr = hconn.getAdmin(loc.getServerName());
          HRegionInfo region = loc.getRegionInfo();
          try {
            GetRegionInfoRequest request =
                RequestConverter.buildGetRegionInfoRequest(region.getRegionName());
            GetRegionInfoResponse response = remoteSvr.getRegionInfo(null, request);
            if (HRegionInfo.convert(response.getRegionInfo()) != null) {
              isRecovering.set((response.hasIsRecovering()) ? response.getIsRecovering() : true);
              return loc;
            }
          } catch (ServiceException se) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.