@Override protected void processPath(PathData src) throws IOException { StringBuilder outputString = new StringBuilder(); if (showQuotasAndUsageOnly || showQuotabyType) { QuotaUsage usage = src.fs.getQuotaUsage(src.path); outputString.append(usage.toString( isHumanReadable(), showQuotabyType, storageTypes)); } else { ContentSummary summary = src.fs.getContentSummary(src.path); outputString.append(summary.toString( showQuotas, isHumanReadable(), excludeSnapshots)); } if(displayECPolicy){ ContentSummary summary = src.fs.getContentSummary(src.path); if(!summary.getErasureCodingPolicy().equals("Replicated")){ outputString.append("EC:"); } outputString.append(summary.getErasureCodingPolicy()); outputString.append(" "); } outputString.append(src); out.println(outputString.toString()); }
for (PathData item : items) { ContentSummary contentSummary = item.fs.getContentSummary(item.path); maxEC=maxLength(maxEC,contentSummary.getErasureCodingPolicy().length());
@Override public int hashCode() { long result = getLength() ^ getFileCount() ^ getDirectoryCount() ^ getSnapshotLength() ^ getSnapshotFileCount() ^ getSnapshotDirectoryCount() ^ getSnapshotSpaceConsumed() ^ getErasureCodingPolicy().hashCode(); return ((int) result) ^ super.hashCode(); }
stat.getOwner(), stat.getGroup(), contentSummary.getErasureCodingPolicy(), formatSize(stat.getLen()), dateFormat.format(new Date(isUseAtime()
@Override public boolean equals(Object to) { if (this == to) { return true; } else if (to instanceof ContentSummary) { ContentSummary right = (ContentSummary) to; return getLength() == right.getLength() && getFileCount() == right.getFileCount() && getDirectoryCount() == right.getDirectoryCount() && getSnapshotLength() == right.getSnapshotLength() && getSnapshotFileCount() == right.getSnapshotFileCount() && getSnapshotDirectoryCount() == right.getSnapshotDirectoryCount() && getSnapshotSpaceConsumed() == right.getSnapshotSpaceConsumed() && getErasureCodingPolicy().equals(right.getErasureCodingPolicy()) && super.equals(to); } else { return super.equals(to); } }
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()). setSnapshotLength(cs.getSnapshotLength()). setSnapshotFileCount(cs.getSnapshotFileCount()). setSnapshotDirectoryCount(cs.getSnapshotDirectoryCount()). setSnapshotSpaceConsumed(cs.getSnapshotSpaceConsumed()). setQuota(cs.getQuota()). setSpaceConsumed(cs.getSpaceConsumed()). setSpaceQuota(cs.getSpaceQuota()). setErasureCodingPolicy(cs.getErasureCodingPolicy()); if (cs.isTypeQuotaSet() || cs.isTypeConsumedAvailable()) { builder.setTypeQuotaInfos(getBuilder(cs)); } return builder.build(); }