diff --git a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java b/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java index e710e643bfa2eb140698f4557fa5834b307df762..15c5088160711640771d12572f3e8bdc992e9daa 100644 --- a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java +++ b/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient.java @@ -61,6 +61,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB public String _columnFamily=""; public byte _columnFamilyBytes[]; public boolean _clientSideBuffering = false; + public long _writeBufferSize = 1024 * 1024 * 12; public static final int Ok=0; public static final int ServerError=-1; @@ -85,6 +86,10 @@ public class HBaseClient extends com.yahoo.ycsb.DB { _clientSideBuffering = Boolean.parseBoolean(getProperties().getProperty("clientbuffering")); } + if (getProperties().containsKey("writebuffersize")) + { + _writeBufferSize = Long.parseLong(getProperties().getProperty("writebuffersize")); + } _columnFamily = getProperties().getProperty("columnfamily"); if (_columnFamily == null) @@ -123,7 +128,7 @@ public class HBaseClient extends com.yahoo.ycsb.DB _hTable = new HTable(config, table); //2 suggestions from http://ryantwopointoh.blogspot.com/2009/01/performance-of-hbase-importing.html _hTable.setAutoFlush(!_clientSideBuffering, true); - _hTable.setWriteBufferSize(1024*1024*12); + _hTable.setWriteBufferSize(_writeBufferSize); //return hTable; } diff --git a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java b/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java index 5d5be920bd21da23685ed67dd5c8e9f8180d5f70..7adef892c698493557c09aaf58023c7296b248d6 100644 --- a/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java +++ b/hbase/src/main/java/com/yahoo/ycsb/db/HBaseClient10.java @@ -89,6 +89,7 @@ public class HBaseClient10 extends com.yahoo.ycsb.DB * insert/update/delete latencies, client side buffering should be disabled. */ public boolean _clientSideBuffering = false; + public long _writeBufferSize = 1024 * 1024 * 12; public static final int Ok=0; public static final int ServerError=-1; @@ -105,6 +106,9 @@ public class HBaseClient10 extends com.yahoo.ycsb.DB if ("true".equals(getProperties().getProperty("clientbuffering", "false"))) { this._clientSideBuffering = true; } + if (getProperties().containsKey("writebuffersize")) { + _writeBufferSize = Long.parseLong(getProperties().getProperty("writebuffersize")); + } if (getProperties().getProperty("durability") != null) { this._durability = Durability.valueOf(getProperties().getProperty("durability")); @@ -166,7 +170,7 @@ public class HBaseClient10 extends com.yahoo.ycsb.DB //suggestions from http://ryantwopointoh.blogspot.com/2009/01/performance-of-hbase-importing.html if (_clientSideBuffering) { final BufferedMutatorParams p = new BufferedMutatorParams(tableName); - p.writeBufferSize(1024*1024*12); + p.writeBufferSize(_writeBufferSize); this._bufferedMutator = this._connection.getBufferedMutator(p); } }