Information and debugging
You can use the SnapshotInfo
tool to
get information about a snapshot, including status, files, disk usage, and debugging
information.
Examples:
Use the -h
option to print usage instructions for the
SnapshotInfo
utility.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo -h Usage: hbase snapshot info [options] Options: --snapshot <arg> Snapshot to examine. --remote-dir <arg> Root directory that contains the snapshots. --list-snapshots List all the available snapshots and exit. --files Files and logs list. --stats Files and logs statistics. --schema Describe the snapshotted table. --size-in-bytes Print the size of the files in bytes.
For example,
hbase snapshot info --snapshot MySnapshot --files
Use the
--list-snapshots
option to list all
snapshots and exit.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo –-list-snapshots --snapshot foobar SNAPSHOT | CREATION TIME | TABLE NAME snapshot-test | 2014-06-24T19:02:54 | test
Use the
--remote-dir
option with the --list-snapshots
option to list snapshots
located on a remote system.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo --remote-dir s3a://mybucket/mysnapshot-dir --list-snapshots --snapshot foobar SNAPSHOT | CREATION TIME | TABLE NAME snapshot-test 2014-05-01 10:30 myTable
Use the
--snapshot
option to print information
about a specific snapshot.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo --snapshot test-snapshot Snapshot Info ---------------------------------------- Name: test-snapshot Type: DISABLED Table: test-table Version: 0 Created: 2012-12-30T11:21:21 **************************************************************
Use the
--snapshot
with the --stats
options to display additional
statistics about a snapshot.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo --stats --snapshot snapshot-test Snapshot Info ---------------------------------------- Name: snapshot-test Type: FLUSH Table: test Format: 0 Created: 2014-06-24T19:02:54 1 HFiles (0 in archive), total size 1.0k (100.00% 1.0k shared with the source table)
Use the
--schema
option with the --snapshot
option to display the schema of a
snapshot.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo --schema --snapshot snapshot-test Snapshot Info ---------------------------------------- Name: snapshot-test Type: FLUSH Table: test Format: 0 Created: 2014-06-24T19:02:54 Table Descriptor ---------------------------------------- 'test', {NAME => 'cf', DATA_BLOCK_ENCODING => 'FAST_DIFF', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '0', COMPRESSION => 'GZ', VERSIONS => '1', TTL => 'FOREVER', MIN_VERSIONS => '0', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '65536', IN_MEMORY => 'false', BLOCKCACHE => 'true'}
Use the
--files
option with the --snapshot
option to list information about
files contained in a snapshot.
$ hbase org.apache.hadoop.hbase.snapshot.SnapshotInfo --snapshot test-snapshot --files Snapshot Info ---------------------------------------- Name: test-snapshot Type: DISABLED Table: test-table Version: 0 Created: 2012-12-30T11:21:21 Snapshot Files ---------------------------------------- 52.4k test-table/02ba3a0f8964669520cf96bb4e314c60/cf/bdf29c39da2a4f2b81889eb4f7b18107 (archive) 52.4k test-table/02ba3a0f8964669520cf96bb4e314c60/cf/1e06029d0a2a4a709051b417aec88291 (archive) 86.8k test-table/02ba3a0f8964669520cf96bb4e314c60/cf/506f601e14dc4c74a058be5843b99577 (archive) 52.4k test-table/02ba3a0f8964669520cf96bb4e314c60/cf/5c7f6916ab724eacbcea218a713941c4 (archive) 293.4k test-table/02ba3a0f8964669520cf96bb4e314c60/cf/aec5e33a6564441d9bd423e31fc93abb (archive) 52.4k test-table/02ba3a0f8964669520cf96bb4e314c60/cf/97782b2fbf0743edaacd8fef06ba51e4 (archive) 6 HFiles (6 in archive), total size 589.7k (0.00% 0.0 shared with the source table) 0 Logs, total size 0.0