YCSB での HBase に対する設定
前回のエントリでちょっと気になったことがある。http://research.yahoo.com/Web_Information_Management/YCSBにおいて、HBaseに対するベンチマークをかけるときに、AutoFlushがonなのか、否か。
ちょっとYCSBを見てみると、HBaseClient.java L108に、以下のような関数がある。
public class HBaseClient extends com.yahoo.ycsb.DB { ... public void getHTable(String table) throws IOException { synchronized (tableLock) { _hTable = new HTable(config, table); //2 suggestions from http://ryantwopointoh.blogspot.com/2009/01/performance-of-hbase-importing.html _hTable.setAutoFlush(false); _hTable.setWriteBufferSize(1024*1024*12); //return hTable; } } ... }
多分、com.yahoo.ycsb.DBは、YCSBと他のデータベースをつなぐ為のインターフェースだろうといことで、定義元を探すと、DB.javaに、
/** * A layer for accessing a database to be benchmarked. Each thread in the client * will be given its own instance of whatever DB class is to be used in the test. * This class should be constructed using a no-argument constructor, so we can * load it dynamically. Any argument-based initialization should be * done by init(). ... */ public abstract class DB { ... }
とあるので、まああっているでしょう。ということで、YCSBでは、HBaseベンチマーク時に12MBのバッファを作成して、AutoFlushをオフにしていますね。