HBase創建表參數說明

HBase創建表參數


創建dimensoft namespace

> create_namespace 'dimensoft'

注:這裏的namespace類似與RDBMS中的數據庫的概念。

創建user表

> create 'dimensoft:user', 'info'

查看錶結構

> describe 'dimensoft:user'

在使用最簡單的建表語句後HBase會給一些參數設置默認值,這些參數都是針對的列族而言,如果一個表有多個列族則每個列族都會有一份如下的參數:

DESCRIPTION
 'dimensoft:user', //namespace:tableName
    {
        NAME => 'info', //列族

        DATA_BLOCK_ENCODING => 'NONE', //數據塊編碼方式設置
        //參見:http://hbase.apache.org/book.html#data.block.encoding.enable

        BLOOMFILT => 'ROW', //參見:http://hbase.apache.org/book.html#bloom.filters.when

        REPLICATION_SCOPE => '0', //配置HBase集羣replication時需要將該參數設置爲1.

        //參見:http://blog.cloudera.com/blog/2012/08/hbase-replication-operational-overview/?utm_source=tuicool
        'REPLICATION_SCOPE is a column-family level attribute 
user has to alter each column family with the alter command as 
shown above, for all the column families he wants to replicate.'

        VERSIONS => '1', //設置保存的版本數

        COMPRESSION => 'NONE', //設置壓縮算法

        MIN_VERSIONS => '0', //最小存儲版本數

        TTL => 'FOREVER', //參見:http://hbase.apache.org/book.html#ttl
        'ColumnFamilies can set a TTL length in seconds, and HBase 
reached. This applies to all versions of a row - even the current one. 
The TTL time encoded in the HBase for the row is specified in 
UTC.'

        KEEP_DELETED_CELLS => 'false', //參見:http://hbase.apache.org/book.html#cf.keep.deleted

        BLOCKSIZE => '65536', //設置HFile數據塊大小(默認64kb)

        IN_MEMORY => 'false',//設置激進緩存,優先考慮將該列族放入塊緩存中,
                             //針對隨機讀操作相對較多的列族可以設置該屬性爲true

        BLOCKCACHE => 'true' //數據塊緩存屬性
    }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章