2017-05-10 68 views
1

我使用HBase shell和通常的create table命令在Bigtable中創建表,您可以在其中指定壓縮顯然忽略壓縮屬性。如何使用HBase shell在Bigtable中設置表壓縮模式?

實施例:

hbase(main):003:0> create 'table_snappy', {NAME => 'event', VERSIONS => 1, COMPRESSION => 'SNAPPY', BLOOMFILTER => 'ROW'} 
hbase(main):004:0> describe 'table_snappy' 
Table table_snappy is ENABLED 
table_snappy 
COLUMN FAMILIES DESCRIPTION 
{NAME => 'event', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'} 
1 row(s) in 0.0870 seconds 

hbase(main):003:0> create 'table_lzo', {NAME => 'event', VERSIONS => 1, COMPRESSION => 'LZO', BLOOMFILTER => 'ROW'} 
hbase(main):004:0> describe 'table_lzo' 
Table table_lzo is ENABLED 
table_lzo 
COLUMN FAMILIES DESCRIPTION 
{NAME => 'event', BLOOMFILTER => 'ROW', VERSIONS => '1', IN_MEMORY => 'false', KEEP_DELETED_CELLS => 'FALSE', DATA_BLOCK_ENCODING => 'NONE', TTL => 'FOREVER', COMPRESSION => 'NONE', MIN_VERSIONS => '0', BLOCKCACHE => 'true', BLOCKSIZE => '65536', REPLICATION_SCOPE => '0'} 
1 row(s) in 0.0870 seconds 

回答

1

BigTable使用專有的壓縮算法,並且不暴露的壓縮方法或配置。所以當輸入被忽略時,壓縮就會發生,並自動爲您管理。

這在Bigtable differences from HBase進行了說明:

列族

當你創建一個列族,你不能配置塊大小或壓縮方法,無論是與HBase的殼或通過HBase的API 。 Cloud Bigtable爲您管理塊大小和壓縮。另外,如果您使用HBase shell獲取有關表的信息,HBase shell將始終報告每個列族不使用壓縮。實際上,Cloud Bigtable爲您的所有數據使用專有壓縮方法。