本文整理了Java中org.rocksdb.Options.close()
方法的一些代码示例,展示了Options.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Options.close()
方法的具体详情如下:
包路径:org.rocksdb.Options
类名称:Options
方法名:close
暂无
代码示例来源:origin: apache/kylin
@Override
public void close() throws IOException {
options.close();
if (rocksDB != null) {
rocksDB.close();
}
}
}
代码示例来源:origin: ViDA-NYU/ache
@Override
public synchronized void close() {
if (db != null) {
db.close();
db = null;
options.close();
options = null;
}
}
代码示例来源:origin: org.apache.kylin/kylin-core-dictionary
@Override
public void close() throws IOException {
options.close();
if (rocksDB != null) {
rocksDB.close();
}
}
}
代码示例来源:origin: jwplayer/southpaw
@Override
public void close() {
for(Map.Entry<ByteArray, ColumnFamilyHandle> entry: cfHandles.entrySet()) {
entry.getValue().close();
}
cfHandles.clear();
dataBatches.clear();
rocksDBOptions.close();
rocksDB.close();
}
代码示例来源:origin: locationtech/geowave
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;
}
}
}
代码示例来源:origin: jwplayer/southpaw
@Override
public void delete() {
close();
try {
Options options = new Options();
RocksDB.destroyDB(uri.getPath(), options);
options.close();
} catch(RocksDBException ex) {
throw new RuntimeException(ex);
}
}
代码示例来源:origin: locationtech/geowave
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;
}
}
}
代码示例来源:origin: criccomini/ezdb
@Override
public void close() {
try {
this.db.close();
this.options.close();
} catch (Exception e) {
throw new DbException(e);
}
}
代码示例来源:origin: apsaltis/StreamingData-Book-Examples
static void close() {
if (null != transientStateDB) {
transientStateDB.close();
transientStateDB = null;
}
if (null != failedStateDB) {
failedStateDB.close();
failedStateDB = null;
}
if (null != options) {
options.close();
options = null;
}
}
代码示例来源:origin: pravega/pravega
@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);
}
}
}
代码示例来源:origin: actiontech/dble
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();
}
}
});
代码示例来源:origin: org.apache.kafka/kafka-streams
@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;
}
内容来源于网络,如有侵权,请联系作者删除!