Skip to content
Snippets Groups Projects
Commit 7797108a authored by Shun Takebayashi's avatar Shun Takebayashi
Browse files

Add autoflush option to HBaseClient

parent 96eaa580
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB
public HTable _hTable=null;
public String _columnFamily="";
public byte _columnFamilyBytes[];
public boolean _autoflush = false;
public static final int Ok=0;
public static final int ServerError=-1;
......@@ -81,6 +82,11 @@ public class HBaseClient extends com.yahoo.ycsb.DB
_debug=true;
}
if (getProperties().containsKey("autoflush"))
{
_autoflush = Boolean.parseBoolean(getProperties().getProperty("autoflush"));
}
_columnFamily = getProperties().getProperty("columnfamily");
if (_columnFamily == null)
{
......@@ -117,7 +123,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB
synchronized (tableLock) {
_hTable = new HTable(config, table);
//2 suggestions from http://ryantwopointoh.blogspot.com/2009/01/performance-of-hbase-importing.html
_hTable.setAutoFlush(false, true);
_hTable.setAutoFlush(_autoflush, true);
_hTable.setWriteBufferSize(1024*1024*12);
//return hTable;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment