RocksDBLookupTable implements ILookupTable { @Override public String[] getRow(Array<String> key) { byte[] encodeKey = rowEncoder.encodeStringsWithLenPfx(key.data, false); try { byte[] value = rocksDB.get(encodeKey); if (value == null) { return null; } return rowEncoder.decode(new KV(encodeKey, value)); } catch (RocksDBException e) { throw new IllegalStateException("error when get key from rocksdb", e); } } RocksDBLookupTable(TableDesc tableDesc, String[] keyColumns, String dbPath); @Override String[] getRow(Array<String> key); @Override Iterator<String[]> iterator(); @Override void close();  }
@Test public void testGet() throws Exception { int getNum = 3000; List<String[]> keys = Lists.newArrayList(); for (int i = 0; i < getNum; i++) { String[] keyi = new String[] { "keyyyyy" + random.nextInt(sourceRowNum) }; keys.add(keyi); } long start = System.currentTimeMillis(); for (int i = 0; i < getNum; i++) { String[] row = lookupTable.getRow(new Array<>(keys.get(i))); if (row == null) { System.out.println("null value for key:" + Arrays.toString(keys.get(i))); } } long take = System.currentTimeMillis() - start; System.out.println("muliti get " + getNum + " rows, take " + take + " ms"); }