Search code examples
javahbasewal

How to turn off WAL in hbase 2.0.0 with java API?


I wonder if there is any way to disable WAL (write ahead log) operations when inserting new data to a hbase table with JAVA API?

Thank you for you help :)


Solution

  • In HBase 2.0.0

    To skip WAL at an individual update level (for a single Put or Delete):

    Put p = new Put(ROW_ID).addColumn(FAMILY, NAME, VALUE).setDurability(Durability.SKIP_WAL)
    

    To set this setting for the entire table (so you don't have to do it each time for each update):

    TableDescriptorBuilder tBuilder = TableDescriptorBuilder.newBuilder(TableName.valueOf(TABLE_ID));
    tBuilder.setDurability(Durability.SKIP_WAL);
    ... continue building the table
    

    Hope this helps