Hbase批量插入优化记录

2016年5月11日10:08:29

hbase原本的put方式是一条一条的put,在客户端修改

AutoFlush
将HTable的setAutoFlush设为false,可以支持客户端批量更新。即当Put填满客户端flush缓存时,才发送到服务端。
默认是true。

例如:
HTable hTable = new HTable(conf, tableName);
hTable.setAutoFlush(false);

这样的效率会比AUTOFLUSH 设置为true提升300倍不止

 

posted on 2016-08-09 11:56  山高似水深  阅读(1477)  评论(0编辑  收藏  举报

购买方式 点击下面图标购买