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

Reply via email to