private static void runTest( Connector conn, int numlg, ArrayList<byte[]> cfset, Map<String, Stat> stats) throws Exception { String table = "immlgb"; try { conn.tableOperations().delete(table); } catch (TableNotFoundException tnfe) { } conn.tableOperations().create(table); conn.tableOperations() .setProperty(table, Property.TABLE_FILE_COMPRESSION_TYPE.getKey(), "snappy"); setupLocalityGroups(conn, numlg, cfset, table); addStat(stats, "write", write(conn, cfset, table)); addStat(stats, "scan cf", scan(conn, cfset, table, false)); addStat(stats, "scan cf:cq", scan(conn, cfset, table, true)); // TODO time reading all data long t1 = System.currentTimeMillis(); conn.tableOperations().flush(table, null, null, true); long t2 = System.currentTimeMillis(); addStat(stats, "flush", t2 - t1); }
@Test public void interleaveSplit() throws Exception { Connector c = getConnector(); c.tableOperations().create("test_ingest"); c.tableOperations().setProperty("test_ingest", Property.TABLE_SPLIT_THRESHOLD.getKey(), "10K"); c.tableOperations() .setProperty("test_ingest", Property.TABLE_FILE_COMPRESSION_TYPE.getKey(), "none"); ReadWriteIT.interleaveTest(c); UtilWaitThread.sleep(5 * 1000); assertTrue(c.tableOperations().listSplits("test_ingest").size() > 20); }