当前位置: 首页>>代码示例>>Java>>正文


Java SnapshotDescriptionUtils.isSnapshotOwner方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils.isSnapshotOwner方法的典型用法代码示例。如果您正苦于以下问题:Java SnapshotDescriptionUtils.isSnapshotOwner方法的具体用法?Java SnapshotDescriptionUtils.isSnapshotOwner怎么用?Java SnapshotDescriptionUtils.isSnapshotOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils的用法示例。


在下文中一共展示了SnapshotDescriptionUtils.isSnapshotOwner方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preListSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preListSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot) throws IOException {
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, getActiveUser())) {
    // list it, if user is the owner of snapshot
  } else {
    requirePermission("listSnapshot", Action.ADMIN);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:AccessController.java

示例2: preRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preRestoreSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot, final HTableDescriptor hTableDescriptor)
    throws IOException {
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, getActiveUser())) {
    requirePermission("restoreSnapshot", hTableDescriptor.getTableName(), null, null,
      Permission.Action.ADMIN);
  } else {
    requirePermission("restore", Action.ADMIN);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:AccessController.java

示例3: preDeleteSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preDeleteSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot) throws IOException {
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, getActiveUser())) {
    // Snapshot owner is allowed to delete the snapshot
    // TODO: We are not logging this for audit
  } else {
    requirePermission("deleteSnapshot", Action.ADMIN);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:AccessController.java

示例4: preListSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preListSnapshot(ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot) throws IOException {
  User user = getActiveUser(ctx);
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user)) {
    // list it, if user is the owner of snapshot
    AuthResult result = AuthResult.allow("listSnapshot " + snapshot.getName(),
        "Snapshot owner check allowed", user, null, null, null);
    AccessChecker.logResult(result);
  } else {
    accessChecker.requirePermission(user, "listSnapshot " + snapshot.getName(), Action.ADMIN);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:14,代码来源:AccessController.java

示例5: preCloneSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preCloneSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor)
    throws IOException {
  User user = getActiveUser(ctx);
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user)
      && hTableDescriptor.getTableName().getNameAsString().equals(snapshot.getTable())) {
    // Snapshot owner is allowed to create a table with the same name as the snapshot he took
    AuthResult result = AuthResult.allow("cloneSnapshot " + snapshot.getName(),
      "Snapshot owner check allowed", user, null, hTableDescriptor.getTableName(), null);
    AccessChecker.logResult(result);
  } else {
    accessChecker.requirePermission(user, "cloneSnapshot " + snapshot.getName(), Action.ADMIN);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:16,代码来源:AccessController.java

示例6: preRestoreSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preRestoreSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot, final TableDescriptor hTableDescriptor)
    throws IOException {
  User user = getActiveUser(ctx);
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user)) {
    accessChecker.requirePermission(user, "restoreSnapshot " + snapshot.getName(),
        hTableDescriptor.getTableName(), null, null, Permission.Action.ADMIN);
  } else {
    accessChecker.requirePermission(user, "restoreSnapshot " + snapshot.getName(), Action.ADMIN);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:13,代码来源:AccessController.java

示例7: preDeleteSnapshot

import org.apache.hadoop.hbase.snapshot.SnapshotDescriptionUtils; //导入方法依赖的package包/类
@Override
public void preDeleteSnapshot(final ObserverContext<MasterCoprocessorEnvironment> ctx,
    final SnapshotDescription snapshot) throws IOException {
  User user = getActiveUser(ctx);
  if (SnapshotDescriptionUtils.isSnapshotOwner(snapshot, user)) {
    // Snapshot owner is allowed to delete the snapshot
    AuthResult result = AuthResult.allow("deleteSnapshot " + snapshot.getName(),
        "Snapshot owner check allowed", user, null, null, null);
    AccessChecker.logResult(result);
  } else {
    accessChecker.requirePermission(user, "deleteSnapshot " + snapshot.getName(), Action.ADMIN);
  }
}
 
开发者ID:apache,项目名称:hbase,代码行数:14,代码来源:AccessController.java


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