You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Gen Liu <ge...@zynga.com> on 2012/08/09 02:19:41 UTC

setAutoFlush(false) in Thrift

Hi,

Hbase thrift doesn't expose setAutoFlush interface. I ran thrift out of the Hbase cluster. I want to have a client side write buffering on the Thrift server.
So I change the ThriftServer.java, and add a setAutoFlush(false) as follows:

if (!tables.containsKey(table)) {
  boolean autoFlush = conf.getBoolean("hbase.client.autoflush", true);
  HTable htable = new HTable(conf, tableName);
  htable.setAutoFlush(autoFlush);
  LOG.debug("Thrift setAutoFlush:"+autoFlush);
  tables.put(table, htable);
}

The write buffer actually works when I call mutateRow(in PHP) with small data (less than 500 bytes), write latency is only 1 ms. (php and thrift are in the same machine)
But when I use larger payload (2KB and more), the mutateRow takes constant 40 ms to finish no matter how large is the write buffer size and no matter how large is the payload.

Any thoughts?  Or is there a another way for client size write buffering through Thrift.

Thanks!

Gen