rocksdb-native
Advanced tools
+27
-17
@@ -0,1 +1,2 @@ | ||
| #include <cstdio> | ||
| #include <set> | ||
@@ -22,3 +23,3 @@ | ||
| using rocksdb_native_on_iterator_close_t = js_function_t<void, js_receiver_t, std::optional<js_string_t>>; | ||
| using rocksdb_native_on_iterator_read_t = js_function_t<void, js_receiver_t, std::optional<js_string_t>, std::vector<js_arraybuffer_t>, std::vector<js_arraybuffer_t>>; | ||
| using rocksdb_native_on_iterator_read_t = js_function_t<void, js_receiver_t, std::optional<js_string_t>, js_array_t, js_array_t>; | ||
| using rocksdb_native_on_compact_range_t = js_function_t<void, js_receiver_t, std::optional<js_string_t>>; | ||
@@ -77,3 +78,2 @@ using rocksdb_native_on_approximate_size_t = js_function_t<void, js_receiver_t, std::optional<js_string_t>, uint64_t>; | ||
| js_persistent_t<js_receiver_t> ctx; | ||
| js_persistent_t<js_arraybuffer_t> self; | ||
| js_persistent_t<rocksdb_native_on_close_t> on_close; | ||
@@ -317,3 +317,2 @@ }; | ||
| req->on_close.reset(); | ||
| req->self.reset(); | ||
| req->ctx.reset(); | ||
@@ -390,3 +389,3 @@ | ||
| db->options = (rocksdb_options_t) { | ||
| 3, | ||
| 4, | ||
| read_only, | ||
@@ -522,5 +521,2 @@ create_if_missing, | ||
| err = js_create_reference(env, handle, req->self); | ||
| assert(err == 0); | ||
| err = js_create_reference(env, on_close, req->on_close); | ||
@@ -713,3 +709,5 @@ assert(err == 0); | ||
| int32_t num_levels, | ||
| int32_t max_write_buffer_number | ||
| int32_t max_write_buffer_number, | ||
| double blob_garbage_collection_age_cutoff, | ||
| double blob_garbage_collection_force_threshold | ||
| ) { | ||
@@ -753,3 +751,3 @@ int err; | ||
| { | ||
| 3, | ||
| 5, | ||
| rocksdb_level_compaction, | ||
@@ -772,2 +770,4 @@ enable_blob_files, | ||
| max_write_buffer_number, | ||
| blob_garbage_collection_age_cutoff, | ||
| blob_garbage_collection_force_threshold | ||
| } | ||
@@ -1052,7 +1052,9 @@ }; | ||
| std::vector<js_arraybuffer_t> keys; | ||
| keys.reserve(len); | ||
| js_array_t keys; | ||
| err = js_create_array(env, len, keys); | ||
| assert(err == 0); | ||
| std::vector<js_arraybuffer_t> values; | ||
| values.reserve(len); | ||
| js_array_t values; | ||
| err = js_create_array(env, len, values); | ||
| assert(err == 0); | ||
@@ -1076,3 +1078,4 @@ if (req->handle.error) { | ||
| keys.push_back(result); | ||
| err = js_set_element(env, keys, i, result); | ||
| assert(err == 0); | ||
@@ -1082,3 +1085,4 @@ err = rocksdb_native__try_create_external_arraybuffer(env, const_cast<char *>(value->data), value->len, result); | ||
| values.push_back(result); | ||
| err = js_set_element(env, values, i, result); | ||
| assert(err == 0); | ||
| } | ||
@@ -1624,2 +1628,5 @@ } | ||
| bool exclusive, | ||
| uint32_t blob_garbage_collection_policy, | ||
| double blob_garbage_collection_age_cutoff, | ||
| uint32_t bottommost_level_compaction, | ||
| js_receiver_t ctx, | ||
@@ -1648,4 +1655,7 @@ rocksdb_native_on_compact_range_t on_compact_range | ||
| rocksdb_compact_range_options_t options = { | ||
| .version = 0, | ||
| .exclusive_manual_compaction = exclusive | ||
| .version = 1, | ||
| .exclusive_manual_compaction = exclusive, | ||
| .blob_garbage_collection_policy = rocksdb_blob_garbage_collection_policy_t(blob_garbage_collection_policy), | ||
| .blob_garbage_collection_age_cutoff = blob_garbage_collection_age_cutoff, | ||
| .bottommost_level_compaction = rocksdb_bottommost_level_compaction_t(bottommost_level_compaction), | ||
| }; | ||
@@ -1652,0 +1662,0 @@ |
+1
-1
@@ -12,3 +12,3 @@ cmake_minimum_required(VERSION 4.0) | ||
| fetch_package("github:holepunchto/librocksdb#d5b0f65") | ||
| fetch_package("github:holepunchto/librocksdb#4e9393e") | ||
| fetch_package("github:holepunchto/libjstl#098664c") | ||
@@ -15,0 +15,0 @@ |
@@ -25,3 +25,5 @@ const binding = require('../binding') | ||
| numLevels = 7, | ||
| maxWriteBufferNumber = 2 | ||
| maxWriteBufferNumber = 2, | ||
| blobGarbageCollectionAgeCutOff = 0.25, | ||
| blobGarbageCollectionForceThreshold = 1.0 | ||
| } = opts | ||
@@ -84,3 +86,5 @@ | ||
| numLevels, | ||
| maxWriteBufferNumber | ||
| maxWriteBufferNumber, | ||
| blobGarbageCollectionAgeCutOff, | ||
| blobGarbageCollectionForceThreshold | ||
| ) | ||
@@ -87,0 +91,0 @@ } |
+10
-0
@@ -6,3 +6,13 @@ module.exports = { | ||
| ALL: 2 | ||
| }, | ||
| garbageCollectionPolicy: { | ||
| DEFAULT: 0, | ||
| FORCE: 1, | ||
| DISABLE: 2 | ||
| }, | ||
| bottommostLevelCompaction: { | ||
| NONE: 0, | ||
| SKIP: 1, | ||
| FORCE: 2 | ||
| } | ||
| } |
+10
-1
@@ -9,2 +9,3 @@ const ReadyResource = require('ready-resource') | ||
| const binding = require('../binding') | ||
| const constants = require('./constants') | ||
@@ -334,3 +335,8 @@ const MAX_BATCH_REUSE = 64 | ||
| const { exclusive = false } = opts | ||
| const { | ||
| exclusive = false, | ||
| blobGarbageCollectionPolicy = constants.garbageCollectionPolicy.DEFAULT, | ||
| blobGarbageCollectionAgeCutoff = 0.25, | ||
| bottommostLevelCompaction = constants.bottommostLevelCompaction.NONE | ||
| } = opts | ||
@@ -354,2 +360,5 @@ start = this._encodeKey(start) | ||
| exclusive, | ||
| blobGarbageCollectionPolicy, | ||
| blobGarbageCollectionAgeCutoff, | ||
| bottommostLevelCompaction, | ||
| req, | ||
@@ -356,0 +365,0 @@ oncompactrange |
+21
-7
| { | ||
| "name": "rocksdb-native", | ||
| "version": "3.11.4", | ||
| "version": "3.12.0", | ||
| "description": "librocksdb bindings for JavaScript", | ||
@@ -10,4 +10,14 @@ "exports": { | ||
| "imports": { | ||
| "fs": "bare-fs", | ||
| "default": "fs" | ||
| "crypto": { | ||
| "bare": "bare-crypto", | ||
| "default": "crypto" | ||
| }, | ||
| "fs": { | ||
| "bare": "bare-fs", | ||
| "default": "fs" | ||
| }, | ||
| "path": { | ||
| "bare": "bare-path", | ||
| "default": "path" | ||
| } | ||
| }, | ||
@@ -26,6 +36,6 @@ "files": [ | ||
| "format": "prettier --write .", | ||
| "lint": "prettier --check .", | ||
| "test": "npm run lint && npm run test:bare && npm run test:node", | ||
| "test:bare": "bare test.js", | ||
| "test:node": "node test.js" | ||
| "lint": "prettier --check . && lunte", | ||
| "test": "npm run test:node && npm run test:bare", | ||
| "test:bare": "brittle-bare test.js", | ||
| "test:node": "brittle-node test.js" | ||
| }, | ||
@@ -56,3 +66,5 @@ "repository": { | ||
| "bare-compat-napi": "^1.3.0", | ||
| "bare-crypto": "^1.12.0", | ||
| "bare-fs": "^4.5.0", | ||
| "bare-path": "^3.0.0", | ||
| "brittle": "^3.5.0", | ||
@@ -63,2 +75,4 @@ "cmake-bare": "^1.1.14", | ||
| "fd-lock": "^2.0.0", | ||
| "lunte": "^1.3.0", | ||
| "paparam": "^1.9.0", | ||
| "prettier": "^3.6.2", | ||
@@ -65,0 +79,0 @@ "prettier-config-holepunch": "^2.0.0" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
183768395
0.38%1117
2.1%13
44.44%