Client-side Write Buffer 使用table.setAutoFlush(false)
2013-09-22 13:53
148 查看
p152 Hbase权威指南
The HBase API comes with a built in client-side write buffer that
collects put operations so that they are sent in one RPC call to the
server(s). The global switch to control if it is used or not is
represented by the following methods:
void setAutoFlush(boolean autoFlush)
boolean isAutoFlush()
By default the client-side buffer is not enabled. You activate the buffer
by setting auto flush to false, by invoking:
table.setAutoFlush(false)
This will enable the client-side buffering mechanism and you can
check the state of the flag respectively with the isAutoFlush()
method. It will return true when you initially create the HTable
instance. Otherwise it will obviously return the current state as set by
your code.
Once you have activated the buffer you can store data into HBase as
shown in the the section called “Single Puts” above. You do not cause
any RPCs to occur though, because the Put instances you stored are
kept in memory in your client process. When you want to force the
data to be written you can call another API function:
void flushCommits() throws IOException
The HBase API comes with a built in client-side write buffer that
collects put operations so that they are sent in one RPC call to the
server(s). The global switch to control if it is used or not is
represented by the following methods:
void setAutoFlush(boolean autoFlush)
boolean isAutoFlush()
By default the client-side buffer is not enabled. You activate the buffer
by setting auto flush to false, by invoking:
table.setAutoFlush(false)
This will enable the client-side buffering mechanism and you can
check the state of the flag respectively with the isAutoFlush()
method. It will return true when you initially create the HTable
instance. Otherwise it will obviously return the current state as set by
your code.
Once you have activated the buffer you can store data into HBase as
shown in the the section called “Single Puts” above. You do not cause
any RPCs to occur though, because the Put instances you stored are
kept in memory in your client process. When you want to force the
data to be written you can call another API function:
void flushCommits() throws IOException
相关文章推荐
- 由于没有正确使用Connection.setAutoCommit(false)而导致SQL语句没有被提交
- 【数据库】使用Collection.setAutoCommit(false)的注意事项
- SET AUTOT ON无法使用解决方法,以及PLAN_TABLE的使用
- conn.setAutoCommit(false);
- innodb double write buffer--buf_dblwr_add_to_batch调用write、fsync的函数buf_dblwr_flush_buffered_writes
- 【pandas使用遇到的问题】 have mixed types. Specify dtype option on import or set low_memory=False.
- set Autotrace的使用
- Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or rem
- 使用@AutoWired替换struts2 Action中的get、set方法
- Java Connection.setAutoCommit使用的注意事项
- Connection.setAutoCommit使用的注意事项
- Client-side table sorting for flexigrid
- Connection.setAutoCommit使用的注意事项
- node.js中的buffer.write方法使用说明
- 使用Spring提供的Open Session In View而引起Write operations are not allowed in read-only mode (FlushMode.NEVER) 错误解决
- 在atlas(ajax)中请不要使用Response.Write,请使用ClientScript.RegisterClientScriptBlock替换
- Connection.setAutoCommit使用的注意事项
- 在sqlplus中set autotrace on 出错的解决办法( Unable to verify PLAN_TABLE)
- asp.net 需知:RegisterStartupScript、RegisterClientScriptBlock、Response.Write 使用区别
- 在atlas(ajax)中请不要使用Response.Write,请使用ClientScript.RegisterClientScriptBlock替换