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
Nested ClassesModifier and TypeClassDescription(package private) static classInformation about the file referenced by the snapshot -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hadoop.conf.Configurationprivate final org.apache.hadoop.fs.FileSystemprivate AtomicIntegerprivate AtomicLongprivate AtomicIntegerprivate AtomicIntegerprivate AtomicIntegerprivate AtomicIntegerprivate AtomicLongprivate AtomicLongprivate AtomicIntegerprivate AtomicLongprivate AtomicIntegerprivate AtomicLongprivate final org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescriptionprivate final TableName -
Constructor Summary
ConstructorsConstructorDescriptionSnapshotStats(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.FileInfoaddLogFile(String server, String logfile) Add the specified log file to the stats(package private) SnapshotInfo.SnapshotStats.FileInfoaddStoreFile(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 statsintReturns the number of available store files in the archivelongReturns the total size of the store files in the archiveintReturns the number of corrupted store filesintReturns the number of available log fileslongReturns the total log sizeintReturns the number of missing log filesintReturns the number of missing store filesfloatReturns the percentage of the mob store filesintReturns the number of available store files in the mob dirlongReturns the total size of the store files in the mob storelongfloatReturns the percentage of the shared store fileslongReturns the total size of the store files sharedReturns the snapshot descriptorintReturns the number of available store fileslongReturns the total size of the store files referenced by the snapshotprivate booleanisArchivedFileStillReferenced(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.booleanReturns 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
-