@InterfaceAudience.Public @InterfaceStability.Evolving public final class SnapshotInfo extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.util.Tool
Modifier and Type | Class and Description |
---|---|
static class |
SnapshotInfo.SnapshotStats
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
|
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.fs.FileSystem |
fs |
private static org.apache.commons.logging.Log |
LOG |
private boolean |
printSizeInBytes |
private org.apache.hadoop.fs.Path |
rootDir |
private SnapshotManifest |
snapshotManifest |
Constructor and Description |
---|
SnapshotInfo() |
Modifier and Type | Method and Description |
---|---|
private String |
fileSizeToString(long size) |
static List<org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription> |
getSnapshotList(org.apache.hadoop.conf.Configuration conf)
Returns the list of available snapshots in the specified location
|
static SnapshotInfo.SnapshotStats |
getSnapshotStats(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot)
Returns the snapshot stats
|
(package private) static int |
innerMain(String[] args)
The guts of the
main(java.lang.String[]) method. |
private boolean |
loadSnapshotInfo(String snapshotName)
Load snapshot info and table descriptor for the specified snapshot
|
static void |
main(String[] args) |
private void |
printFiles(boolean showFiles,
boolean showStats)
Collect the hfiles and logs statistics of the snapshot and
dump the file list if requested and the collected information.
|
private void |
printInfo()
Dump the
HBaseProtos.SnapshotDescription |
private void |
printSchema()
Dump the
HTableDescriptor |
private void |
printUsageAndExit() |
int |
run(String[] args) |
private static final org.apache.commons.logging.Log LOG
private boolean printSizeInBytes
private org.apache.hadoop.fs.FileSystem fs
private org.apache.hadoop.fs.Path rootDir
private SnapshotManifest snapshotManifest
public int run(String[] args) throws IOException, InterruptedException
run
in interface org.apache.hadoop.util.Tool
IOException
InterruptedException
private boolean loadSnapshotInfo(String snapshotName) throws IOException
snapshotName
- name of the snapshot to loadIOException
private void printInfo()
HBaseProtos.SnapshotDescription
private void printSchema()
HTableDescriptor
private void printFiles(boolean showFiles, boolean showStats) throws IOException
IOException
private String fileSizeToString(long size)
private void printUsageAndExit()
public static SnapshotInfo.SnapshotStats getSnapshotStats(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription snapshot) throws IOException
conf
- the Configuration
to usesnapshot
- HBaseProtos.SnapshotDescription
to get stats fromIOException
public static List<org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription> getSnapshotList(org.apache.hadoop.conf.Configuration conf) throws IOException
conf
- the Configuration
to useIOException
static int innerMain(String[] args) throws Exception
main(java.lang.String[])
method.
Call this method to avoid the main(String[])
System.exit.args
- Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.