Java 类org.apache.hadoop.hdfs.server.namenode.AclStorage 实例源码

项目:hadoop    文件:DirectoryWithSnapshotFeature.java   
@Override
QuotaCounts destroyDiffAndCollectBlocks(
    BlockStoragePolicySuite bsps, INodeDirectory currentINode,
    BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes) {
  // this diff has been deleted
  QuotaCounts counts = new QuotaCounts.Builder().build();
  counts.add(diff.destroyDeletedList(bsps, collectedBlocks, removedINodes));
  INodeDirectoryAttributes snapshotINode = getSnapshotINode();
  if (snapshotINode != null && snapshotINode.getAclFeature() != null) {
    AclStorage.removeAclFeature(snapshotINode.getAclFeature());
  }
  return counts;
}
项目:hadoop    文件:TestAclWithSnapshot.java   
private void deleteSnapshotWithAclAndVerify(AclFeature aclFeature,
    Path pathToCheckAcl, int totalAclFeatures) throws IOException {
  hdfs.deleteSnapshot(path, snapshotName);
  AclFeature afterDeleteAclFeature = FSAclBaseTest.getAclFeature(
      pathToCheckAcl, cluster);
  assertSame(aclFeature, afterDeleteAclFeature);
  assertEquals("Reference count should remain same"
      + " even after deletion of snapshot", 1,
      afterDeleteAclFeature.getRefCount());

  hdfs.removeAcl(pathToCheckAcl);
  assertEquals("Reference count should be 0", 0, aclFeature.getRefCount());
  assertEquals("Unique ACL features should remain same", totalAclFeatures,
      AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}
项目:aliyun-oss-hadoop-fs    文件:DirectoryWithSnapshotFeature.java   
@Override
void destroyDiffAndCollectBlocks(
    INode.ReclaimContext reclaimContext, INodeDirectory currentINode) {
  // this diff has been deleted
  diff.destroyDeletedList(reclaimContext);
  INodeDirectoryAttributes snapshotINode = getSnapshotINode();
  if (snapshotINode != null && snapshotINode.getAclFeature() != null) {
    AclStorage.removeAclFeature(snapshotINode.getAclFeature());
  }
}
项目:aliyun-oss-hadoop-fs    文件:TestAclWithSnapshot.java   
private void deleteSnapshotWithAclAndVerify(AclFeature aclFeature,
    Path pathToCheckAcl, int totalAclFeatures) throws IOException {
  hdfs.deleteSnapshot(path, snapshotName);
  AclFeature afterDeleteAclFeature = FSAclBaseTest.getAclFeature(
      pathToCheckAcl, cluster);
  assertSame(aclFeature, afterDeleteAclFeature);
  assertEquals("Reference count should remain same"
      + " even after deletion of snapshot", 1,
      afterDeleteAclFeature.getRefCount());

  hdfs.removeAcl(pathToCheckAcl);
  assertEquals("Reference count should be 0", 0, aclFeature.getRefCount());
  assertEquals("Unique ACL features should remain same", totalAclFeatures,
      AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}
项目:big-c    文件:DirectoryWithSnapshotFeature.java   
@Override
QuotaCounts destroyDiffAndCollectBlocks(
    BlockStoragePolicySuite bsps, INodeDirectory currentINode,
    BlocksMapUpdateInfo collectedBlocks, final List<INode> removedINodes) {
  // this diff has been deleted
  QuotaCounts counts = new QuotaCounts.Builder().build();
  counts.add(diff.destroyDeletedList(bsps, collectedBlocks, removedINodes));
  INodeDirectoryAttributes snapshotINode = getSnapshotINode();
  if (snapshotINode != null && snapshotINode.getAclFeature() != null) {
    AclStorage.removeAclFeature(snapshotINode.getAclFeature());
  }
  return counts;
}
项目:big-c    文件:TestAclWithSnapshot.java   
private void deleteSnapshotWithAclAndVerify(AclFeature aclFeature,
    Path pathToCheckAcl, int totalAclFeatures) throws IOException {
  hdfs.deleteSnapshot(path, snapshotName);
  AclFeature afterDeleteAclFeature = FSAclBaseTest.getAclFeature(
      pathToCheckAcl, cluster);
  assertSame(aclFeature, afterDeleteAclFeature);
  assertEquals("Reference count should remain same"
      + " even after deletion of snapshot", 1,
      afterDeleteAclFeature.getRefCount());

  hdfs.removeAcl(pathToCheckAcl);
  assertEquals("Reference count should be 0", 0, aclFeature.getRefCount());
  assertEquals("Unique ACL features should remain same", totalAclFeatures,
      AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}