use of org.apache.hadoop.hbase.client.Durability in project phoenix by apache.
the class MutationTest method testDurability.
private void testDurability(boolean disableWAL) throws Exception {
Connection conn = DriverManager.getConnection(getUrl());
try {
Durability expectedDurability = disableWAL ? Durability.SKIP_WAL : Durability.USE_DEFAULT;
conn.setAutoCommit(false);
conn.createStatement().execute("CREATE TABLE t1 (k integer not null primary key, a.k varchar, b.k varchar) " + (disableWAL ? "DISABLE_WAL=true" : ""));
conn.createStatement().execute("UPSERT INTO t1 VALUES(1,'a','b')");
conn.createStatement().execute("DELETE FROM t1 WHERE k=2");
assertDurability(conn, expectedDurability);
conn.createStatement().execute("DELETE FROM t1 WHERE k=1");
assertDurability(conn, expectedDurability);
conn.createStatement().execute("DROP TABLE t1");
} finally {
conn.close();
}
}
Aggregations