Search in sources :

Example 6 with Durability

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();
    }
}
Also used : Connection(java.sql.Connection) PhoenixConnection(org.apache.phoenix.jdbc.PhoenixConnection) Durability(org.apache.hadoop.hbase.client.Durability)

Aggregations

Durability (org.apache.hadoop.hbase.client.Durability)6 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)2 Cell (org.apache.hadoop.hbase.Cell)2 WALEdit (org.apache.hadoop.hbase.regionserver.wal.WALEdit)2 Pair (org.apache.hadoop.hbase.util.Pair)2 IOException (java.io.IOException)1 UncheckedIOException (java.io.UncheckedIOException)1 Connection (java.sql.Connection)1 AbstractList (java.util.AbstractList)1 List (java.util.List)1 Map (java.util.Map)1 NavigableMap (java.util.NavigableMap)1 TreeMap (java.util.TreeMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 ConcurrentSkipListMap (java.util.concurrent.ConcurrentSkipListMap)1 CellScanner (org.apache.hadoop.hbase.CellScanner)1 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)1