[4] HBase Compact
Minor Compact:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Compact all regions in a table:
hbase> compact 'ns1:t1'
hbase> compact 't1'
Compact an entire region:
hbase> compact 'r1'
Compact only a column family within a region:
hbase> compact 'r1', 'c1'
Compact a column family within a table:
hbase> compact 't1', 'c1'
==================================================================>>>>>>
#examples:
#1 create pre-split table
hbase> create 'flush_test','info',{SPLITS=>['e','l','o','u']}
#2 check hfile
[root@rphf1hsn001 ~]# hadoop fs -ls /hbase/data/default/flush_test/*/info
#3 put some data.let it in
hbase> put 'flush_test','a','info:x','a'
hbase> flush 'flush_test'
hbase> put 'flush_test','b','info:x','b'
hbase> flush 'flush_test'
hbase> put 'flush_test','c','info:x','c'
hbase> flush 'flush_test'
[root@rphf1hsn001 ~]# hadoop fs -ls /hbase/data/default/flush_test/*/info
/hbase/data/default/flush_test/a23543cf1a44fb0bdd56e238fb58c91a/info/5e2b5d366ce549a8968f9019c29bec3d
/hbase/data/default/flush_test/a23543cf1a44fb0bdd56e238fb58c91a/info/6a309801d0a04d5a96357dc937e2dc8b
/hbase/data/default/flush_test/a23543cf1a44fb0bdd56e238fb58c91a/info/9123dbf079dc43be926dee87ae966359
hbase> compact 'a23543cf1a44fb0bdd56e238fb58c91a'
[root@rphf1hsn001 ~]# hadoop fs -ls /hbase/data/default/flush_test/*/info
/hbase/data/default/flush_test/a23543cf1a44fb0bdd56e238fb58c91a/info/c50d5d4ca0b04b86a9b5f6dd4d1f6150
Major Compact:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>