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. C#对文件/目录的操作:Path、File、Directory、FileStream、StreamReader、StreamWriter等类的浅析

    以下类的命名空间都是:System.I/0; 一.Path:主要对文件路径的操作! 常用方法: String path=@"C:\a\b\c\123.txt"; 1-1.Path. ...

  2. rabbitmq python

    import pika connection = pika.BlockingConnection(pika.ConnectionParameters( 'localhost',9672)) chann ...

  3. CFBundleVersion与CFBundleShortVersionString,上架注意事项

    CFBundleVersion,标识(发布或未发布)的内部版本号.这是一个单调增加的字符串,包括一个或多个时期分隔的整数. CFBundleShortVersionString  标识应用程序的发布版 ...

  4. ARCGIS常用几种本地数据AE初始化

    1.Personal GDB 新建一个在E盘的名为test的mdb: IWorkspaceFactory workspaceFactory = new AccessWorkspaceFactoryCl ...

  5. Join Attributes

    1. IWorkspaceFactory2 workspaceFactory = new ShapefileWorkspaceFactoryClass() as IWorkspaceFactory2; ...

  6. Gravatar注册

    今天在学习falsk时需要用到头像扩展,需要使用gravatar到网上查了查好像没有被墙,就试着用qq邮箱注册了一个账号,结果等了好长时间也没有等到激活邮箱,就百度了一下发现了一个技巧,原来这封邮件被 ...

  7. [Nhibernate]二级缓存(一)

    目录 写在前面 文档与系列文章 二级缓存 Nhibernate二级缓存提供程序 一个例子 总结 写在前面 上篇文章介绍了nhibernate中一级缓存的相关内容,一级缓存过期时间和ISession对象 ...

  8. 100多个基础常用JS函数和语法集合大全

    网站特效离不开脚本,javascript是最常用的脚本语言,我们归纳一下常用的基础函数和语法: 1.输出语句:document.write(""); 2.JS中的注释为//3.传统 ...

  9. ASP.NET学习链接

    张子阳个人ASP.NET技术博客:http://www.tracefact.net/Asp-Net/ 动态加载asp.net分页控件:http://www.cnblogs.com/cresuccess ...

  10. ZOJ 3699 Dakar Rally

    Dakar Rally Time Limit: 2 Seconds      Memory Limit: 65536 KB Description The Dakar Rally is an annu ...