Java 类org.apache.hadoop.hdfs.server.namenode.FsImageProto.INodeSection.AclFeatureProto 实例源码

项目:hadoop    文件:FSImageFormatPBINode.java   
public static ImmutableList<AclEntry> loadAclEntries(
    AclFeatureProto proto, final String[] stringTable) {
  ImmutableList.Builder<AclEntry> b = ImmutableList.builder();
  for (int v : proto.getEntriesList()) {
    int p = v & ACL_ENTRY_PERM_MASK;
    int t = (v >> ACL_ENTRY_TYPE_OFFSET) & ACL_ENTRY_TYPE_MASK;
    int s = (v >> ACL_ENTRY_SCOPE_OFFSET) & ACL_ENTRY_SCOPE_MASK;
    int nid = (v >> ACL_ENTRY_NAME_OFFSET) & ACL_ENTRY_NAME_MASK;
    String name = stringTable[nid];
    b.add(new AclEntry.Builder().setName(name)
        .setPermission(FSACTION_VALUES[p])
        .setScope(ACL_ENTRY_SCOPE_VALUES[s])
        .setType(ACL_ENTRY_TYPE_VALUES[t]).build());
  }
  return b.build();
}
项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBINode.java   
public static ImmutableList<AclEntry> loadAclEntries(
    AclFeatureProto proto, final String[] stringTable) {
  ImmutableList.Builder<AclEntry> b = ImmutableList.builder();
  for (int v : proto.getEntriesList()) {
    int p = v & ACL_ENTRY_PERM_MASK;
    int t = (v >> ACL_ENTRY_TYPE_OFFSET) & ACL_ENTRY_TYPE_MASK;
    int s = (v >> ACL_ENTRY_SCOPE_OFFSET) & ACL_ENTRY_SCOPE_MASK;
    int nid = (v >> ACL_ENTRY_NAME_OFFSET) & ACL_ENTRY_NAME_MASK;
    String name = stringTable[nid];
    b.add(new AclEntry.Builder().setName(name)
        .setPermission(FSACTION_VALUES[p])
        .setScope(ACL_ENTRY_SCOPE_VALUES[s])
        .setType(ACL_ENTRY_TYPE_VALUES[t]).build());
  }
  return b.build();
}
项目:big-c    文件:FSImageFormatPBINode.java   
public static ImmutableList<AclEntry> loadAclEntries(
    AclFeatureProto proto, final String[] stringTable) {
  ImmutableList.Builder<AclEntry> b = ImmutableList.builder();
  for (int v : proto.getEntriesList()) {
    int p = v & ACL_ENTRY_PERM_MASK;
    int t = (v >> ACL_ENTRY_TYPE_OFFSET) & ACL_ENTRY_TYPE_MASK;
    int s = (v >> ACL_ENTRY_SCOPE_OFFSET) & ACL_ENTRY_SCOPE_MASK;
    int nid = (v >> ACL_ENTRY_NAME_OFFSET) & ACL_ENTRY_NAME_MASK;
    String name = stringTable[nid];
    b.add(new AclEntry.Builder().setName(name)
        .setPermission(FSACTION_VALUES[p])
        .setScope(ACL_ENTRY_SCOPE_VALUES[s])
        .setType(ACL_ENTRY_TYPE_VALUES[t]).build());
  }
  return b.build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSImageFormatPBINode.java   
public static ImmutableList<AclEntry> loadAclEntries(
    AclFeatureProto proto, final String[] stringTable) {
  ImmutableList.Builder<AclEntry> b = ImmutableList.builder();
  for (int v : proto.getEntriesList()) {
    int p = v & ACL_ENTRY_PERM_MASK;
    int t = (v >> ACL_ENTRY_TYPE_OFFSET) & ACL_ENTRY_TYPE_MASK;
    int s = (v >> ACL_ENTRY_SCOPE_OFFSET) & ACL_ENTRY_SCOPE_MASK;
    int nid = (v >> ACL_ENTRY_NAME_OFFSET) & ACL_ENTRY_NAME_MASK;
    String name = stringTable[nid];
    b.add(new AclEntry.Builder().setName(name)
        .setPermission(FSACTION_VALUES[p])
        .setScope(ACL_ENTRY_SCOPE_VALUES[s])
        .setType(ACL_ENTRY_TYPE_VALUES[t]).build());
  }
  return b.build();
}
项目:FlexMap    文件:FSImageFormatPBINode.java   
public static ImmutableList<AclEntry> loadAclEntries(
    AclFeatureProto proto, final String[] stringTable) {
  ImmutableList.Builder<AclEntry> b = ImmutableList.builder();
  for (int v : proto.getEntriesList()) {
    int p = v & ACL_ENTRY_PERM_MASK;
    int t = (v >> ACL_ENTRY_TYPE_OFFSET) & ACL_ENTRY_TYPE_MASK;
    int s = (v >> ACL_ENTRY_SCOPE_OFFSET) & ACL_ENTRY_SCOPE_MASK;
    int nid = (v >> ACL_ENTRY_NAME_OFFSET) & ACL_ENTRY_NAME_MASK;
    String name = stringTable[nid];
    b.add(new AclEntry.Builder().setName(name)
        .setPermission(FSACTION_VALUES[p])
        .setScope(ACL_ENTRY_SCOPE_VALUES[s])
        .setType(ACL_ENTRY_TYPE_VALUES[t]).build());
  }
  return b.build();
}
项目:hadoop-on-lustre2    文件:FSImageFormatPBINode.java   
public static ImmutableList<AclEntry> loadAclEntries(
    AclFeatureProto proto, final String[] stringTable) {
  ImmutableList.Builder<AclEntry> b = ImmutableList.builder();
  for (int v : proto.getEntriesList()) {
    int p = v & ACL_ENTRY_PERM_MASK;
    int t = (v >> ACL_ENTRY_TYPE_OFFSET) & ACL_ENTRY_TYPE_MASK;
    int s = (v >> ACL_ENTRY_SCOPE_OFFSET) & ACL_ENTRY_SCOPE_MASK;
    int nid = (v >> ACL_ENTRY_NAME_OFFSET) & ACL_ENTRY_NAME_MASK;
    String name = stringTable[nid];
    b.add(new AclEntry.Builder().setName(name)
        .setPermission(FSACTION_VALUES[p])
        .setScope(ACL_ENTRY_SCOPE_VALUES[s])
        .setType(ACL_ENTRY_TYPE_VALUES[t]).build());
  }
  return b.build();
}
项目:hadoop    文件:FSImageFormatPBINode.java   
private static AclFeatureProto.Builder buildAclEntries(AclFeature f,
    final SaverContext.DeduplicationMap<String> map) {
  AclFeatureProto.Builder b = AclFeatureProto.newBuilder();
  for (int pos = 0, e; pos < f.getEntriesSize(); pos++) {
    e = f.getEntryAt(pos);
    int nameId = map.getId(AclEntryStatusFormat.getName(e));
    int v = ((nameId & ACL_ENTRY_NAME_MASK) << ACL_ENTRY_NAME_OFFSET)
        | (AclEntryStatusFormat.getType(e).ordinal() << ACL_ENTRY_TYPE_OFFSET)
        | (AclEntryStatusFormat.getScope(e).ordinal() << ACL_ENTRY_SCOPE_OFFSET)
        | (AclEntryStatusFormat.getPermission(e).ordinal());
    b.addEntries(v);
  }
  return b;
}
项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBINode.java   
private static AclFeatureProto.Builder buildAclEntries(AclFeature f,
    final SaverContext.DeduplicationMap<String> map) {
  AclFeatureProto.Builder b = AclFeatureProto.newBuilder();
  for (int pos = 0, e; pos < f.getEntriesSize(); pos++) {
    e = f.getEntryAt(pos);
    int nameId = map.getId(AclEntryStatusFormat.getName(e));
    int v = ((nameId & ACL_ENTRY_NAME_MASK) << ACL_ENTRY_NAME_OFFSET)
        | (AclEntryStatusFormat.getType(e).ordinal() << ACL_ENTRY_TYPE_OFFSET)
        | (AclEntryStatusFormat.getScope(e).ordinal() << ACL_ENTRY_SCOPE_OFFSET)
        | (AclEntryStatusFormat.getPermission(e).ordinal());
    b.addEntries(v);
  }
  return b;
}
项目:aliyun-oss-hadoop-fs    文件:PBImageXmlWriter.java   
private void dumpAcls(AclFeatureProto aclFeatureProto) {
  ImmutableList<AclEntry> aclEntryList = FSImageFormatPBINode.Loader
      .loadAclEntries(aclFeatureProto, stringTable);
  if (aclEntryList.size() > 0) {
    out.print("<acls>");
    for (AclEntry aclEntry : aclEntryList) {
      o("acl", aclEntry.toString());
    }
    out.print("</acls>");
  }
}
项目:big-c    文件:FSImageFormatPBINode.java   
private static AclFeatureProto.Builder buildAclEntries(AclFeature f,
    final SaverContext.DeduplicationMap<String> map) {
  AclFeatureProto.Builder b = AclFeatureProto.newBuilder();
  for (int pos = 0, e; pos < f.getEntriesSize(); pos++) {
    e = f.getEntryAt(pos);
    int nameId = map.getId(AclEntryStatusFormat.getName(e));
    int v = ((nameId & ACL_ENTRY_NAME_MASK) << ACL_ENTRY_NAME_OFFSET)
        | (AclEntryStatusFormat.getType(e).ordinal() << ACL_ENTRY_TYPE_OFFSET)
        | (AclEntryStatusFormat.getScope(e).ordinal() << ACL_ENTRY_SCOPE_OFFSET)
        | (AclEntryStatusFormat.getPermission(e).ordinal());
    b.addEntries(v);
  }
  return b;
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSImageFormatPBINode.java   
private static AclFeatureProto.Builder buildAclEntries(AclFeature f,
    final SaverContext.DeduplicationMap<String> map) {
  AclFeatureProto.Builder b = AclFeatureProto.newBuilder();
  for (AclEntry e : f.getEntries()) {
    int v = ((map.getId(e.getName()) & ACL_ENTRY_NAME_MASK) << ACL_ENTRY_NAME_OFFSET)
        | (e.getType().ordinal() << ACL_ENTRY_TYPE_OFFSET)
        | (e.getScope().ordinal() << ACL_ENTRY_SCOPE_OFFSET)
        | (e.getPermission().ordinal());
    b.addEntries(v);
  }
  return b;
}
项目:FlexMap    文件:FSImageFormatPBINode.java   
private static AclFeatureProto.Builder buildAclEntries(AclFeature f,
    final SaverContext.DeduplicationMap<String> map) {
  AclFeatureProto.Builder b = AclFeatureProto.newBuilder();
  for (AclEntry e : f.getEntries()) {
    int v = ((map.getId(e.getName()) & ACL_ENTRY_NAME_MASK) << ACL_ENTRY_NAME_OFFSET)
        | (e.getType().ordinal() << ACL_ENTRY_TYPE_OFFSET)
        | (e.getScope().ordinal() << ACL_ENTRY_SCOPE_OFFSET)
        | (e.getPermission().ordinal());
    b.addEntries(v);
  }
  return b;
}
项目:hadoop-on-lustre2    文件:FSImageFormatPBINode.java   
private static AclFeatureProto.Builder buildAclEntries(AclFeature f,
    final SaverContext.DeduplicationMap<String> map) {
  AclFeatureProto.Builder b = AclFeatureProto.newBuilder();
  for (AclEntry e : f.getEntries()) {
    int v = ((map.getId(e.getName()) & ACL_ENTRY_NAME_MASK) << ACL_ENTRY_NAME_OFFSET)
        | (e.getType().ordinal() << ACL_ENTRY_TYPE_OFFSET)
        | (e.getScope().ordinal() << ACL_ENTRY_SCOPE_OFFSET)
        | (e.getPermission().ordinal());
    b.addEntries(v);
  }
  return b;
}