@nxtedition/rocksdb 13.4.0 → 13.4.2
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
|
@@ -1152,6 +1152,8 @@ NAPI_METHOD(db_open) {
|
|
|
1152
1152
|
|
|
1153
1153
|
NAPI_STATUS_THROWS(GetProperty(env, options, "useDirectIOForFlushAndCompaction", dbOptions.use_direct_io_for_flush_and_compaction));
|
|
1154
1154
|
|
|
1155
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "compactionReadaheadSize", dbOptions.compaction_readahead_size));
|
|
1156
|
+
|
|
1155
1157
|
// TODO (feat): dbOptions.listeners
|
|
1156
1158
|
|
|
1157
1159
|
std::string infoLogLevel;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/util.h
CHANGED
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
} \
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
#define ROCKS_STATUS_RETURN(call)
|
|
42
|
-
{
|
|
43
|
-
auto _status = (call);
|
|
44
|
-
if (!_status.ok()) {
|
|
45
|
-
return _status;
|
|
46
|
-
}
|
|
41
|
+
#define ROCKS_STATUS_RETURN(call) \
|
|
42
|
+
{ \
|
|
43
|
+
auto _status = (call); \
|
|
44
|
+
if (!_status.ok()) { \
|
|
45
|
+
return _status; \
|
|
46
|
+
} \
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
template <typename T>
|
|
@@ -249,7 +249,6 @@ static napi_status GetValue(napi_env env, napi_value value, double& result) {
|
|
|
249
249
|
return napi_ok;
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
|
|
253
252
|
static napi_status GetValue(napi_env env, napi_value value, std::string& result) {
|
|
254
253
|
return GetString(env, value, result);
|
|
255
254
|
}
|
|
@@ -276,21 +275,27 @@ static napi_status GetValue(napi_env env, napi_value value, Encoding& result) {
|
|
|
276
275
|
|
|
277
276
|
if (size == 6) {
|
|
278
277
|
result = Encoding::Buffer;
|
|
278
|
+
return napi_ok;
|
|
279
279
|
} else {
|
|
280
280
|
result = Encoding::String;
|
|
281
|
+
return napi_ok;
|
|
281
282
|
}
|
|
282
283
|
|
|
283
|
-
return
|
|
284
|
+
return napi_invalid_arg;
|
|
284
285
|
}
|
|
285
286
|
|
|
286
|
-
static napi_status GetValue(napi_env env,
|
|
287
|
+
static napi_status GetValue(napi_env env,
|
|
288
|
+
napi_value value,
|
|
289
|
+
rocksdb::BlockBasedTableOptions::PrepopulateBlockCache& result) {
|
|
287
290
|
std::string str;
|
|
288
291
|
|
|
289
292
|
if (GetValue(env, value, str) == napi_ok) {
|
|
290
293
|
if (str == "flushOnly") {
|
|
291
294
|
result = rocksdb::BlockBasedTableOptions::PrepopulateBlockCache::kFlushOnly;
|
|
295
|
+
return napi_ok;
|
|
292
296
|
} else if (str == "disable") {
|
|
293
297
|
result = rocksdb::BlockBasedTableOptions::PrepopulateBlockCache::kDisable;
|
|
298
|
+
return napi_ok;
|
|
294
299
|
} else {
|
|
295
300
|
return napi_invalid_arg;
|
|
296
301
|
}
|
|
@@ -300,6 +305,7 @@ static napi_status GetValue(napi_env env, napi_value value, rocksdb::BlockBasedT
|
|
|
300
305
|
if (GetValue(env, value, boolean) == napi_ok) {
|
|
301
306
|
result = boolean ? rocksdb::BlockBasedTableOptions::PrepopulateBlockCache::kFlushOnly
|
|
302
307
|
: rocksdb::BlockBasedTableOptions::PrepopulateBlockCache::kDisable;
|
|
308
|
+
return napi_ok;
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
return napi_invalid_arg;
|
|
@@ -311,8 +317,10 @@ static napi_status GetValue(napi_env env, napi_value value, rocksdb::Prepopulate
|
|
|
311
317
|
if (GetValue(env, value, str) == napi_ok) {
|
|
312
318
|
if (str == "flushOnly") {
|
|
313
319
|
result = rocksdb::PrepopulateBlobCache::kFlushOnly;
|
|
320
|
+
return napi_ok;
|
|
314
321
|
} else if (str == "disable") {
|
|
315
322
|
result = rocksdb::PrepopulateBlobCache::kDisable;
|
|
323
|
+
return napi_ok;
|
|
316
324
|
} else {
|
|
317
325
|
return napi_invalid_arg;
|
|
318
326
|
}
|
|
@@ -320,8 +328,8 @@ static napi_status GetValue(napi_env env, napi_value value, rocksdb::Prepopulate
|
|
|
320
328
|
|
|
321
329
|
bool boolean;
|
|
322
330
|
if (GetValue(env, value, boolean) == napi_ok) {
|
|
323
|
-
result = boolean ? rocksdb::PrepopulateBlobCache::kFlushOnly
|
|
324
|
-
|
|
331
|
+
result = boolean ? rocksdb::PrepopulateBlobCache::kFlushOnly : rocksdb::PrepopulateBlobCache::kDisable;
|
|
332
|
+
return napi_ok;
|
|
325
333
|
}
|
|
326
334
|
|
|
327
335
|
return napi_invalid_arg;
|
|
@@ -333,27 +341,37 @@ static napi_status GetValue(napi_env env, napi_value value, rocksdb::Compression
|
|
|
333
341
|
if (GetValue(env, value, str) == napi_ok) {
|
|
334
342
|
if (str == "no") {
|
|
335
343
|
result = rocksdb::CompressionType::kNoCompression;
|
|
344
|
+
return napi_ok;
|
|
336
345
|
} else if (str == "snappy") {
|
|
337
346
|
result = rocksdb::CompressionType::kSnappyCompression;
|
|
347
|
+
return napi_ok;
|
|
338
348
|
} else if (str == "zlib") {
|
|
339
349
|
result = rocksdb::CompressionType::kZlibCompression;
|
|
350
|
+
return napi_ok;
|
|
340
351
|
} else if (str == "bzip2") {
|
|
341
352
|
result = rocksdb::CompressionType::kBZip2Compression;
|
|
353
|
+
return napi_ok;
|
|
342
354
|
} else if (str == "lz4") {
|
|
343
355
|
result = rocksdb::CompressionType::kLZ4Compression;
|
|
356
|
+
return napi_ok;
|
|
344
357
|
} else if (str == "lz4hc") {
|
|
345
358
|
result = rocksdb::CompressionType::kLZ4HCCompression;
|
|
359
|
+
return napi_ok;
|
|
346
360
|
} else if (str == "xpress") {
|
|
347
361
|
result = rocksdb::CompressionType::kXpressCompression;
|
|
362
|
+
return napi_ok;
|
|
348
363
|
} else if (str == "zstd") {
|
|
349
364
|
result = rocksdb::CompressionType::kZSTD;
|
|
365
|
+
return napi_ok;
|
|
366
|
+
} else {
|
|
367
|
+
return napi_invalid_arg;
|
|
350
368
|
}
|
|
351
369
|
}
|
|
352
370
|
|
|
353
371
|
bool boolean;
|
|
354
372
|
if (GetValue(env, value, boolean) == napi_ok) {
|
|
355
|
-
result = boolean ? rocksdb::kZSTD
|
|
356
|
-
|
|
373
|
+
result = boolean ? rocksdb::kZSTD : rocksdb::kNoCompression;
|
|
374
|
+
return napi_ok;
|
|
357
375
|
}
|
|
358
376
|
|
|
359
377
|
return napi_invalid_arg;
|