private static void initTableValues() throws Exception { ConnectionQueryServices services = driver.getConnectionQueryServices(getUrl(), TEST_PROPERTIES); HTableInterface hTable = services.getTable(SchemaUtil.getTableNameAsBytes(HBASE_NATIVE_SCHEMA_NAME, HBASE_NATIVE)); try { // Insert rows using standard HBase mechanism with standard HBase "types" List<Row> mutations = new ArrayList<Row>(); byte[] family = Bytes.toBytes("1"); byte[] uintCol = Bytes.toBytes("UINT_COL"); byte[] ulongCol = Bytes.toBytes("ULONG_COL"); byte[] key, bKey; Put put; key = ByteUtil.concat(Bytes.toBytes(10), Bytes.toBytes(100L), Bytes.toBytes("a")); put = new Put(key); put.add(family, uintCol, ts - 2, Bytes.toBytes(5)); put.add(family, ulongCol, ts - 2, Bytes.toBytes(50L)); mutations.add(put); put = new Put(key); put.add(family, uintCol, ts, Bytes.toBytes(10)); put.add(family, ulongCol, ts, Bytes.toBytes(100L)); mutations.add(put); bKey = key = ByteUtil.concat(Bytes.toBytes(20), Bytes.toBytes(200L), Bytes.toBytes("b")); put = new Put(key); put.add(family, uintCol, ts - 4, Bytes.toBytes(5000)); put.add(family, ulongCol, ts - 4, Bytes.toBytes(50000L)); mutations.add(put); @SuppressWarnings( "deprecation") // FIXME: Remove when unintentionally deprecated method is fixed // (HBASE-7870). // FIXME: the version of the Delete constructor without the lock args was introduced // in 0.94.4, thus if we try to use it here we can no longer use the 0.94.2 version // of the client. Delete del = new Delete(key, ts - 2, null); mutations.add(del); put = new Put(key); put.add(family, uintCol, ts, Bytes.toBytes(2000)); put.add(family, ulongCol, ts, Bytes.toBytes(20000L)); mutations.add(put); key = ByteUtil.concat(Bytes.toBytes(30), Bytes.toBytes(300L), Bytes.toBytes("c")); put = new Put(key); put.add(family, uintCol, ts, Bytes.toBytes(3000)); put.add(family, ulongCol, ts, Bytes.toBytes(30000L)); mutations.add(put); key = ByteUtil.concat(Bytes.toBytes(40), Bytes.toBytes(400L), Bytes.toBytes("d")); put = new Put(key); put.add(family, uintCol, ts, Bytes.toBytes(4000)); put.add(family, ulongCol, ts, Bytes.toBytes(40000L)); mutations.add(put); hTable.batch(mutations); Result r = hTable.get(new Get(bKey)); assertFalse(r.isEmpty()); } finally { hTable.close(); } // Create Phoenix table after HBase table was created through the native APIs // The timestamp of the table creation must be later than the timestamp of the data ensureTableCreated(getUrl(), HBASE_NATIVE, null, ts + 1); }