• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CheckPermissionsRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest的典型用法代码示例。如果您正苦于以下问题:Java CheckPermissionsRequest类的具体用法?Java CheckPermissionsRequest怎么用?Java CheckPermissionsRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CheckPermissionsRequest类属于org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos包,在下文中一共展示了CheckPermissionsRequest类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public static void checkTablePerms(Configuration conf, TableName table, Permission... perms)
throws IOException {
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    request.addPermission(ProtobufUtil.toPermission(p));
  }
  try (Connection connection = ConnectionFactory.createConnection(conf)) {
    try (Table acl = connection.getTable(table)) {
      AccessControlService.BlockingInterface protocol =
          AccessControlService.newBlockingStub(acl.coprocessorService(new byte[0]));
      try {
        protocol.checkPermissions(null, request.build());
      } catch (ServiceException se) {
        ProtobufUtil.toIOException(se);
      }
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:SecureTestUtil.java


示例2: checkGlobalPerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public static void checkGlobalPerms(HBaseTestingUtility testUtil, Permission.Action... actions)
    throws IOException {
  Permission[] perms = new Permission[actions.length];
  for (int i = 0; i < actions.length; i++) {
    perms[i] = new Permission(actions[i]);
  }
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Action a : actions) {
    request.addPermission(AccessControlProtos.Permission.newBuilder()
        .setType(AccessControlProtos.Permission.Type.Global)
        .setGlobalPermission(
            AccessControlProtos.GlobalPermission.newBuilder()
                .addAction(ProtobufUtil.toPermissionAction(a)).build()));
  }
  try(Connection conn = ConnectionFactory.createConnection(testUtil.getConfiguration());
      Table acl = conn.getTable(AccessControlLists.ACL_TABLE_NAME)) {
    BlockingRpcChannel channel = acl.coprocessorService(new byte[0]);
    AccessControlService.BlockingInterface protocol =
      AccessControlService.newBlockingStub(channel);
    try {
      protocol.checkPermissions(null, request.build());
    } catch (ServiceException se) {
      ProtobufUtil.toIOException(se);
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:27,代码来源:SecureTestUtil.java


示例3: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkTablePerms(TableName table, Permission... perms) throws IOException {
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    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);
    }
  } finally {
    acl.close();
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:19,代码来源:TestAccessController.java


示例4: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public static void checkTablePerms(Configuration conf, byte[] table, Permission... perms) throws IOException {
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    request.addPermission(ProtobufUtil.toPermission(p));
  }
  HTable 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);
    }
  } finally {
    acl.close();
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:19,代码来源:SecureTestUtil.java


示例5: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkTablePerms(TableName table, Permission... perms) throws IOException {
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    request.addPermission(ProtobufUtil.toPermission(p));
  }
  HTable 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);
    }
  } finally {
    acl.close();
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:19,代码来源:TestAccessController.java


示例6: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public static void checkTablePerms(Configuration conf, TableName table, Permission... perms)
throws IOException {
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    request.addPermission(AccessControlUtil.toPermission(p));
  }
  try (Connection connection = ConnectionFactory.createConnection(conf)) {
    try (Table acl = connection.getTable(table)) {
      AccessControlService.BlockingInterface protocol =
          AccessControlService.newBlockingStub(acl.coprocessorService(new byte[0]));
      try {
        protocol.checkPermissions(null, request.build());
      } catch (ServiceException se) {
        ProtobufUtil.toIOException(se);
      }
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:19,代码来源:SecureTestUtil.java


示例7: checkGlobalPerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public static void checkGlobalPerms(HBaseTestingUtility testUtil, Permission.Action... actions)
    throws IOException {
  Permission[] perms = new Permission[actions.length];
  for (int i = 0; i < actions.length; i++) {
    perms[i] = new Permission(actions[i]);
  }
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Action a : actions) {
    request.addPermission(AccessControlProtos.Permission.newBuilder()
        .setType(AccessControlProtos.Permission.Type.Global)
        .setGlobalPermission(
            AccessControlProtos.GlobalPermission.newBuilder()
                .addAction(AccessControlUtil.toPermissionAction(a)).build()));
  }
  try(Connection conn = ConnectionFactory.createConnection(testUtil.getConfiguration());
      Table acl = conn.getTable(AccessControlLists.ACL_TABLE_NAME)) {
    BlockingRpcChannel channel = acl.coprocessorService(new byte[0]);
    AccessControlService.BlockingInterface protocol =
      AccessControlService.newBlockingStub(channel);
    try {
      protocol.checkPermissions(null, request.build());
    } catch (ServiceException se) {
      ProtobufUtil.toIOException(se);
    }
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:27,代码来源:SecureTestUtil.java


示例8: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkTablePerms(Configuration conf, byte[] table, Permission... perms) throws IOException {
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    request.addPermission(ProtobufUtil.toPermission(p));
  }
  HTable 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);
    }
  } finally {
    acl.close();
  }
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:19,代码来源:SecureTestUtil.java


示例9: checkGlobalPerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkGlobalPerms(Permission.Action... actions) throws IOException {
  HTable acl = new HTable(conf, AccessControlLists.ACL_TABLE_NAME);
  BlockingRpcChannel channel = acl.coprocessorService(new byte[0]);
  AccessControlService.BlockingInterface protocol =
      AccessControlService.newBlockingStub(channel);

  Permission[] perms = new Permission[actions.length];
  for (int i = 0; i < actions.length; i++) {
    perms[i] = new Permission(actions[i]);
  }

  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Action a : actions) {
    request.addPermission(AccessControlProtos.Permission.newBuilder()
        .addAction(ProtobufUtil.toPermissionAction(a)).build());
  }
  try {
    protocol.checkPermissions(null, request.build());
  } catch (ServiceException se) {
    ProtobufUtil.toIOException(se);
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:23,代码来源:TestAccessController.java


示例10: checkGlobalPerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkGlobalPerms(Permission.Action... actions) throws IOException {
  Permission[] perms = new Permission[actions.length];
  for (int i = 0; i < actions.length; i++) {
    perms[i] = new Permission(actions[i]);
  }
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Action a : actions) {
    request.addPermission(AccessControlProtos.Permission.newBuilder()
        .setType(AccessControlProtos.Permission.Type.Global)
        .setGlobalPermission(
            AccessControlProtos.GlobalPermission.newBuilder()
                .addAction(ProtobufUtil.toPermissionAction(a)).build()));
  }
  Table acl = new HTable(conf, AccessControlLists.ACL_TABLE_NAME);
  try {
    BlockingRpcChannel channel = acl.coprocessorService(new byte[0]);
    AccessControlService.BlockingInterface protocol =
      AccessControlService.newBlockingStub(channel);
    try {
      protocol.checkPermissions(null, request.build());
    } catch (ServiceException se) {
      ProtobufUtil.toIOException(se);
    }
  } finally {
    acl.close();
  }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:28,代码来源:TestAccessController.java


示例11: checkGlobalPerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkGlobalPerms(Permission.Action... actions) throws IOException {
  Permission[] perms = new Permission[actions.length];
  for (int i = 0; i < actions.length; i++) {
    perms[i] = new Permission(actions[i]);
  }
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Action a : actions) {
    request.addPermission(AccessControlProtos.Permission.newBuilder()
        .setType(AccessControlProtos.Permission.Type.Global)
        .setGlobalPermission(
            AccessControlProtos.GlobalPermission.newBuilder()
                .addAction(ProtobufUtil.toPermissionAction(a)).build()));
  }
  HTable acl = new HTable(conf, AccessControlLists.ACL_TABLE_NAME);
  try {
    BlockingRpcChannel channel = acl.coprocessorService(new byte[0]);
    AccessControlService.BlockingInterface protocol =
      AccessControlService.newBlockingStub(channel);
    try {
      protocol.checkPermissions(null, request.build());
    } catch (ServiceException se) {
      ProtobufUtil.toIOException(se);
    }
  } finally {
    acl.close();
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:28,代码来源:TestAccessController.java


示例12: checkTablePerms

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
public void checkTablePerms(byte[] table, Permission... perms) throws IOException {
  HTable acl = new HTable(conf, table);
  AccessControlService.BlockingInterface protocol =
      AccessControlService.newBlockingStub(acl.coprocessorService(new byte[0]));
  CheckPermissionsRequest.Builder request = CheckPermissionsRequest.newBuilder();
  for (Permission p : perms) {
    request.addPermission(ProtobufUtil.toPermission(p));
  }
  try {
    protocol.checkPermissions(null, request.build());
  } catch (ServiceException se) {
    ProtobufUtil.toIOException(se);
  }
}
 
开发者ID:daidong,项目名称:DominoHBase,代码行数:15,代码来源:TestAccessController.java


示例13: checkPermissions

import org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest; //导入依赖的package包/类
@Override
public void checkPermissions(RpcController controller, CheckPermissionsRequest request,
    RpcCallback<CheckPermissionsResponse> done) {}
 
开发者ID:apache,项目名称:hbase,代码行数:4,代码来源:TestMasterCoprocessorServices.java



注:本文中的org.apache.hadoop.hbase.protobuf.generated.AccessControlProtos.CheckPermissionsRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UserLocalService类代码示例发布时间:2022-05-23
下一篇:
Java ResultCode类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap