org.apache.hadoop.hbase.client.Admin.revoke()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中org.apache.hadoop.hbase.client.Admin.revoke()方法的一些代码示例,展示了Admin.revoke()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Admin.revoke()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Admin
类名称:Admin
方法名:revoke

Admin.revoke介绍

[英]Revokes user specific permissions
[中]撤消用户特定的权限

代码示例

代码示例来源:origin: apache/hbase

/**
 * Revoke global permissions for the specified user.
 * @param connection The Connection instance to use
 */
public static void revoke(Connection connection, final String userName,
  final Permission.Action... actions) throws Throwable {
 UserPermission userPermission = new UserPermission(userName, new GlobalPermission(actions));
 connection.getAdmin().revoke(userPermission);
}

代码示例来源:origin: apache/hbase

/**
 * Revokes the permission on the namespace for the specified user.
 * @param connection The Connection instance to use
 * @param namespace
 * @param userName
 * @param actions
 * @throws Throwable
 */
public static void revoke(Connection connection, final String namespace,
  final String userName, final Permission.Action... actions) throws Throwable {
 UserPermission userPermission =
   new UserPermission(userName, new NamespacePermission(namespace, actions));
 connection.getAdmin().revoke(userPermission);
}

代码示例来源:origin: apache/hbase

/**
 * Revokes the permission on the table
 * @param connection The Connection instance to use
 * @param tableName
 * @param username
 * @param family
 * @param qualifier
 * @param actions
 * @throws Throwable
 */
public static void revoke(Connection connection, final TableName tableName,
  final String username, final byte[] family, final byte[] qualifier,
  final Permission.Action... actions) throws Throwable {
 UserPermission userPermission =
   new UserPermission(username, new TablePermission(tableName, family, qualifier, actions));
 connection.getAdmin().revoke(userPermission);
}

代码示例来源:origin: apache/hbase

regionEnv.getConnection().getAdmin().revoke(perm);
if (AUDITLOG.isTraceEnabled()) {

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  try (Connection connection = ConnectionFactory.createConnection(conf)) {
   connection.getAdmin().revoke(
    new UserPermission(testUser, new NamespacePermission(TEST_NAMESPACE, Action.WRITE)));
  }
  return null;
 }
};

代码示例来源:origin: apache/hbase

@Override
 public Void call() throws Exception {
  try (Connection connection = ConnectionFactory.createConnection(util.getConfiguration())) {
   connection.getAdmin().revoke(
    new UserPermission(user, new TablePermission(table, family, qualifier, actions)));
  }
  return null;
 }
});

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  try(Connection conn = ConnectionFactory.createConnection(conf)) {
    conn.getAdmin().revoke(new UserPermission(USER_RO.getShortName(),
            new TablePermission(TEST_TABLE, TEST_FAMILY, Action.READ)));
  }
  return null;
 }
};

代码示例来源:origin: apache/hbase

@Override
 public Void call() throws Exception {
  try (Connection connection = ConnectionFactory.createConnection(util.getConfiguration())) {
   connection.getAdmin().revoke(new UserPermission(user, new GlobalPermission(actions)));
  }
  return null;
 }
});

代码示例来源:origin: apache/hbase

@Override
 public Object run() throws Exception {
  try (Connection connection = ConnectionFactory.createConnection(conf)) {
   connection.getAdmin().revoke(new UserPermission(USER_GROUP_NS_ADMIN.getShortName(),
     new NamespacePermission(TEST_NAMESPACE, Action.READ)));
  }
  return null;
 }
};

代码示例来源:origin: apache/hbase

@Override
 public Void call() throws Exception {
  try (Connection connection = ConnectionFactory.createConnection(util.getConfiguration())) {
   connection.getAdmin()
     .revoke(new UserPermission(user, new NamespacePermission(namespace, actions)));
  }
  return null;
 }
});

相关文章

Admin类方法