use of com.apple.foundationdb.NetworkOptions in project fdb-record-layer by FoundationDB.
the class RankedSetTest method setUp.
@BeforeEach
public void setUp() throws Exception {
FDB fdb = FDB.instance();
if (TRACE) {
NetworkOptions options = fdb.options();
options.setTraceEnable("/tmp");
options.setTraceLogGroup("RankedSetTest");
}
this.db = fdb.open();
this.rsSubspace = DirectoryLayer.getDefault().createOrOpen(db, PathUtil.from(getClass().getSimpleName())).get();
db.run(tr -> {
tr.clear(rsSubspace.range());
return null;
});
}
use of com.apple.foundationdb.NetworkOptions in project fdb-record-layer by FoundationDB.
the class FDBDatabaseFactoryImpl method initFDB.
protected synchronized FDB initFDB() {
if (!inited) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug(KeyValueLogMessage.of("Starting FDB"));
}
fdb = FDB.selectAPIVersion(API_VERSION);
fdb.setUnclosedWarning(unclosedWarning);
setStaticOptions(fdb);
NetworkOptions options = fdb.options();
if (!traceFormat.isDefaultValue()) {
options.setTraceFormat(traceFormat.getOptionValue());
}
if (traceDirectory != null) {
options.setTraceEnable(traceDirectory);
}
if (traceLogGroup != null) {
options.setTraceLogGroup(traceLogGroup);
}
if (runLoopProfilingEnabled) {
options.setEnableRunLoopProfiling();
}
if (networkExecutor == null) {
fdb.startNetwork();
} else {
fdb.startNetwork(networkExecutor);
}
inited = true;
}
return fdb;
}
Aggregations