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

项目:hadoop    文件:FSImageFormatPBINode.java   
public static ImmutableList<QuotaByStorageTypeEntry> loadQuotaByStorageTypeEntries(
  QuotaByStorageTypeFeatureProto proto) {
  ImmutableList.Builder<QuotaByStorageTypeEntry> b = ImmutableList.builder();
  for (QuotaByStorageTypeEntryProto quotaEntry : proto.getQuotasList()) {
    StorageType type = PBHelper.convertStorageType(quotaEntry.getStorageType());
    long quota = quotaEntry.getQuota();
    b.add(new QuotaByStorageTypeEntry.Builder().setStorageType(type)
        .setQuota(quota).build());
  }
  return b.build();
}
项目:hadoop    文件:FSImageFormatPBINode.java   
private static QuotaByStorageTypeFeatureProto.Builder
    buildQuotaByStorageTypeEntries(QuotaCounts q) {
  QuotaByStorageTypeFeatureProto.Builder b =
      QuotaByStorageTypeFeatureProto.newBuilder();
  for (StorageType t: StorageType.getTypesSupportingQuota()) {
    if (q.getTypeSpace(t) >= 0) {
      QuotaByStorageTypeEntryProto.Builder eb =
          QuotaByStorageTypeEntryProto.newBuilder().
          setStorageType(PBHelper.convertStorageType(t)).
          setQuota(q.getTypeSpace(t));
      b.addQuotas(eb);
    }
  }
  return b;
}
项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBINode.java   
public static ImmutableList<QuotaByStorageTypeEntry> loadQuotaByStorageTypeEntries(
  QuotaByStorageTypeFeatureProto proto) {
  ImmutableList.Builder<QuotaByStorageTypeEntry> b = ImmutableList.builder();
  for (QuotaByStorageTypeEntryProto quotaEntry : proto.getQuotasList()) {
    StorageType type = PBHelperClient.convertStorageType(quotaEntry.getStorageType());
    long quota = quotaEntry.getQuota();
    b.add(new QuotaByStorageTypeEntry.Builder().setStorageType(type)
        .setQuota(quota).build());
  }
  return b.build();
}
项目:aliyun-oss-hadoop-fs    文件:FSImageFormatPBINode.java   
private static QuotaByStorageTypeFeatureProto.Builder
    buildQuotaByStorageTypeEntries(QuotaCounts q) {
  QuotaByStorageTypeFeatureProto.Builder b =
      QuotaByStorageTypeFeatureProto.newBuilder();
  for (StorageType t: StorageType.getTypesSupportingQuota()) {
    if (q.getTypeSpace(t) >= 0) {
      QuotaByStorageTypeEntryProto.Builder eb =
          QuotaByStorageTypeEntryProto.newBuilder().
          setStorageType(PBHelperClient.convertStorageType(t)).
          setQuota(q.getTypeSpace(t));
      b.addQuotas(eb);
    }
  }
  return b;
}
项目:big-c    文件:FSImageFormatPBINode.java   
public static ImmutableList<QuotaByStorageTypeEntry> loadQuotaByStorageTypeEntries(
  QuotaByStorageTypeFeatureProto proto) {
  ImmutableList.Builder<QuotaByStorageTypeEntry> b = ImmutableList.builder();
  for (QuotaByStorageTypeEntryProto quotaEntry : proto.getQuotasList()) {
    StorageType type = PBHelper.convertStorageType(quotaEntry.getStorageType());
    long quota = quotaEntry.getQuota();
    b.add(new QuotaByStorageTypeEntry.Builder().setStorageType(type)
        .setQuota(quota).build());
  }
  return b.build();
}
项目:big-c    文件:FSImageFormatPBINode.java   
private static QuotaByStorageTypeFeatureProto.Builder
    buildQuotaByStorageTypeEntries(QuotaCounts q) {
  QuotaByStorageTypeFeatureProto.Builder b =
      QuotaByStorageTypeFeatureProto.newBuilder();
  for (StorageType t: StorageType.getTypesSupportingQuota()) {
    if (q.getTypeSpace(t) >= 0) {
      QuotaByStorageTypeEntryProto.Builder eb =
          QuotaByStorageTypeEntryProto.newBuilder().
          setStorageType(PBHelper.convertStorageType(t)).
          setQuota(q.getTypeSpace(t));
      b.addQuotas(eb);
    }
  }
  return b;
}