diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java index 686d960..1c3f09d 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java @@ -297,8 +297,7 @@ public final class SnapshotInfo extends Configured implements Tool { printInfo(); if (showSchema) printSchema(); - if (showFiles || showStats) printFiles(showFiles); - + printFiles(showFiles, showStats); return 0; } @@ -348,7 +347,7 @@ public final class SnapshotInfo extends Configured implements Tool { * Collect the hfiles and logs statistics of the snapshot and * dump the file list if requested and the collected information. */ - private void printFiles(final boolean showFiles) throws IOException { + private void printFiles(final boolean showFiles, final boolean showStats) throws IOException { if (showFiles) { System.out.println("Snapshot Files"); System.out.println("----------------------------------------"); @@ -403,15 +402,17 @@ public final class SnapshotInfo extends Configured implements Tool { System.out.println("**************************************************************"); } - System.out.printf("%d HFiles (%d in archive), total size %s (%.2f%% %s shared with the source table)%n", - stats.getStoreFilesCount(), stats.getArchivedStoreFilesCount(), - StringUtils.humanReadableInt(stats.getStoreFilesSize()), - stats.getSharedStoreFilePercentage(), - StringUtils.humanReadableInt(stats.getSharedStoreFilesSize()) - ); - System.out.printf("%d Logs, total size %s%n", - stats.getLogsCount(), StringUtils.humanReadableInt(stats.getLogsSize())); - System.out.println(); + if (showStats){ + System.out.printf("%d HFiles (%d in archive), total size %s (%.2f%% %s shared with the source table)%n", + stats.getStoreFilesCount(), stats.getArchivedStoreFilesCount(), + StringUtils.humanReadableInt(stats.getStoreFilesSize()), + stats.getSharedStoreFilePercentage(), + StringUtils.humanReadableInt(stats.getSharedStoreFilesSize()) + ); + System.out.printf("%d Logs, total size %s%n", + stats.getLogsCount(), StringUtils.humanReadableInt(stats.getLogsSize())); + System.out.println(); + } } private void printUsageAndExit() {