/** Return the string representation of the object in the output format. * For description of the options, * @see #toString(boolean, boolean, boolean, boolean, List) * * @param qOption a flag indicating if quota needs to be printed or not * @param hOption a flag indicating if human readable output if to be used * @return the string representation of the object */ public String toString(boolean qOption, boolean hOption) { return toString(qOption, hOption, false, null); }
/** Return the string representation of the object in the output format. * if qOption is false, output directory count, file count, and content size; * if qOption is true, output quota and remaining quota as well. * * @param qOption a flag indicating if quota needs to be printed or not * @return the string representation of the object */ @Override public String toString(boolean qOption) { return toString(qOption, false); }
@Override public String toString() { return toString(true); }
/** Return the string representation of the object in the output format. * For description of the options, * @see #toString(boolean, boolean, boolean, boolean, List) * * @param qOption a flag indicating if quota needs to be printed or not * @param hOption a flag indicating if human readable output is to be used * @param xOption a flag indicating if calculation from snapshots is to be * included in the output * @return the string representation of the object */ public String toString(boolean qOption, boolean hOption, boolean xOption) { return toString(qOption, hOption, false, xOption, null); }
/** * Return the string representation of the object in the output format. * For description of the options, * @see #toString(boolean, boolean, boolean, boolean, List) * * @param qOption a flag indicating if quota needs to be printed or not * @param hOption a flag indicating if human readable output if to be used * @param tOption a flag indicating if display quota by storage types * @param types Storage types to display * @return the string representation of the object */ public String toString(boolean qOption, boolean hOption, boolean tOption, List<StorageType> types) { return toString(qOption, hOption, tOption, false, types); }
@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()); }
/** Return the string representation of the object in the output format. * if qOption is false, output directory count, file count, and content size; * if qOption is true, output quota and remaining quota as well. * * @param qOption a flag indicating if quota needs to be printed or not * @return the string representation of the object */ public String toString(boolean qOption) { return toString(qOption, false); }
/** Return the string representation of the object in the output format. * if qOption is false, output directory count, file count, and content size; * if qOption is true, output quota and remaining quota as well. * * @param qOption a flag indicating if quota needs to be printed or not * @return the string representation of the object */ public String toString(boolean qOption) { return toString(qOption, false); }
/** {@inheritDoc} */ public String toString() { return toString(true); }
@Override public String toString() { return toString(true); }
/** Return the string representation of the object in the output format. * if qOption is false, output directory count, file count, and content size; * if qOption is true, output quota and remaining quota as well. * * @param qOption a flag indicating if quota needs to be printed or not * @return the string representation of the object */ public String toString(boolean qOption) { return toString(qOption, false); }
@Override public String toString() { return toString(true); }
@Override public String toString() { return toString(true); }
/** Return the string representation of the object in the output format. * if qOption is false, output directory count, file count, and content size; * if qOption is true, output quota and remaining quota as well. * * @param qOption a flag indicating if quota needs to be printed or not * @return the string representation of the object */ public String toString(boolean qOption) { return toString(qOption, false); }
@Override protected void run(Path path) throws IOException { FileSystem fs = path.getFileSystem(getConf()); System.out.println(fs.getContentSummary(path).toString(qOption) + path); } }
@Override protected void run(Path path) throws IOException { FileSystem fs = path.getFileSystem(getConf()); System.out.println(fs.getContentSummary(path).toString(qOption) + path); } }
@Override protected void processPath(PathData src) throws IOException { ContentSummary summary = src.fs.getContentSummary(src.path); out.println(summary.toString(showQuotas, isHumanReadable()) + src); }
@Override protected void processPath(PathData src) throws IOException { ContentSummary summary = src.fs.getContentSummary(src.path); out.println(summary.toString(showQuotas, isHumanReadable()) + src); }
@Test public void testToStringNoQuota() { long length = 11111; long fileCount = 22222; long directoryCount = 33333; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directoryCount).build(); String expected = " none inf none" + " inf 33333 22222 11111 "; assertEquals(expected, contentSummary.toString(true)); }
@Test public void testToStringNoQuota() { long length = 11111; long fileCount = 22222; long directoryCount = 33333; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directoryCount).build(); String expected = " none inf none" + " inf 33333 22222 11111 "; assertEquals(expected, contentSummary.toString(true)); }