@nxtedition/rocksdb 13.1.2 → 13.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.cc
CHANGED
|
@@ -898,6 +898,7 @@ napi_status InitOptions(napi_env env, T& columnOptions, const U& options) {
|
|
|
898
898
|
}
|
|
899
899
|
|
|
900
900
|
NAPI_STATUS_RETURN(GetProperty(env, options, "optimizeFiltersForHits", columnOptions.optimize_filters_for_hits));
|
|
901
|
+
NAPI_STATUS_RETURN(GetProperty(env, options, "periodicCompactionSeconds", columnOptions.periodic_compaction_seconds));
|
|
901
902
|
|
|
902
903
|
rocksdb::BlockBasedTableOptions tableOptions;
|
|
903
904
|
tableOptions.decouple_partitioned_filters = true;
|
|
@@ -1066,42 +1067,37 @@ NAPI_METHOD(db_open) {
|
|
|
1066
1067
|
dbOptions.avoid_unnecessary_blocking_io = true;
|
|
1067
1068
|
NAPI_STATUS_THROWS(GetProperty(env, options, "avoidUnnecessaryBlockingIO", dbOptions.avoid_unnecessary_blocking_io));
|
|
1068
1069
|
|
|
1069
|
-
dbOptions.write_dbid_to_manifest = true;
|
|
1070
|
-
NAPI_STATUS_THROWS(GetProperty(env, options, "writeDbIdToManifest", dbOptions.write_dbid_to_manifest));
|
|
1071
|
-
|
|
1072
1070
|
dbOptions.create_missing_column_families = true;
|
|
1073
1071
|
NAPI_STATUS_THROWS(GetProperty(env, options, "createMissingColumnFamilies", dbOptions.create_missing_column_families));
|
|
1074
1072
|
|
|
1075
|
-
dbOptions.
|
|
1073
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "writeDbIdToManifest", dbOptions.write_dbid_to_manifest));
|
|
1074
|
+
|
|
1076
1075
|
NAPI_STATUS_THROWS(GetProperty(env, options, "failIfOptionsFileError", dbOptions.fail_if_options_file_error));
|
|
1077
1076
|
|
|
1078
|
-
dbOptions.advise_random_on_open = true;
|
|
1079
1077
|
NAPI_STATUS_THROWS(GetProperty(env, options, "adviseRandomOnOpen", dbOptions.advise_random_on_open));
|
|
1080
1078
|
|
|
1081
|
-
dbOptions.bytes_per_sync = 1024 * 1024;
|
|
1082
1079
|
NAPI_STATUS_THROWS(GetProperty(env, options, "bytesPerSync", dbOptions.bytes_per_sync));
|
|
1083
1080
|
|
|
1084
|
-
dbOptions.wal_bytes_per_sync = 1024 * 1024;
|
|
1085
1081
|
NAPI_STATUS_THROWS(GetProperty(env, options, "walBytesPerSync", dbOptions.wal_bytes_per_sync));
|
|
1086
1082
|
|
|
1087
|
-
dbOptions.strict_bytes_per_sync = true;
|
|
1088
1083
|
NAPI_STATUS_THROWS(GetProperty(env, options, "strictBytesPerSync", dbOptions.strict_bytes_per_sync));
|
|
1089
1084
|
|
|
1090
|
-
dbOptions.
|
|
1085
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "delayedWriteRate", dbOptions.delayed_write_rate));
|
|
1086
|
+
|
|
1091
1087
|
NAPI_STATUS_THROWS(GetProperty(env, options, "createIfMissing", dbOptions.create_if_missing));
|
|
1092
1088
|
|
|
1093
|
-
dbOptions.error_if_exists = false;
|
|
1094
1089
|
NAPI_STATUS_THROWS(GetProperty(env, options, "errorIfExists", dbOptions.error_if_exists));
|
|
1095
1090
|
|
|
1096
|
-
dbOptions.enable_pipelined_write = true;
|
|
1097
1091
|
NAPI_STATUS_THROWS(GetProperty(env, options, "pipelinedWrite", dbOptions.enable_pipelined_write));
|
|
1098
1092
|
|
|
1099
|
-
dbOptions.daily_offpeak_time_utc = "";
|
|
1100
1093
|
NAPI_STATUS_THROWS(GetProperty(env, options, "dailyOffpeakTime", dbOptions.daily_offpeak_time_utc));
|
|
1101
1094
|
|
|
1102
|
-
dbOptions.unordered_write = false;
|
|
1103
1095
|
NAPI_STATUS_THROWS(GetProperty(env, options, "unorderedWrite", dbOptions.unordered_write));
|
|
1104
1096
|
|
|
1097
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "allowMmapReads", dbOptions.allow_mmap_reads));
|
|
1098
|
+
|
|
1099
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "allowMmapWrites", dbOptions.allow_mmap_writes));
|
|
1100
|
+
|
|
1105
1101
|
// TODO (feat): dbOptions.listeners
|
|
1106
1102
|
|
|
1107
1103
|
std::string infoLogLevel;
|
|
@@ -1235,18 +1231,12 @@ NAPI_METHOD(db_get_many_sync) {
|
|
|
1235
1231
|
uint32_t count;
|
|
1236
1232
|
NAPI_STATUS_THROWS(napi_get_array_length(env, argv[1], &count));
|
|
1237
1233
|
|
|
1238
|
-
bool fillCache = true;
|
|
1239
|
-
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "fillCache", fillCache));
|
|
1240
|
-
|
|
1241
1234
|
rocksdb::ColumnFamilyHandle* column = database->db->DefaultColumnFamily();
|
|
1242
1235
|
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "column", column));
|
|
1243
1236
|
|
|
1244
1237
|
Encoding valueEncoding = Encoding::Buffer;
|
|
1245
1238
|
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "valueEncoding", valueEncoding));
|
|
1246
1239
|
|
|
1247
|
-
int32_t highWaterMarkBytes = std::numeric_limits<int32_t>::max();
|
|
1248
|
-
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "highWaterMarkBytes", highWaterMarkBytes));
|
|
1249
|
-
|
|
1250
1240
|
uint32_t timeout = 0;
|
|
1251
1241
|
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "timeout", timeout));
|
|
1252
1242
|
|
|
@@ -1267,14 +1257,22 @@ NAPI_METHOD(db_get_many_sync) {
|
|
|
1267
1257
|
}
|
|
1268
1258
|
|
|
1269
1259
|
rocksdb::ReadOptions readOptions;
|
|
1270
|
-
readOptions.fill_cache = fillCache;
|
|
1271
|
-
readOptions.async_io = true;
|
|
1272
|
-
readOptions.optimize_multiget_for_io = true;
|
|
1273
|
-
readOptions.value_size_soft_limit = highWaterMarkBytes;
|
|
1274
1260
|
readOptions.deadline = timeout
|
|
1275
1261
|
? std::chrono::microseconds(database->db->GetEnv()->NowMicros() + timeout * 1000)
|
|
1276
1262
|
: std::chrono::microseconds::zero();
|
|
1277
1263
|
|
|
1264
|
+
readOptions.fill_cache = false;
|
|
1265
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "fillCache", readOptions.fill_cache));
|
|
1266
|
+
|
|
1267
|
+
readOptions.async_io = true;
|
|
1268
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "asyncIO", readOptions.async_io));
|
|
1269
|
+
|
|
1270
|
+
readOptions.optimize_multiget_for_io = true;
|
|
1271
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "optimizeMultigetForIO", readOptions.optimize_multiget_for_io));
|
|
1272
|
+
|
|
1273
|
+
readOptions.value_size_soft_limit = std::numeric_limits<int32_t>::max();
|
|
1274
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "highWaterMarkBytes", readOptions.value_size_soft_limit));
|
|
1275
|
+
|
|
1278
1276
|
database->db->MultiGet(readOptions, column, count, keys.data(), values.data(), statuses.data());
|
|
1279
1277
|
|
|
1280
1278
|
napi_value rows;
|
|
@@ -1309,24 +1307,19 @@ NAPI_METHOD(db_get_many) {
|
|
|
1309
1307
|
uint32_t count;
|
|
1310
1308
|
NAPI_STATUS_THROWS(napi_get_array_length(env, argv[1], &count));
|
|
1311
1309
|
|
|
1312
|
-
bool fillCache = true;
|
|
1313
|
-
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "fillCache", fillCache));
|
|
1314
|
-
|
|
1315
1310
|
rocksdb::ColumnFamilyHandle* column = database->db->DefaultColumnFamily();
|
|
1316
1311
|
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "column", column));
|
|
1317
1312
|
|
|
1318
1313
|
Encoding valueEncoding = Encoding::Buffer;
|
|
1319
1314
|
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "valueEncoding", valueEncoding));
|
|
1320
1315
|
|
|
1321
|
-
int32_t highWaterMarkBytes = std::numeric_limits<int32_t>::max();
|
|
1322
|
-
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "highWaterMarkBytes", highWaterMarkBytes));
|
|
1323
|
-
|
|
1324
1316
|
bool unsafe = false;
|
|
1325
1317
|
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "unsafe", unsafe));
|
|
1326
1318
|
|
|
1327
1319
|
auto callback = argv[3];
|
|
1328
1320
|
|
|
1329
1321
|
struct State {
|
|
1322
|
+
rocksdb::ReadOptions readOptions;
|
|
1330
1323
|
std::vector<rocksdb::Status> statuses;
|
|
1331
1324
|
std::vector<rocksdb::PinnableSlice> values;
|
|
1332
1325
|
std::vector<rocksdb::PinnableSlice> keys;
|
|
@@ -1340,15 +1333,21 @@ NAPI_METHOD(db_get_many) {
|
|
|
1340
1333
|
NAPI_STATUS_THROWS(GetValue(env, element, state.keys[n]));
|
|
1341
1334
|
}
|
|
1342
1335
|
|
|
1336
|
+
state.readOptions.fill_cache = false;
|
|
1337
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "fillCache", state.readOptions.fill_cache));
|
|
1338
|
+
|
|
1339
|
+
state.readOptions.async_io = true;
|
|
1340
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "asyncIO", state.readOptions.async_io));
|
|
1341
|
+
|
|
1342
|
+
state.readOptions.optimize_multiget_for_io = true;
|
|
1343
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "optimizeMultigetForIO", state.readOptions.optimize_multiget_for_io));
|
|
1344
|
+
|
|
1345
|
+
state.readOptions.value_size_soft_limit = std::numeric_limits<int32_t>::max();
|
|
1346
|
+
NAPI_STATUS_THROWS(GetProperty(env, argv[2], "highWaterMarkBytes", state.readOptions.value_size_soft_limit));
|
|
1347
|
+
|
|
1343
1348
|
runAsync(std::move(state),
|
|
1344
1349
|
"leveldown.get_many", env, callback,
|
|
1345
1350
|
[=](auto& state) {
|
|
1346
|
-
rocksdb::ReadOptions readOptions;
|
|
1347
|
-
readOptions.fill_cache = fillCache;
|
|
1348
|
-
readOptions.async_io = true;
|
|
1349
|
-
readOptions.optimize_multiget_for_io = true;
|
|
1350
|
-
readOptions.value_size_soft_limit = highWaterMarkBytes;
|
|
1351
|
-
|
|
1352
1351
|
std::vector<rocksdb::Slice> keys;
|
|
1353
1352
|
keys.reserve(count);
|
|
1354
1353
|
for (uint32_t n = 0; n < count; n++) {
|
|
@@ -1358,7 +1357,7 @@ NAPI_METHOD(db_get_many) {
|
|
|
1358
1357
|
state.statuses.resize(count);
|
|
1359
1358
|
state.values.resize(count);
|
|
1360
1359
|
|
|
1361
|
-
database->db->MultiGet(readOptions, column, count, keys.data(), state.values.data(), state.statuses.data());
|
|
1360
|
+
database->db->MultiGet(state.readOptions, column, count, keys.data(), state.values.data(), state.statuses.data());
|
|
1362
1361
|
|
|
1363
1362
|
return rocksdb::Status::OK();
|
|
1364
1363
|
},
|
package/package.json
CHANGED
|
Binary file
|