@Override public void close() throws IOException { options.close(); if (rocksDB != null) { rocksDB.close(); } } }
@Override public synchronized void close() { if (db != null) { db.close(); db = null; options.close(); options = null; } }
@Override public void close() throws IOException { options.close(); if (rocksDB != null) { rocksDB.close(); } } }
@Override public void close() { for(Map.Entry<ByteArray, ColumnFamilyHandle> entry: cfHandles.entrySet()) { entry.getValue().close(); } cfHandles.clear(); dataBatches.clear(); rocksDBOptions.close(); rocksDB.close(); }
public synchronized void closeAll() { clientCache.asMap().forEach((k, v) -> v.close()); clientCache.invalidateAll(); if (RocksDBClient.metadataOptions != null) { RocksDBClient.metadataOptions.close(); RocksDBClient.metadataOptions = null; } if (RocksDBClient.indexWriteOptions != null) { RocksDBClient.indexWriteOptions.close(); RocksDBClient.indexWriteOptions = null; } if (RocksDBClient.indexReadOptions != null) { RocksDBClient.indexReadOptions.close(); RocksDBClient.indexReadOptions = null; } } }
@Override public void delete() { close(); try { Options options = new Options(); RocksDB.destroyDB(uri.getPath(), options); options.close(); } catch(RocksDBException ex) { throw new RuntimeException(ex); } }
public synchronized void close(final String directory, final boolean visibilityEnabled) { final Pair<String, Boolean> key = Pair.of(directory, visibilityEnabled); final RocksDBClient client = clientCache.getIfPresent(key); if (client != null) { clientCache.invalidate(key); client.close(); } if (clientCache.estimatedSize() == 0) { if (RocksDBClient.metadataOptions != null) { RocksDBClient.metadataOptions.close(); RocksDBClient.metadataOptions = null; } if (RocksDBClient.indexWriteOptions != null) { RocksDBClient.indexWriteOptions.close(); RocksDBClient.indexWriteOptions = null; } if (RocksDBClient.indexReadOptions != null) { RocksDBClient.indexReadOptions.close(); RocksDBClient.indexReadOptions = null; } } }
@Override public void close() { try { this.db.close(); this.options.close(); } catch (Exception e) { throw new DbException(e); } }
static void close() { if (null != transientStateDB) { transientStateDB.close(); transientStateDB = null; } if (null != failedStateDB) { failedStateDB.close(); failedStateDB = null; } if (null != options) { options.close(); options = 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 run() { FlushOptions fo = new FlushOptions(); fo.setWaitForFlush(true); try { finalDB.flush(fo); } catch (RocksDBException e) { LOGGER.warn("RocksDB flush error", e); } finally { finalDB.close(); fo.close(); options.close(); } } });
@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; }