org.apache.hadoop.hdfs.server.namenode.AclFeature的实例源码

项目:hadoop    文件Snapshot.java   
Root(INodeDirectory other) {
  // Always preserve ACL,XAttr.
  super(other,false,Lists.newArrayList(
    Iterables.filter(Arrays.asList(other.getFeatures()),new Predicate<Feature>() {

      @Override
      public boolean apply(Feature input) {
        if (AclFeature.class.isinstance(input) 
            || XAttrFeature.class.isinstance(input)) {
          return true;
        }
        return false;
      }

    }))
    .toArray(new Feature[0]));
}
项目:aliyun-oss-hadoop-fs    文件Snapshot.java   
Root(INodeDirectory other) {
  // Always preserve ACL,new Predicate<Feature>() {

      @Override
      public boolean apply(Feature input) {
        if (AclFeature.class.isinstance(input) 
            || XAttrFeature.class.isinstance(input)) {
          return true;
        }
        return false;
      }

    }))
    .toArray(new Feature[0]));
}
项目:big-c    文件Snapshot.java   
Root(INodeDirectory other) {
  // Always preserve ACL,new Predicate<Feature>() {

      @Override
      public boolean apply(Feature input) {
        if (AclFeature.class.isinstance(input) 
            || XAttrFeature.class.isinstance(input)) {
          return true;
        }
        return false;
      }

    }))
    .toArray(new Feature[0]));
}
项目:hadoop-2.6.0-cdh5.4.3    文件Snapshot.java   
Root(INodeDirectory other) {
  // Always preserve ACL,new Predicate<Feature>() {

      @Override
      public boolean apply(Feature input) {
        if (AclFeature.class.isinstance(input) 
            || XAttrFeature.class.isinstance(input)) {
          return true;
        }
        return false;
      }

    }))
    .toArray(new Feature[0]));
}
项目:FlexMap    文件Snapshot.java   
Root(INodeDirectory other) {
  // Always preserve ACL,new Predicate<Feature>() {

      @Override
      public boolean apply(Feature input) {
        if (AclFeature.class.isinstance(input) 
            || XAttrFeature.class.isinstance(input)) {
          return true;
        }
        return false;
      }

    }))
    .toArray(new Feature[0]));
}
项目: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",aclFeature.getRefCount());
  assertEquals("Unique ACL features should remain same",totalAclFeatures,AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}
项目:aliyun-oss-hadoop-fs    文件TestAclWithSnapshot.java   
private void deleteSnapshotWithAclAndVerify(AclFeature aclFeature,AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}
项目:big-c    文件TestAclWithSnapshot.java   
private void deleteSnapshotWithAclAndVerify(AclFeature aclFeature,AclStorage.getUniqueAclFeatures().getUniqueElementsSize());
}
项目:incubator-sentry    文件SentryAuthorizationProvider.java   
private void checkAndRemoveHdfsAcl(INodeAuthorizationInfo node,boolean warn) {
  AclFeature f = defaultAuthzProvider.getAclFeature(node,Snapshot.CURRENT_STATE_ID);
  if (f != null) {
    defaultAuthzProvider.removeAclFeature(node);
  } else {
    if (warn) {
      LOG.warn("### removeAclFeature is requested on {},but it does not " +
          "have any acl.",node);
    }
  }
}
项目:incubator-sentry    文件SentryAuthorizationProvider.java   
@Override
public void addAclFeature(INodeAuthorizationInfo node,AclFeature f) {
  // always fall through to defaultAuthZProvider,// issue warning when the path is sentry managed
  if (isSentryManaged(node)) {
    LOG.warn("### addAclFeature {} (sentry managed path) {},update HDFS." +
        WARN_VISIBILITY,node.getFullPathName(),f.toString());
    // For Sentry-managed path,remove ACL silently before adding new ACL
    checkAndRemoveHdfsAcl(node,false);
  }
  defaultAuthzProvider.addAclFeature(node,f);
}
项目:FlexMap    文件INodeSymlink.java   
@Override
public void addAclFeature(AclFeature f) {
  throw new UnsupportedOperationException("ACLs are not supported on symlinks");
}
项目:hadoop-on-lustre2    文件Snapshot.java   
Root(INodeDirectory other) {
  // Always preserve ACL.
  super(other,AclFeature.class))
    .toArray(new Feature[0]));
}
项目:incubator-sentry    文件SentryAuthorizationProvider.java   
@Override
public AclFeature getAclFeature(INodeAuthorizationInfo node,int snapshotId) {
  AclFeature f = null;
  String[] pathelements = getpathelements(node);
  String p = Arrays.toString(pathelements);
  boolean isPrefixed = false;
  boolean isstale = false;
  boolean hasAuthzObj = false;
  Map<String,AclEntry> aclMap = null;
  if (!authzInfo.isUnderPrefix(pathelements)) {
    isPrefixed = false;
    f = defaultAuthzProvider.getAclFeature(node,snapshotId);
  } else if (!authzInfo.doesBelongToAuthzObject(pathelements)) {
    isPrefixed = true;
    f = defaultAuthzProvider.getAclFeature(node,snapshotId);
  } else {
    isPrefixed = true;
    hasAuthzObj = true;
    aclMap = new HashMap<String,AclEntry>();
    if (originalAuthzAsAcl) {
      String user = defaultAuthzProvider.getUser(node,snapshotId);
      String group = getDefaultProviderGroup(node,snapshotId);
      FsPermission perm = defaultAuthzProvider.getFsPermission(node,snapshotId);
      addToACLMap(aclMap,createAclEntries(user,group,perm));
    } else {
      addToACLMap(aclMap,createAclEntries(this.user,this.group,this.permission));
    }
    if (!authzInfo.isstale()) {
      isstale = false;
      addToACLMap(aclMap,authzInfo.getAclEntries(pathelements));
      f = new SentryAclFeature(ImmutableList.copyOf(aclMap.values()));
    } else {
      isstale = true;
      f = new SentryAclFeature(ImmutableList.copyOf(aclMap.values()));
    }
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("### getAclEntry \n[" + p + "] : ["
        + "isPreifxed=" + isPrefixed
        + ",isstale=" + isstale
        + ",hasAuthzObj=" + hasAuthzObj
        + ",origAuthzAsAcl=" + originalAuthzAsAcl + "]\n"
        + "[" + (aclMap == null ? "null" : aclMap) + "]\n"
        + "[" + (f == null ? "null" : f.getEntries()) + "]\n");
  }
  return f;
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...