Example #1
0
    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();
    }
Example #2
0
 private void add(byte[] key, byte[] value) throws IOException {
   db.put(key, value);
 }
Example #3
0
 public byte[] get(byte[] key) throws IOException {
   return db.get(key);
 }