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