Package org.apache.hadoop.hbase.snapshot
Class SnapshotInfo.SnapshotStats
java.lang.Object
org.apache.hadoop.hbase.snapshot.SnapshotInfo.SnapshotStats
- Enclosing class:
- SnapshotInfo
Statistics about the snapshot
- How many store files and logs are in the archive
- How many store files and logs are shared with the table
- Total store files and logs size and shared amount
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static class
Information about the file referenced by the snapshot -
Field Summary
Modifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configuration
private final org.apache.hadoop.fs.FileSystem
private AtomicInteger
private AtomicLong
private AtomicInteger
private AtomicInteger
private AtomicInteger
private AtomicInteger
private AtomicLong
private AtomicLong
private AtomicInteger
private AtomicLong
private AtomicInteger
private AtomicLong
private final org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription
private final TableName
-
Constructor Summary
ConstructorDescriptionSnapshotStats
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotDescription snapshot) SnapshotStats
(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot) -
Method Summary
Modifier and TypeMethodDescription(package private) SnapshotInfo.SnapshotStats.FileInfo
addLogFile
(String server, String logfile) Add the specified log file to the stats(package private) SnapshotInfo.SnapshotStats.FileInfo
addStoreFile
(RegionInfo region, String family, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotRegionManifest.StoreFile storeFile, Map<org.apache.hadoop.fs.Path, Integer> filesMap) Add the specified store file to the statsint
Returns the number of available store files in the archivelong
Returns the total size of the store files in the archiveint
Returns the number of corrupted store filesint
Returns the number of available log fileslong
Returns the total log sizeint
Returns the number of missing log filesint
Returns the number of missing store filesfloat
Returns the percentage of the mob store filesint
Returns the number of available store files in the mob dirlong
Returns the total size of the store files in the mob storelong
float
Returns the percentage of the shared store fileslong
Returns the total size of the store files sharedReturns the snapshot descriptorint
Returns the number of available store fileslong
Returns the total size of the store files referenced by the snapshotprivate boolean
isArchivedFileStillReferenced
(org.apache.hadoop.fs.Path filePath, Map<org.apache.hadoop.fs.Path, Integer> snapshotFilesMap) Check if for a give file in archive, if there are other snapshots/tables still reference it.boolean
Returns true if the snapshot is corrupted
-
Field Details
-
hfilesArchiveCount
-
hfilesCorrupted
-
hfilesMissing
-
hfilesCount
-
hfilesMobCount
-
logsMissing
-
logsCount
-
hfilesArchiveSize
-
hfilesSize
-
hfilesMobSize
-
logSize
-
snapshot
private final org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot -
snapshotTable
-
conf
-
fs
-
-
Constructor Details
-
SnapshotStats
SnapshotStats(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, SnapshotDescription snapshot) -
SnapshotStats
SnapshotStats(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription snapshot)
-
-
Method Details
-
getSnapshotDescription
Returns the snapshot descriptor -
isSnapshotCorrupted
Returns true if the snapshot is corrupted -
getStoreFilesCount
Returns the number of available store files -
getArchivedStoreFilesCount
Returns the number of available store files in the archive -
getMobStoreFilesCount
Returns the number of available store files in the mob dir -
getLogsCount
Returns the number of available log files -
getMissingStoreFilesCount
Returns the number of missing store files -
getCorruptedStoreFilesCount
Returns the number of corrupted store files -
getMissingLogsCount
Returns the number of missing log files -
getStoreFilesSize
Returns the total size of the store files referenced by the snapshot -
getArchivedStoreFileSize
Returns the total size of the store files in the archive -
getMobStoreFilesSize
Returns the total size of the store files in the mob store -
getMobStoreFilePercentage
Returns the percentage of the mob store files -
getLogsSize
Returns the total log size -
isArchivedFileStillReferenced
private boolean isArchivedFileStillReferenced(org.apache.hadoop.fs.Path filePath, Map<org.apache.hadoop.fs.Path, Integer> snapshotFilesMap) Check if for a give file in archive, if there are other snapshots/tables still reference it.- Parameters:
filePath
- file path in archivesnapshotFilesMap
- a map for store files in snapshots about how many snapshots refer to it.- Returns:
- true or false
-
addStoreFile
SnapshotInfo.SnapshotStats.FileInfo addStoreFile(RegionInfo region, String family, org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotRegionManifest.StoreFile storeFile, Map<org.apache.hadoop.fs.Path, Integer> filesMap) throws IOExceptionAdd the specified store file to the stats- Parameters:
region
- region encoded Namefamily
- family namestoreFile
- store file namefilesMap
- store files map for all snapshots, it may be null- Returns:
- the store file information
- Throws:
IOException
-
addLogFile
Add the specified log file to the stats- Parameters:
server
- server namelogfile
- log file name- Returns:
- the log information
- Throws:
IOException
-