asMap method
To be used starting with journaled engines (Only Wired Tiger, Journal Only) For inMemoryEngine the J option is ignored
We can use before 4.2 testing if the journal is active (in this case fsync doesn't make any sense, taken from mongodb Jira: "fsync means sync using a journal if present otherwise the datafiles") In 4.0 journal cannot be disabled on wiredTiger engine In 4.2 only wiredTiger can be used
Implementation
Map<String, Object> asMap(ServerStatus serverStatus) {
var ret = <String, Object>{};
if (w != null) {
ret[keyW] = w;
}
if (wtimeout != null) {
ret[keyWtimeout] = wtimeout!;
}
if (serverStatus.isPersistent) {
if (j) {
ret[keyJ] = j;
}
if (!j) {
if (serverStatus.isJournaled) {
ret[keyJ] = fsync;
} else {
ret[keyFsync] = fsync;
}
}
}
return ret;
}