@Test public void testCustomRangeComparator() { final RangeTable<Integer, Integer, Integer> table = ezdb.getTable("test-custom-range-comparator", IntegerSerde.get, IntegerSerde.get, IntegerSerde.get, new LexicographicalComparator(), new Comparator<byte[]>() { @Override public int compare(final byte[] o1, final byte[] o2) { return -1 * ByteBuffer.wrap(o1).compareTo(ByteBuffer.wrap(o2)); } }); table.put(1, 1, 1); table.put(1, 2, 2); table.put(1, 3, 3); final TableIterator<Integer, Integer, Integer> it = table.range(1, 3); assertTrue(it.hasNext()); assertEquals(new RawTableRow<Integer, Integer, Integer>(1, 3, 3), it.next()); assertTrue(it.hasNext()); assertEquals(new RawTableRow<Integer, Integer, Integer>(1, 2, 2), it.next()); assertTrue(it.hasNext()); assertEquals(new RawTableRow<Integer, Integer, Integer>(1, 1, 1), it.next()); assertTrue(!it.hasNext()); it.close(); table.close(); }
@Override public <H, V> Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde) { return getTable(tableName, hashKeySerde, ByteSerde.get, valueSerde); }
EzRocksDb implements Db<byte[]> { @Override public <H, V> Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde) { return getTable(tableName, hashKeySerde, ByteSerde.get, valueSerde); } }
EzRocksDb implements Db<byte[]> { @Override public <H, V> Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde) { return getTable(tableName, hashKeySerde, ByteSerde.get, valueSerde); } EzRocksDb(File root);  EzRocksDb(File root, EzRocksDbFactory factory); }
EzRocksDb implements Db<byte[]> { @Override public <H, V> Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde) { return getTable(tableName, hashKeySerde, ByteSerde.get, valueSerde); } EzRocksDb(File root);  EzRocksDb(File root, EzRocksDbFactory factory); @Override void deleteTable(String tableName); @Override Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde); @Override RangeTable<H, R, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<R> rangeKeySerde, Serde<V> valueSerde); @SuppressWarnings("unchecked") @Override RangeTable<H, R, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<R> rangeKeySerde, Serde<V> valueSerde, Comparator<byte[]> hashKeyComparator, Comparator<byte[]> rangeKeyComparator); }
EzRocksDb implements Db<byte[]> { @Override public <H, V> Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde) { return getTable(tableName, hashKeySerde, ByteSerde.get, valueSerde); } EzRocksDb(File root);  EzRocksDb(File root, EzRocksDbFactory factory); @Override void deleteTable(String tableName); @Override Table<H, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<V> valueSerde); @Override RangeTable<H, R, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<R> rangeKeySerde, Serde<V> valueSerde); @SuppressWarnings("unchecked") @Override RangeTable<H, R, V> getTable(String tableName, Serde<H> hashKeySerde, Serde<R> rangeKeySerde, Serde<V> valueSerde, Comparator<byte[]> hashKeyComparator, Comparator<byte[]> rangeKeyComparator);  }