botaoli

Hbase创建表操作及参数说明

1、创建命名空间

  create_namespace \'test\'

2、创建user表,列族:info

  create \'test:user\', \'info\'

3、查看表结构

  describe \'test:user\'

表结构

Table test:user is ENABLED 
test:user 
COLUMN FAMILIES DESCRIPTION 
{NAME => \'info\', BLOOMFILTER => \'ROW\', VERSIONS => \'1\', IN_MEMORY => \'false\', KEEP_DELETED_CELLS => \'F
ALSE\', DATA_BLOCK_ENCODING => \'NONE\', TTL => \'FOREVER\', COMPRESSION => \'NONE\', MIN_VERSIONS => \'0\', BL
OCKCACHE => \'true\', BLOCKSIZE => \'65536\', REPLICATION_SCOPE => \'0\'} 

表结构参数详情

 1 DESCRIPTION
 2 \'test:user\', //namespace:tableName
 3 {
 4   NAME => \'info\',        //列族
 5   BLOOMFILTER => \'ROW\',  //参见:http://hbase.apache.org/book.html#bloom.filters.when
 6   VERSIONS => \'1\',       //设置保存的版本数
 7   IN_MEMORY => \'false\',  //设置激进缓存,优先考虑将该列族放入块缓存中,
 8                  //针对随机读操作相对较多的列族可以设置该属性为true
 9   KEEP_DELETED_CELLS => \'false\', //参见:http://hbase.apache.org/book.html#cf.keep.deleted
10   DATA_BLOCK_ENCODING => \'NONE\', //数据块编码方式设置
11                      //参见:http://hbase.apache.org/book.html#data.block.encoding.enable
12   TTL => \'FOREVER\', //参见:http://hbase.apache.org/book.html#ttl
13              \'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.\'
14   COMPRESSION => \'NONE\', //设置压缩算法 15   MIN_VERSIONS => \'0\', //最小存储版本数 16   BLOCKSIZE => \'65536\', //设置HFile数据块大小(默认64kb) 17   REPLICATION_SCOPE => \'0\', //配置HBase集群replication时需要将该参数设置为1. 18                   //参见:http://blog.cloudera.com/blog/2012/08/hbase-replication-operational-overview/?utm_source=tuicool 19                   \'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.\'
20   OCKCACHE => \'true\' //数据块缓存属性 21 }

 

分类:

技术点:

相关文章: