hbase(main)::> create 'test_table_region', 'username'
row(s) in 1.2150 seconds hbase(main)::> put 'test_table_region', '', 'username:nick' ,''
row(s) in 0.0050 seconds hbase(main)::> scan 'test_table_region'
ROW COLUMN+CELL
column=username:nick, timestamp=, value=
row(s) in 0.1370 seconds hbase(main)::> describe 'test_table_region'
DESCRIPTION ENABLED
{NAME => 'test_table_region', FAMILIES => [{NAME => 'username', DATA_BLOCK_ENCODING true
=> 'NONE', BLOOMFILTER => 'NONE', REPLICATION_SCOPE => '', VERSIONS => '', COMPRES
SION => 'NONE', MIN_VERSIONS => '', TTL => '', KEEP_DELETED_CELLS => 'fal
se', BLOCKSIZE => '', IN_MEMORY => 'false', ENCODE_ON_DISK => 'true', BLOCKCACH
E => 'true'}]}
row(s) in 0.4040 seconds hbase(main)::> disable 'test_table_region'
row(s) in 3.1710 seconds hbase(main)::> alter 'test_table_region', {METHOD => 'table_att', SPLIT_POLICY => 'org.apache.hadoop.hbase.regionserver.ConstantSizeRegionSplitPolicy', MAX_FILESIZE => ''}
Updating all regions with the new schema...
/ regions updated.
Done.
row(s) in 4.5130 seconds hbase(main)::> enable 'test_table_region'
row(s) in 6.0330 seconds hbase(main)::> describe 'test_table_region'
DESCRIPTION ENABLED
{NAME => 'test_table_region', SPLIT_POLICY => 'org.apache.hadoop.hbase.regionserver. true
ConstantSizeRegionSplitPolicy', MAX_FILESIZE => '', FAMILIES => [{NAME =>
'username', DATA_BLOCK_ENCODING => 'NONE', BLOOMFILTER => 'NONE', REPLICATION_SCOPE
=> '', COMPRESSION => 'NONE', VERSIONS => '', TTL => '', MIN_VERSIONS =>
'', KEEP_DELETED_CELLS => 'false', BLOCKSIZE => '', ENCODE_ON_DISK => 'true',
IN_MEMORY => 'false', BLOCKCACHE => 'true'}]}
row(s) in 0.4610 seconds

the alter split_policy does not work for hbase before version 0.94

we need to use java code to change the split policy of an existing table

 protected void changeSplitPolicy(String tableName, Configuration conf) throws IOException, IllegalAccessException, InstantiationException {
HBaseAdmin admin = new HBaseAdmin(conf);
HTable hTable = new HTable(conf, tableName);
HTableDescriptor htd = hTable.getTableDescriptor();
HTableDescriptor tableDesc = new HTableDescriptor(htd); tableDesc.setValue(HTableDescriptor.SPLIT_POLICY, ConstantSizeRegionSplitPolicy.class.getName());
tableDesc.setValue(HTableDescriptor.MAX_FILESIZE, "5000000000"); if(admin.isTableEnabled(tableName)) {
admin.disableTable(tableName);
}
admin.modifyTable(Bytes.toBytes(tableName), tableDesc);
hTable.close();
admin.close();
System.out.println("change split policy over");
}

HBase change split policy on an existing table的更多相关文章

  1. [XAF] How to use the Allow/Deny permissions policy in the existing project

    https://www.devexpress.com/Support/Center/Question/Details/T418166 Clear [C#] using DevExpress.Persi ...

  2. 利用ClouderaManager启动HBase时,出现 master.TableNamespaceManager: Namespace table not found. Creating...

    1.错误描述: 出现上述这个错误的原因是我之前已经安装了Cloudera Manager中的CDH,其中添加了所有的服务,当然也包含HBase.然后重新安装的时候,就会出现如下错误: Failed t ...

  3. [HBase]region split流程

    1. 简介 HBase 的最小管理单位为region,region会按照region 分裂策略进行分裂. 基于CDH5.4.2 2. 总览

  4. Hbase实验:java创建和删除table

    开启zookeeper.hadoop.hbase: 打开eclipse创一个java project,然后导入所需jar包: 写好java代码,运行create,然后去hbase shell里查看: ...

  5. [Hive - LanguageManual] Alter Table/Partition/Column

    Alter Table/Partition/Column Alter Table Rename Table Alter Table Properties Alter Table Comment Add ...

  6. hive和hbase本质区别——hbase本质是OLTP的nosql DB,而hive是OLAP 底层是hdfs,需从已有数据库同步数据到hdfs;hive可以用hbase中的数据,通过hive表映射到hbase表

    对于hbase当前noSql数据库的一种,最常见的应用场景就是采集的网页数据的存储,由于是key-value型数据库,可以再扩展到各种key-value应用场景,如日志信息的存储,对于内容信息不需要完 ...

  7. Hbase split的三种方式和split的过程

    在Hbase中split是一个很重要的功能,Hbase是通过把数据分配到一定数量的region来达到负载均衡的.一个table会被分配到一个或多个region中,这些region会被分配到一个或者多个 ...

  8. HBase Split

    Region Split请求是在Region MemStore Flush之后被触发的: boolean shouldCompact = region.flushcache(); // We just ...

  9. How Region Split works in Hbase

    A region is decided to be split when store file size goes above hbase.hregion.max.filesize or accord ...

随机推荐

  1. CMS系统的实现图

  2. python3--函数(函数,全局变量和局部变量,递归函数)

    1.1函数 1.1.1什么是函数 函数就是程序实现模块化的基本单元,一般实现某一功能的集合.函数名:就相当于是程序代码集合的名称参数:就是函数运算时需要参与运算的值被称作为参数函数体:程序的某个功能, ...

  3. 深度分析mysql GROUP BY 与 ORDER BY

    鉴于项目的需要,就从网上找到该文章,文章分析得很详细也很易懂,在android里,(不知道是不是现在水平的限制,总之我还没找到在用ContentProvider时可以使用子查询),主要方法是用SQLi ...

  4. WebPack常用功能介绍

    概述 Webpack是一款用户打包前端模块的工具.主要是用来打包在浏览器端使用的javascript的.同时也能转换.捆绑.打包其他的静态资源,包括css.image.font file.templa ...

  5. linux下的apache配置文件详解

    .Apache的配置由httpd.conf文件配置,因此下面的配置指令都是在httpd.conf文件中修改. 站点的配置(基本配置) (1) 基本配置: ServerRoot "/mnt/s ...

  6. [NHibernate]HQL查询

    目录 写在前面 文档与系列文章 查询的几种方式 HQL查询 一个例子 总结 写在前面 上篇文章介绍了nhibernate在项目中的基本配置,包括数据库连接字符串的设置,映射文件的配置及需注意的地方,这 ...

  7. STM32F103之DMA

    一.背景: 需要使用STM32的DAC,例程代码中用了DMA,对DMA之前没有实际操作过,也很早就想知道DMA到底是什么,因此,看了一下午手册,代码和网上的资料,便有了此篇文章,做个记录. 二.正文: ...

  8. Linux C 字符函数 getchar()、putchar() 与 EOF 详解

    首先给出<The_C_Programming_Language>这本书中的例子: #include <stdio.h> int main() { int c; c = getc ...

  9. mysql查询语句select-子查询

    1 子查询定义 在一个表表达中可以调用另一个表表达式,这个被调用的表表达式叫做子查询(subquery),我么也称作子选择(subselect)或内嵌选择(inner select).子查询的结果传递 ...

  10. HeapSort 堆排序 基于伪代码实现

    此文原创, http://www.cnblogs.com/baokang/p/4735431.html ,禁止转载 GIF 动态图 伪代码 /* From Wikipedia, the free en ...