Java 类org.apache.hadoop.hdfs.protocol.proto.HdfsProtos.ContentSummaryProto 实例源码

项目:hadoop    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  ContentSummary.Builder builder = new ContentSummary.Builder();
  builder.length(cs.getLength()).
      fileCount(cs.getFileCount()).
      directoryCount(cs.getDirectoryCount()).
      quota(cs.getQuota()).
      spaceConsumed(cs.getSpaceConsumed()).
      spaceQuota(cs.getSpaceQuota());
  if (cs.hasTypeQuotaInfos()) {
    for (HdfsProtos.StorageTypeQuotaInfoProto info :
        cs.getTypeQuotaInfos().getTypeQuotaInfoList()) {
      StorageType type = PBHelper.convertStorageType(info.getType());
      builder.typeConsumed(type, info.getConsumed());
      builder.typeQuota(type, info.getQuota());
    }
  }
  return builder.build();
}
项目:hadoop    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  ContentSummaryProto.Builder builder = ContentSummaryProto.newBuilder();
      builder.setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota());

  if (cs.isTypeQuotaSet() || cs.isTypeConsumedAvailable()) {
    HdfsProtos.StorageTypeQuotaInfosProto.Builder isb =
        HdfsProtos.StorageTypeQuotaInfosProto.newBuilder();
    for (StorageType t: StorageType.getTypesSupportingQuota()) {
      HdfsProtos.StorageTypeQuotaInfoProto info =
          HdfsProtos.StorageTypeQuotaInfoProto.newBuilder().
              setType(convertStorageType(t)).
              setConsumed(cs.getTypeConsumed(t)).
              setQuota(cs.getTypeQuota(t)).
              build();
      isb.addTypeQuotaInfo(info);
    }
    builder.setTypeQuotaInfos(isb);
  }
  return builder.build();
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  ContentSummary.Builder builder = new ContentSummary.Builder();
  builder.length(cs.getLength()).
      fileCount(cs.getFileCount()).
      directoryCount(cs.getDirectoryCount()).
      quota(cs.getQuota()).
      spaceConsumed(cs.getSpaceConsumed()).
      spaceQuota(cs.getSpaceQuota());
  if (cs.hasTypeQuotaInfos()) {
    for (HdfsProtos.StorageTypeQuotaInfoProto info :
        cs.getTypeQuotaInfos().getTypeQuotaInfoList()) {
      StorageType type = convertStorageType(info.getType());
      builder.typeConsumed(type, info.getConsumed());
      builder.typeQuota(type, info.getQuota());
    }
  }
  return builder.build();
}
项目:aliyun-oss-hadoop-fs    文件:PBHelperClient.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  ContentSummaryProto.Builder builder = ContentSummaryProto.newBuilder();
  builder.setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota());

  if (cs.isTypeQuotaSet() || cs.isTypeConsumedAvailable()) {
    HdfsProtos.StorageTypeQuotaInfosProto.Builder isb =
        HdfsProtos.StorageTypeQuotaInfosProto.newBuilder();
    for (StorageType t: StorageType.getTypesSupportingQuota()) {
      HdfsProtos.StorageTypeQuotaInfoProto info =
          HdfsProtos.StorageTypeQuotaInfoProto.newBuilder().
              setType(convertStorageType(t)).
              setConsumed(cs.getTypeConsumed(t)).
              setQuota(cs.getTypeQuota(t)).
              build();
      isb.addTypeQuotaInfo(info);
    }
    builder.setTypeQuotaInfos(isb);
  }
  return builder.build();
}
项目:big-c    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  ContentSummary.Builder builder = new ContentSummary.Builder();
  builder.length(cs.getLength()).
      fileCount(cs.getFileCount()).
      directoryCount(cs.getDirectoryCount()).
      quota(cs.getQuota()).
      spaceConsumed(cs.getSpaceConsumed()).
      spaceQuota(cs.getSpaceQuota());
  if (cs.hasTypeQuotaInfos()) {
    for (HdfsProtos.StorageTypeQuotaInfoProto info :
        cs.getTypeQuotaInfos().getTypeQuotaInfoList()) {
      StorageType type = PBHelper.convertStorageType(info.getType());
      builder.typeConsumed(type, info.getConsumed());
      builder.typeQuota(type, info.getQuota());
    }
  }
  return builder.build();
}
项目:big-c    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  ContentSummaryProto.Builder builder = ContentSummaryProto.newBuilder();
      builder.setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota());

  if (cs.isTypeQuotaSet() || cs.isTypeConsumedAvailable()) {
    HdfsProtos.StorageTypeQuotaInfosProto.Builder isb =
        HdfsProtos.StorageTypeQuotaInfosProto.newBuilder();
    for (StorageType t: StorageType.getTypesSupportingQuota()) {
      HdfsProtos.StorageTypeQuotaInfoProto info =
          HdfsProtos.StorageTypeQuotaInfoProto.newBuilder().
              setType(convertStorageType(t)).
              setConsumed(cs.getTypeConsumed(t)).
              setQuota(cs.getTypeQuota(t)).
              build();
      isb.addTypeQuotaInfo(info);
    }
    builder.setTypeQuotaInfos(isb);
  }
  return builder.build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:hadoop-plus    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:FlexMap    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:hops    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) {
    return null;
  }
  return new ContentSummary(cs.getLength(), cs.getFileCount(),
      cs.getDirectoryCount(), cs.getQuota(), cs.getSpaceConsumed(),
      cs.getSpaceQuota());
}
项目:hops    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) {
    return null;
  }
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:hadoop-TCP    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:hardfs    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static ContentSummaryProto convert(ContentSummary cs) {
  if (cs == null) return null;
  return ContentSummaryProto.newBuilder().
      setLength(cs.getLength()).
      setFileCount(cs.getFileCount()).
      setDirectoryCount(cs.getDirectoryCount()).
      setQuota(cs.getQuota()).
      setSpaceConsumed(cs.getSpaceConsumed()).
      setSpaceQuota(cs.getSpaceQuota()).
      build();
}
项目:hadoop-2.6.0-cdh5.4.3    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  return new ContentSummary(
    cs.getLength(), cs.getFileCount(), cs.getDirectoryCount(), cs.getQuota(),
    cs.getSpaceConsumed(), cs.getSpaceQuota());
}
项目:hadoop-plus    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  return new ContentSummary(
    cs.getLength(), cs.getFileCount(), cs.getDirectoryCount(), cs.getQuota(),
    cs.getSpaceConsumed(), cs.getSpaceQuota());
}
项目:FlexMap    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  return new ContentSummary(
    cs.getLength(), cs.getFileCount(), cs.getDirectoryCount(), cs.getQuota(),
    cs.getSpaceConsumed(), cs.getSpaceQuota());
}
项目:hadoop-TCP    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  return new ContentSummary(
    cs.getLength(), cs.getFileCount(), cs.getDirectoryCount(), cs.getQuota(),
    cs.getSpaceConsumed(), cs.getSpaceQuota());
}
项目:hardfs    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  return new ContentSummary(
    cs.getLength(), cs.getFileCount(), cs.getDirectoryCount(), cs.getQuota(),
    cs.getSpaceConsumed(), cs.getSpaceQuota());
}
项目:hadoop-on-lustre2    文件:PBHelper.java   
public static ContentSummary convert(ContentSummaryProto cs) {
  if (cs == null) return null;
  return new ContentSummary(
    cs.getLength(), cs.getFileCount(), cs.getDirectoryCount(), cs.getQuota(),
    cs.getSpaceConsumed(), cs.getSpaceQuota());
}