Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.Table.coprocessorService()


    SecureTestUtil.updateACLs(util, new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Table acl = new HTable(util.getConfiguration(), AccessControlLists.ACL_TABLE_NAME);
        try {
          BlockingRpcChannel service = acl.coprocessorService(HConstants.EMPTY_START_ROW);
          AccessControlService.BlockingInterface protocol =
              AccessControlService.newBlockingStub(service);
          ProtobufUtil.revoke(protocol, user, namespace, actions);
        } finally {
          acl.close();
View Full Code Here


    SecureTestUtil.updateACLs(util, new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Table acl = new HTable(util.getConfiguration(), AccessControlLists.ACL_TABLE_NAME);
        try {
          BlockingRpcChannel service = acl.coprocessorService(HConstants.EMPTY_START_ROW);
          AccessControlService.BlockingInterface protocol =
              AccessControlService.newBlockingStub(service);
          ProtobufUtil.grant(protocol, user, table, family, qualifier, actions);
        } finally {
          acl.close();
View Full Code Here

    SecureTestUtil.updateACLs(util, new Callable<Void>() {
      @Override
      public Void call() throws Exception {
        Table acl = new HTable(util.getConfiguration(), AccessControlLists.ACL_TABLE_NAME);
        try {
          BlockingRpcChannel service = acl.coprocessorService(HConstants.EMPTY_START_ROW);
          AccessControlService.BlockingInterface protocol =
              AccessControlService.newBlockingStub(service);
          ProtobufUtil.revoke(protocol, user, table, family, qualifier, actions);
        } finally {
          acl.close();
View Full Code Here

    LOG.info("Did george");
    hello(table, null, "Who are you?");
    LOG.info("Who are you");
    hello(table, NOBODY, null);
    LOG.info(NOBODY);
    Map<byte [], Integer> intResults = table.coprocessorService(PingProtos.PingService.class,
      null, null,
      new Batch.Call<PingProtos.PingService, Integer>() {
        @Override
        public Integer call(PingProtos.PingService instance) throws IOException {
          BlockingRpcCallback<PingProtos.CountResponse> rpcCallback =
View Full Code Here

    for (Map.Entry<byte [], Integer> e: intResults.entrySet()) {
      assertTrue(e.getValue() > 0);
      count = e.getValue();
    }
    final int diff = 5;
    intResults = table.coprocessorService(PingProtos.PingService.class,
      null, null,
      new Batch.Call<PingProtos.PingService, Integer>() {
        @Override
        public Integer call(PingProtos.PingService instance) throws IOException {
          BlockingRpcCallback<PingProtos.IncrementCountResponse> rpcCallback =
View Full Code Here

    // Make it not retry forever
    configuration.setInt(HConstants.HBASE_CLIENT_RETRIES_NUMBER, 1);
    Table table = new HTable(configuration, TEST_TABLE);

    try {
      CoprocessorRpcChannel protocol = table.coprocessorService(ROWS[0]);

      TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface service =
          TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(protocol);

      service.error(null, TestProtos.EmptyRequestProto.getDefaultInstance());
View Full Code Here

    AccessTestAction grantAction = new AccessTestAction() {
      public Object run() throws Exception {
        Table acl = new HTable(conf, AccessControlLists.ACL_TABLE_NAME);
        try {
          BlockingRpcChannel service =
              acl.coprocessorService(HConstants.EMPTY_START_ROW);
          AccessControlService.BlockingInterface protocol =
            AccessControlService.newBlockingStub(service);
          ProtobufUtil.grant(protocol, testUser, TestNamespace, Action.WRITE);
        } finally {
          acl.close();
View Full Code Here

    AccessTestAction revokeAction = new AccessTestAction() {
      public Object run() throws Exception {
        Table acl = new HTable(conf, AccessControlLists.ACL_TABLE_NAME);
        try {
          BlockingRpcChannel service =
              acl.coprocessorService(HConstants.EMPTY_START_ROW);
          AccessControlService.BlockingInterface protocol =
            AccessControlService.newBlockingStub(service);
          ProtobufUtil.revoke(protocol, testUser, TestNamespace, Action.WRITE);
        } finally {
          acl.close();
View Full Code Here

  public static Token<AuthenticationTokenIdentifier> obtainToken(
      Configuration conf) throws IOException {
    Table meta = null;
    try {
      meta = new HTable(conf, TableName.META_TABLE_NAME);
      CoprocessorRpcChannel rpcChannel = meta.coprocessorService(HConstants.EMPTY_START_ROW);
      AuthenticationProtos.AuthenticationService.BlockingInterface service =
          AuthenticationProtos.AuthenticationService.newBlockingStub(rpcChannel);
      AuthenticationProtos.GetAuthenticationTokenResponse response = service.getAuthenticationToken(null,
          AuthenticationProtos.GetAuthenticationTokenRequest.getDefaultInstance());
View Full Code Here

      request.addPermission(ProtobufUtil.toPermission(p));
    }
    Table acl = new HTable(conf, table);
    try {
      AccessControlService.BlockingInterface protocol =
        AccessControlService.newBlockingStub(acl.coprocessorService(new byte[0]));
      try {
        protocol.checkPermissions(null, request.build());
      } catch (ServiceException se) {
        ProtobufUtil.toIOException(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.