@Override public void close() throws IOException { writeBatch.close(); writeOptions.close(); }
public void close() { if (db != null) { writeOptions.close(); writeOptions = null; db.close(); db = null; deleteDB(); dbDir = null; } }
@Override public void close() { if (this.closed.compareAndSet(false, true)) { RocksDB db = this.database.get(); if (db != null) { db.close(); this.database.set(null); } if (this.writeOptions != null) { this.writeOptions.close(); } if (this.databaseOptions != null) { this.databaseOptions.close(); } clear(false); log.info("{}: Closed.", this.logId); Consumer<String> callback = this.closeCallback; if (callback != null) { Callbacks.invokeSafely(callback, this.id, null); } } }
public void close() { readOptions.close(); writeOptions.close(); column.close(); bloomFilter.close(); colFamilyOptions.close(); db = null; }
public void close() { readOptions.close(); writeOptions.close(); column.close(); colFamilyOptions.close(); bloomFilter.close(); db = null; }
@Override public void flush() { try { for(Map.Entry<ByteArray, Map<ByteArray, byte[]>> entry: dataBatches.entrySet()) { WriteBatch writeBatch = new WriteBatch(); WriteOptions writeOptions = new WriteOptions().setDisableWAL(true); for(Map.Entry<ByteArray, byte[]> batchEntry: entry.getValue().entrySet()) { writeBatch.put( cfHandles.get(entry.getKey()), batchEntry.getKey().getBytes(), batchEntry.getValue() ); } rocksDB.write(writeOptions, writeBatch); writeBatch.close(); writeOptions.close(); entry.getValue().clear(); } FlushOptions fOptions = new FlushOptions().setWaitForFlush(true); rocksDB.flush(fOptions); fOptions.close(); } catch(RocksDBException ex) { throw new RuntimeException(ex); } }
@Override public void flush(String keySpace) { Preconditions.checkNotNull(keySpace); ByteArray byteArray = new ByteArray(keySpace); try { WriteBatch writeBatch = new WriteBatch(); WriteOptions writeOptions = new WriteOptions().setDisableWAL(true); for(Map.Entry<ByteArray, byte[]> entry: dataBatches.get(byteArray).entrySet()) { writeBatch.put( cfHandles.get(byteArray), entry.getKey().getBytes(), entry.getValue() ); } rocksDB.write(writeOptions, writeBatch); writeBatch.close(); writeOptions.close(); dataBatches.get(byteArray).clear(); FlushOptions fOptions = new FlushOptions().setWaitForFlush(true); rocksDB.flush(new FlushOptions(), cfHandles.get(byteArray)); fOptions.close(); } catch(RocksDBException ex) { throw new RuntimeException(ex); } }
@Override public synchronized void close() { if (!open) { return; } open = false; closeOpenIterators(); options.close(); wOptions.close(); fOptions.close(); db.close(); options = null; wOptions = null; fOptions = null; db = null; }