public void close() throws IOException { if (!readOnly) { LOG.info("Compacting leveldb"); String stats = db.getProperty("leveldb.stats"); LOG.info(stats); ((JniDB) db).compactRange(null, null); LOG.info("Done compacting leveldb"); stats = db.getProperty("leveldb.stats"); LOG.info(stats); } db.close(); }
private void add(byte[] key, byte[] value) throws IOException { db.put(key, value); }
public byte[] get(byte[] key) throws IOException { return db.get(key); }