diff --git hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon index 4b1c192..a624226 100644 --- hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon +++ hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon @@ -477,7 +477,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();
<% snapshots.size() %> snapshot(s) in set.
+<% snapshots.size() %> snapshot(s) in set. [Snapshot Storefile stats]
%if> %def> diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java index c944fc4..658f4d0 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java @@ -27,6 +27,8 @@ import java.util.Date; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ExecutorService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -126,6 +128,7 @@ public final class SnapshotInfo extends Configured implements Tool { private AtomicLong hfilesArchiveSize = new AtomicLong(); private AtomicLong hfilesSize = new AtomicLong(); private AtomicLong hfilesMobSize = new AtomicLong(); + private AtomicLong nonSharedHfilesArchiveSize = new AtomicLong(); private AtomicLong logSize = new AtomicLong(); private final HBaseProtos.SnapshotDescription snapshot; @@ -207,6 +210,17 @@ public final class SnapshotInfo extends Configured implements Tool { /** @return the total size of the store files in the mob store*/ public long getMobStoreFilesSize() { return hfilesMobSize.get(); } + /** @return the total size of the store files in the archive which is not shared + * with other snapshots and tables + * + * this is only calculated when + * {@link getSnapshotStats(Configuration,SnapshotDescription, ConcurrentHashMap)} + * is called with a non-null ConcurrentHashMap + */ + public long getNonSharedArchivedStoreFilesSize() { + return nonSharedHfilesArchiveSize.get(); + } + /** @return the percentage of the shared store files */ public float getSharedStoreFilePercentage() { return ((float) hfilesSize.get() / (getStoreFilesSize())) * 100; @@ -227,10 +241,12 @@ public final class SnapshotInfo extends Configured implements Tool { * @param region region encoded Name * @param family family name * @param storeFile store file name + * @param filesMap store files map for all snapshots, it may be null * @return the store file information */ FileInfo addStoreFile(final HRegionInfo region, final String family, - final SnapshotRegionManifest.StoreFile storeFile) throws IOException { + final SnapshotRegionManifest.StoreFile storeFile, + ConcurrentHashMap| Snapshot Name | +Table | +Creation Time | +Shared Storefile Size | +Mob Storefile Size | +Archived Storefile Size | +
|---|---|---|---|---|---|
| <%= snapshotDesc.getName() %> | + <% + TableName snapshotTable = TableName.valueOf(snapshotDesc.getTable()); + SnapshotInfo.SnapshotStats stats = SnapshotInfo.getSnapshotStats(master.getConfiguration(), + snapshotDesc, filesMap); + totalUnsharedArchivedSize += stats.getNonSharedArchivedStoreFilesSize(); + %> +<%= snapshotTable.getNameAsString() %> + | +<%= new Date(snapshotDesc.getCreationTime()) %> | +<%= StringUtils.humanReadableInt(stats.getSharedStoreFilesSize()) %> | +<%= StringUtils.humanReadableInt(stats.getMobStoreFilesSize()) %> | +<%= StringUtils.humanReadableInt(stats.getArchivedStoreFileSize()) %> + (<%= StringUtils.humanReadableInt(stats.getNonSharedArchivedStoreFilesSize()) %>) | +