@nxtedition/rocksdb 7.1.26 → 7.1.27
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 +15 -7
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/node.napi.node +0 -0
package/binding.cc
CHANGED
|
@@ -306,13 +306,15 @@ struct BaseIterator : public Closable {
|
|
|
306
306
|
const std::optional<std::string>& gte,
|
|
307
307
|
const int limit,
|
|
308
308
|
const bool fillCache,
|
|
309
|
-
std::shared_ptr<const rocksdb::Snapshot> snapshot
|
|
309
|
+
std::shared_ptr<const rocksdb::Snapshot> snapshot,
|
|
310
|
+
bool tailing = false)
|
|
310
311
|
: database_(database),
|
|
311
312
|
column_(column),
|
|
312
313
|
snapshot_(snapshot),
|
|
313
314
|
reverse_(reverse),
|
|
314
315
|
limit_(limit),
|
|
315
|
-
fillCache_(fillCache)
|
|
316
|
+
fillCache_(fillCache),
|
|
317
|
+
tailing_(tailing) {
|
|
316
318
|
if (lte) {
|
|
317
319
|
upper_bound_ = rocksdb::PinnableSlice();
|
|
318
320
|
*upper_bound_->GetSelf() = std::move(*lte) + '\0';
|
|
@@ -426,6 +428,7 @@ struct BaseIterator : public Closable {
|
|
|
426
428
|
readOptions.snapshot = snapshot_.get();
|
|
427
429
|
readOptions.async_io = true;
|
|
428
430
|
readOptions.adaptive_readahead = true;
|
|
431
|
+
readOptions.tailing = tailing_;
|
|
429
432
|
|
|
430
433
|
iterator_.reset(database_->db->NewIterator(readOptions, column_));
|
|
431
434
|
}
|
|
@@ -436,6 +439,7 @@ struct BaseIterator : public Closable {
|
|
|
436
439
|
std::unique_ptr<rocksdb::Iterator> iterator_;
|
|
437
440
|
const bool reverse_;
|
|
438
441
|
const int limit_;
|
|
442
|
+
const bool tailing_;
|
|
439
443
|
const bool fillCache_;
|
|
440
444
|
};
|
|
441
445
|
|
|
@@ -454,8 +458,9 @@ struct Iterator final : public BaseIterator {
|
|
|
454
458
|
const Encoding keyEncoding,
|
|
455
459
|
const Encoding valueEncoding,
|
|
456
460
|
const size_t highWaterMarkBytes,
|
|
457
|
-
std::shared_ptr<const rocksdb::Snapshot> snapshot
|
|
458
|
-
|
|
461
|
+
std::shared_ptr<const rocksdb::Snapshot> snapshot,
|
|
462
|
+
bool tailing = false)
|
|
463
|
+
: BaseIterator(database, column, reverse, lt, lte, gt, gte, limit, fillCache, snapshot, tailing),
|
|
459
464
|
keys_(keys),
|
|
460
465
|
values_(values),
|
|
461
466
|
keyEncoding_(keyEncoding),
|
|
@@ -1157,6 +1162,9 @@ NAPI_METHOD(iterator_init) {
|
|
|
1157
1162
|
bool values = true;
|
|
1158
1163
|
NAPI_STATUS_THROWS(GetProperty(env, options, "values", values));
|
|
1159
1164
|
|
|
1165
|
+
bool tailing = false;
|
|
1166
|
+
NAPI_STATUS_THROWS(GetProperty(env, options, "tailing", tailing));
|
|
1167
|
+
|
|
1160
1168
|
bool fillCache = false;
|
|
1161
1169
|
NAPI_STATUS_THROWS(GetProperty(env, options, "fillCache", fillCache));
|
|
1162
1170
|
|
|
@@ -1190,9 +1198,9 @@ NAPI_METHOD(iterator_init) {
|
|
|
1190
1198
|
std::shared_ptr<const rocksdb::Snapshot> snapshot(database->db->GetSnapshot(),
|
|
1191
1199
|
[=](const auto ptr) { database->db->ReleaseSnapshot(ptr); });
|
|
1192
1200
|
|
|
1193
|
-
auto iterator =
|
|
1194
|
-
|
|
1195
|
-
|
|
1201
|
+
auto iterator = std::unique_ptr<Iterator>(new Iterator(database, column, reverse, keys, values, limit, lt, lte, gt,
|
|
1202
|
+
gte, fillCache, keyEncoding, valueEncoding, highWaterMarkBytes,
|
|
1203
|
+
snapshot, tailing));
|
|
1196
1204
|
|
|
1197
1205
|
napi_value result;
|
|
1198
1206
|
NAPI_STATUS_THROWS(napi_create_external(env, iterator.get(), Finalize<Iterator>, iterator.get(), &result));
|
package/package.json
CHANGED
|
Binary file
|