@nxtedition/rocksdb 5.2.35 → 5.2.38

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.
Files changed (207) hide show
  1. package/binding.cc +136 -164
  2. package/binding.gyp +1 -1
  3. package/deps/liburing/liburing/COPYING +502 -0
  4. package/deps/liburing/liburing/COPYING.GPL +339 -0
  5. package/deps/liburing/liburing/LICENSE +7 -0
  6. package/deps/liburing/liburing/Makefile +84 -0
  7. package/deps/liburing/liburing/Makefile.quiet +11 -0
  8. package/deps/liburing/liburing/README +46 -0
  9. package/deps/liburing/liburing/configure +420 -0
  10. package/deps/liburing/liburing/debian/README.Debian +7 -0
  11. package/deps/liburing/liburing/debian/changelog +27 -0
  12. package/deps/liburing/liburing/debian/compat +1 -0
  13. package/deps/liburing/liburing/debian/control +48 -0
  14. package/deps/liburing/liburing/debian/copyright +49 -0
  15. package/deps/liburing/liburing/debian/liburing-dev.install +4 -0
  16. package/deps/liburing/liburing/debian/liburing-dev.manpages +6 -0
  17. package/deps/liburing/liburing/debian/liburing1-udeb.install +1 -0
  18. package/deps/liburing/liburing/debian/liburing1.install +1 -0
  19. package/deps/liburing/liburing/debian/liburing1.symbols +32 -0
  20. package/deps/liburing/liburing/debian/patches/series +1 -0
  21. package/deps/liburing/liburing/debian/rules +81 -0
  22. package/deps/liburing/liburing/debian/source/format +1 -0
  23. package/deps/liburing/liburing/debian/source/local-options +2 -0
  24. package/deps/liburing/liburing/debian/source/options +1 -0
  25. package/deps/liburing/liburing/debian/watch +3 -0
  26. package/deps/liburing/liburing/examples/Makefile +29 -0
  27. package/deps/liburing/liburing/examples/io_uring-cp.c +279 -0
  28. package/deps/liburing/liburing/examples/io_uring-test.c +112 -0
  29. package/deps/liburing/liburing/examples/link-cp.c +193 -0
  30. package/deps/liburing/liburing/examples/ucontext-cp.c +273 -0
  31. package/deps/liburing/liburing/liburing.pc.in +12 -0
  32. package/deps/liburing/liburing/liburing.spec +66 -0
  33. package/deps/liburing/liburing/make-debs.sh +53 -0
  34. package/deps/liburing/liburing/man/io_uring.7 +736 -0
  35. package/deps/liburing/liburing/man/io_uring_enter.2 +1403 -0
  36. package/deps/liburing/liburing/man/io_uring_get_sqe.3 +37 -0
  37. package/deps/liburing/liburing/man/io_uring_queue_exit.3 +27 -0
  38. package/deps/liburing/liburing/man/io_uring_queue_init.3 +44 -0
  39. package/deps/liburing/liburing/man/io_uring_register.2 +605 -0
  40. package/deps/liburing/liburing/man/io_uring_setup.2 +515 -0
  41. package/deps/liburing/liburing/src/Makefile +76 -0
  42. package/deps/liburing/liburing/src/include/liburing/barrier.h +73 -0
  43. package/deps/liburing/liburing/src/include/liburing/io_uring.h +422 -0
  44. package/deps/liburing/liburing/src/include/liburing.h +775 -0
  45. package/deps/liburing/liburing/src/liburing.map +46 -0
  46. package/deps/liburing/liburing/src/queue.c +403 -0
  47. package/deps/liburing/liburing/src/register.c +299 -0
  48. package/deps/liburing/liburing/src/setup.c +356 -0
  49. package/deps/liburing/liburing/src/syscall.c +73 -0
  50. package/deps/liburing/liburing/src/syscall.h +20 -0
  51. package/deps/liburing/liburing/test/232c93d07b74-test.c +305 -0
  52. package/deps/liburing/liburing/test/35fa71a030ca-test.c +329 -0
  53. package/deps/liburing/liburing/test/500f9fbadef8-test.c +89 -0
  54. package/deps/liburing/liburing/test/7ad0e4b2f83c-test.c +93 -0
  55. package/deps/liburing/liburing/test/8a9973408177-test.c +106 -0
  56. package/deps/liburing/liburing/test/917257daa0fe-test.c +53 -0
  57. package/deps/liburing/liburing/test/Makefile +312 -0
  58. package/deps/liburing/liburing/test/a0908ae19763-test.c +58 -0
  59. package/deps/liburing/liburing/test/a4c0b3decb33-test.c +180 -0
  60. package/deps/liburing/liburing/test/accept-link.c +251 -0
  61. package/deps/liburing/liburing/test/accept-reuse.c +164 -0
  62. package/deps/liburing/liburing/test/accept-test.c +79 -0
  63. package/deps/liburing/liburing/test/accept.c +476 -0
  64. package/deps/liburing/liburing/test/across-fork.c +283 -0
  65. package/deps/liburing/liburing/test/b19062a56726-test.c +53 -0
  66. package/deps/liburing/liburing/test/b5837bd5311d-test.c +77 -0
  67. package/deps/liburing/liburing/test/ce593a6c480a-test.c +135 -0
  68. package/deps/liburing/liburing/test/close-opath.c +122 -0
  69. package/deps/liburing/liburing/test/config +10 -0
  70. package/deps/liburing/liburing/test/connect.c +398 -0
  71. package/deps/liburing/liburing/test/cq-full.c +96 -0
  72. package/deps/liburing/liburing/test/cq-overflow.c +294 -0
  73. package/deps/liburing/liburing/test/cq-peek-batch.c +102 -0
  74. package/deps/liburing/liburing/test/cq-ready.c +94 -0
  75. package/deps/liburing/liburing/test/cq-size.c +58 -0
  76. package/deps/liburing/liburing/test/d4ae271dfaae-test.c +96 -0
  77. package/deps/liburing/liburing/test/d77a67ed5f27-test.c +65 -0
  78. package/deps/liburing/liburing/test/defer.c +307 -0
  79. package/deps/liburing/liburing/test/double-poll-crash.c +186 -0
  80. package/deps/liburing/liburing/test/eeed8b54e0df-test.c +114 -0
  81. package/deps/liburing/liburing/test/empty-eownerdead.c +42 -0
  82. package/deps/liburing/liburing/test/eventfd-disable.c +151 -0
  83. package/deps/liburing/liburing/test/eventfd-ring.c +97 -0
  84. package/deps/liburing/liburing/test/eventfd.c +112 -0
  85. package/deps/liburing/liburing/test/fadvise.c +202 -0
  86. package/deps/liburing/liburing/test/fallocate.c +249 -0
  87. package/deps/liburing/liburing/test/fc2a85cb02ef-test.c +138 -0
  88. package/deps/liburing/liburing/test/file-register.c +843 -0
  89. package/deps/liburing/liburing/test/file-update.c +173 -0
  90. package/deps/liburing/liburing/test/files-exit-hang-poll.c +128 -0
  91. package/deps/liburing/liburing/test/files-exit-hang-timeout.c +134 -0
  92. package/deps/liburing/liburing/test/fixed-link.c +90 -0
  93. package/deps/liburing/liburing/test/fsync.c +224 -0
  94. package/deps/liburing/liburing/test/hardlink.c +136 -0
  95. package/deps/liburing/liburing/test/helpers.c +135 -0
  96. package/deps/liburing/liburing/test/helpers.h +67 -0
  97. package/deps/liburing/liburing/test/io-cancel.c +537 -0
  98. package/deps/liburing/liburing/test/io_uring_enter.c +296 -0
  99. package/deps/liburing/liburing/test/io_uring_register.c +664 -0
  100. package/deps/liburing/liburing/test/io_uring_setup.c +192 -0
  101. package/deps/liburing/liburing/test/iopoll.c +366 -0
  102. package/deps/liburing/liburing/test/lfs-openat-write.c +117 -0
  103. package/deps/liburing/liburing/test/lfs-openat.c +273 -0
  104. package/deps/liburing/liburing/test/link-timeout.c +1107 -0
  105. package/deps/liburing/liburing/test/link.c +496 -0
  106. package/deps/liburing/liburing/test/link_drain.c +229 -0
  107. package/deps/liburing/liburing/test/madvise.c +195 -0
  108. package/deps/liburing/liburing/test/mkdir.c +108 -0
  109. package/deps/liburing/liburing/test/multicqes_drain.c +383 -0
  110. package/deps/liburing/liburing/test/nop-all-sizes.c +107 -0
  111. package/deps/liburing/liburing/test/nop.c +115 -0
  112. package/deps/liburing/liburing/test/open-close.c +146 -0
  113. package/deps/liburing/liburing/test/openat2.c +240 -0
  114. package/deps/liburing/liburing/test/personality.c +204 -0
  115. package/deps/liburing/liburing/test/pipe-eof.c +81 -0
  116. package/deps/liburing/liburing/test/pipe-reuse.c +105 -0
  117. package/deps/liburing/liburing/test/poll-cancel-ton.c +139 -0
  118. package/deps/liburing/liburing/test/poll-cancel.c +135 -0
  119. package/deps/liburing/liburing/test/poll-link.c +227 -0
  120. package/deps/liburing/liburing/test/poll-many.c +208 -0
  121. package/deps/liburing/liburing/test/poll-mshot-update.c +273 -0
  122. package/deps/liburing/liburing/test/poll-ring.c +48 -0
  123. package/deps/liburing/liburing/test/poll-v-poll.c +353 -0
  124. package/deps/liburing/liburing/test/poll.c +109 -0
  125. package/deps/liburing/liburing/test/probe.c +137 -0
  126. package/deps/liburing/liburing/test/read-write.c +876 -0
  127. package/deps/liburing/liburing/test/register-restrictions.c +633 -0
  128. package/deps/liburing/liburing/test/rename.c +134 -0
  129. package/deps/liburing/liburing/test/ring-leak.c +173 -0
  130. package/deps/liburing/liburing/test/ring-leak2.c +249 -0
  131. package/deps/liburing/liburing/test/rsrc_tags.c +449 -0
  132. package/deps/liburing/liburing/test/runtests-loop.sh +16 -0
  133. package/deps/liburing/liburing/test/runtests.sh +170 -0
  134. package/deps/liburing/liburing/test/rw_merge_test.c +97 -0
  135. package/deps/liburing/liburing/test/self.c +91 -0
  136. package/deps/liburing/liburing/test/send_recv.c +291 -0
  137. package/deps/liburing/liburing/test/send_recvmsg.c +345 -0
  138. package/deps/liburing/liburing/test/sendmsg_fs_cve.c +198 -0
  139. package/deps/liburing/liburing/test/shared-wq.c +84 -0
  140. package/deps/liburing/liburing/test/short-read.c +75 -0
  141. package/deps/liburing/liburing/test/shutdown.c +163 -0
  142. package/deps/liburing/liburing/test/sigfd-deadlock.c +74 -0
  143. package/deps/liburing/liburing/test/socket-rw-eagain.c +156 -0
  144. package/deps/liburing/liburing/test/socket-rw.c +147 -0
  145. package/deps/liburing/liburing/test/splice.c +511 -0
  146. package/deps/liburing/liburing/test/sq-full-cpp.cc +45 -0
  147. package/deps/liburing/liburing/test/sq-full.c +45 -0
  148. package/deps/liburing/liburing/test/sq-poll-dup.c +200 -0
  149. package/deps/liburing/liburing/test/sq-poll-kthread.c +168 -0
  150. package/deps/liburing/liburing/test/sq-poll-share.c +137 -0
  151. package/deps/liburing/liburing/test/sq-space_left.c +159 -0
  152. package/deps/liburing/liburing/test/sqpoll-cancel-hang.c +159 -0
  153. package/deps/liburing/liburing/test/sqpoll-disable-exit.c +195 -0
  154. package/deps/liburing/liburing/test/sqpoll-exit-hang.c +77 -0
  155. package/deps/liburing/liburing/test/sqpoll-sleep.c +68 -0
  156. package/deps/liburing/liburing/test/statx.c +172 -0
  157. package/deps/liburing/liburing/test/stdout.c +232 -0
  158. package/deps/liburing/liburing/test/submit-link-fail.c +154 -0
  159. package/deps/liburing/liburing/test/submit-reuse.c +239 -0
  160. package/deps/liburing/liburing/test/symlink.c +116 -0
  161. package/deps/liburing/liburing/test/teardowns.c +58 -0
  162. package/deps/liburing/liburing/test/thread-exit.c +131 -0
  163. package/deps/liburing/liburing/test/timeout-new.c +246 -0
  164. package/deps/liburing/liburing/test/timeout-overflow.c +204 -0
  165. package/deps/liburing/liburing/test/timeout.c +1354 -0
  166. package/deps/liburing/liburing/test/unlink.c +111 -0
  167. package/deps/liburing/liburing/test/wakeup-hang.c +162 -0
  168. package/deps/liburing/liburing.gyp +20 -0
  169. package/deps/rocksdb/rocksdb/README.md +32 -0
  170. package/deps/rocksdb/rocksdb/db/corruption_test.cc +62 -0
  171. package/deps/rocksdb/rocksdb/db/db_impl/db_impl.h +7 -62
  172. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_files.cc +25 -11
  173. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_open.cc +74 -155
  174. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.cc +1 -2
  175. package/deps/rocksdb/rocksdb/db/db_impl/db_impl_secondary.h +2 -2
  176. package/deps/rocksdb/rocksdb/env/fs_posix.cc +13 -0
  177. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.cc +4 -2
  178. package/deps/rocksdb/rocksdb/file/file_prefetch_buffer.h +22 -4
  179. package/deps/rocksdb/rocksdb/file/prefetch_test.cc +5 -0
  180. package/deps/rocksdb/rocksdb/include/rocksdb/file_system.h +15 -0
  181. package/deps/rocksdb/rocksdb/include/rocksdb/statistics.h +5 -0
  182. package/deps/rocksdb/rocksdb/include/rocksdb/version.h +1 -1
  183. package/deps/rocksdb/rocksdb/microbench/README.md +60 -0
  184. package/deps/rocksdb/rocksdb/monitoring/statistics.cc +3 -0
  185. package/deps/rocksdb/rocksdb/monitoring/stats_history_test.cc +3 -7
  186. package/deps/rocksdb/rocksdb/plugin/README.md +43 -0
  187. package/deps/rocksdb/rocksdb/port/README +10 -0
  188. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader.h +2 -1
  189. package/deps/rocksdb/rocksdb/table/block_based/block_based_table_reader_test.cc +44 -29
  190. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +13 -0
  191. package/deps/rocksdb/rocksdb.gyp +3 -4
  192. package/deps/snappy/snappy-1.1.7/README.md +149 -0
  193. package/package.json +1 -1
  194. package/prebuilds/darwin-arm64/node.napi.node +0 -0
  195. package/prebuilds/darwin-x64/node.napi.node +0 -0
  196. package/prebuilds/linux-x64/node.napi.node +0 -0
  197. package/deps/rocksdb/rocksdb/cmake/modules/CxxFlags.cmake +0 -7
  198. package/deps/rocksdb/rocksdb/cmake/modules/FindJeMalloc.cmake +0 -29
  199. package/deps/rocksdb/rocksdb/cmake/modules/FindNUMA.cmake +0 -29
  200. package/deps/rocksdb/rocksdb/cmake/modules/FindSnappy.cmake +0 -29
  201. package/deps/rocksdb/rocksdb/cmake/modules/FindTBB.cmake +0 -33
  202. package/deps/rocksdb/rocksdb/cmake/modules/Findgflags.cmake +0 -29
  203. package/deps/rocksdb/rocksdb/cmake/modules/Findlz4.cmake +0 -29
  204. package/deps/rocksdb/rocksdb/cmake/modules/Finduring.cmake +0 -26
  205. package/deps/rocksdb/rocksdb/cmake/modules/Findzstd.cmake +0 -29
  206. package/deps/rocksdb/rocksdb/cmake/modules/ReadVersion.cmake +0 -10
  207. package/package-lock.json +0 -23687
@@ -0,0 +1,43 @@
1
+ ## Building external plugins together with RocksDB
2
+
3
+ RocksDB offers several plugin interfaces for developers to customize its behavior. One difficulty developers face is how to make their plugin available to end users. The approach discussed here involves building the external code together with the RocksDB code into a single binary. Note another approach we plan to support involves loading plugins dynamically from shared libraries.
4
+
5
+ ### Discovery
6
+
7
+ We hope developers will mention their work in "PLUGINS.md" so users can easily discover and reuse solutions for customizing RocksDB.
8
+
9
+ ### Directory organization
10
+
11
+ External plugins will be linked according to their name into a subdirectory of "plugin/". For example, a plugin called "dedupfs" would be linked into "plugin/dedupfs/".
12
+
13
+ ### Build standard
14
+
15
+ Currently the only supported build system are make and cmake.
16
+
17
+ For make, files in the plugin directory ending in the .mk extension can define the following variables.
18
+
19
+ * `$(PLUGIN_NAME)_SOURCES`: these files will be compiled and linked with RocksDB. They can access RocksDB public header files.
20
+ * `$(PLUGIN_NAME)_HEADERS`: these files will be installed in the RocksDB header directory. Their paths will be prefixed by "rocksdb/plugin/$(PLUGIN_NAME)/".
21
+ * `$(PLUGIN_NAME)_LDFLAGS`: these flags will be passed to the final link step. For example, library dependencies can be propagated here, or symbols can be forcibly included, e.g., for static registration.
22
+ * `$(PLUGIN_NAME)_CXXFLAGS`: these flags will be passed to the compiler. For example, they can specify locations of header files in non-standard locations.
23
+
24
+ Users will run the usual make commands from the RocksDB directory, specifying the plugins to include in a space-separated list in the variable `ROCKSDB_PLUGINS`.
25
+
26
+ For CMake, the CMakeLists.txt file in the plugin directory can define the following variables.
27
+
28
+ * `${PLUGIN_NAME}_SOURCES`: these files will be compiled and linked with RocksDB. They can access RocksDB public header files.
29
+ * `${PLUGIN_NAME}_COMPILE_FLAGS`: these flags will be passed to the compiler. For example, they can specify locations of header files in non-standard locations.
30
+ * `${PLUGIN_NAME}_INCLUDE_PATHS`: paths to directories to search for plugin-specific header files during compilation.
31
+ * `${PLUGIN_NAME}_LIBS`: list of library names required to build the plugin, e.g. `dl`, `java`, `jvm`, `rados`, etc. CMake will generate proper flags for linking.
32
+ * `${PLUGIN_NAME}_LINK_PATHS`: list of paths for the linker to search for required libraries in additional to standard locations.
33
+ * `${PLUGIN_NAME}_CMAKE_SHARED_LINKER_FLAGS` additional linker flags used to generate shared libraries. For example, symbols can be forcibly included, e.g., for static registration.
34
+ * `${PLUGIN_NAME}_CMAKE_EXE_LINKER_FLAGS`: additional linker flags used to generate executables. For example, symbols can be forcibly included, e.g., for static registration.
35
+
36
+ Users will run the usual cmake commands, specifying the plugins to include in a space-separated list in the command line variable `ROCKSDB_PLUGINS` when invoking cmake.
37
+ ```
38
+ cmake .. -DROCKSDB_PLUGINS="dedupfs hdfs rados"
39
+ ```
40
+
41
+ ### Example
42
+
43
+ For a working example, see [Dedupfs](https://github.com/ajkr/dedupfs).
@@ -0,0 +1,10 @@
1
+ This directory contains interfaces and implementations that isolate the
2
+ rest of the package from platform details.
3
+
4
+ Code in the rest of the package includes "port.h" from this directory.
5
+ "port.h" in turn includes a platform specific "port_<platform>.h" file
6
+ that provides the platform specific implementation.
7
+
8
+ See port_posix.h for an example of what must be provided in a platform
9
+ specific header file.
10
+
@@ -666,7 +666,8 @@ struct BlockBasedTable::Rep {
666
666
  fpb->reset(new FilePrefetchBuffer(
667
667
  readahead_size, max_readahead_size,
668
668
  !ioptions.allow_mmap_reads /* enable */, false /* track_min_offset */,
669
- implicit_auto_readahead, async_io, ioptions.fs.get()));
669
+ implicit_auto_readahead, async_io, ioptions.fs.get(), ioptions.clock,
670
+ ioptions.stats));
670
671
  }
671
672
 
672
673
  void CreateFilePrefetchBufferIfNotExists(
@@ -5,6 +5,7 @@
5
5
 
6
6
  #include "table/block_based/block_based_table_reader.h"
7
7
 
8
+ #include <cmath>
8
9
  #include <memory>
9
10
  #include <string>
10
11
 
@@ -330,9 +331,9 @@ class BlockBasedTableReaderCapMemoryTest
330
331
  CacheEntryRole::kBlockBasedTableReader>::
331
332
  GetDummyEntrySize() ==
332
333
  0 &&
333
- cache_capacity > 2 * CacheReservationManagerImpl<
334
- CacheEntryRole::kBlockBasedTableReader>::
335
- GetDummyEntrySize());
334
+ cache_capacity >= 2 * CacheReservationManagerImpl<
335
+ CacheEntryRole::kBlockBasedTableReader>::
336
+ GetDummyEntrySize());
336
337
 
337
338
  // We need to subtract 1 for max_num_dummy_entry to account for dummy
338
339
  // entries' overhead, assumed the overhead is no greater than 1 dummy entry
@@ -347,11 +348,11 @@ class BlockBasedTableReaderCapMemoryTest
347
348
  max_num_dummy_entry *
348
349
  CacheReservationManagerImpl<
349
350
  CacheEntryRole::kBlockBasedTableReader>::GetDummyEntrySize();
350
- std::size_t max_table_reader_num = static_cast<std::size_t>(
351
+ std::size_t max_table_reader_num_capped = static_cast<std::size_t>(
351
352
  std::floor(1.0 * cache_capacity_rounded_to_dummy_entry_multiples /
352
353
  approx_table_reader_mem));
353
354
 
354
- return max_table_reader_num;
355
+ return max_table_reader_num_capped;
355
356
  }
356
357
 
357
358
  void SetUp() override {
@@ -361,7 +362,7 @@ class BlockBasedTableReaderCapMemoryTest
361
362
  compression_type_ = CompressionType::kNoCompression;
362
363
 
363
364
  table_reader_res_only_cache_.reset(new BlockBasedTableReaderResOnlyCache(
364
- NewLRUCache(6 * CacheReservationManagerImpl<
365
+ NewLRUCache(4 * CacheReservationManagerImpl<
365
366
  CacheEntryRole::kBlockBasedTableReader>::
366
367
  GetDummyEntrySize(),
367
368
  0 /* num_shard_bits */, true /* strict_capacity_limit */)));
@@ -420,22 +421,44 @@ class BlockBasedTableReaderCapMemoryTest
420
421
  };
421
422
 
422
423
  INSTANTIATE_TEST_CASE_P(CapMemoryUsageUnderCacheCapacity,
423
- BlockBasedTableReaderCapMemoryTest, ::testing::Bool());
424
+ BlockBasedTableReaderCapMemoryTest,
425
+ ::testing::Values(true, false));
424
426
 
425
427
  TEST_P(BlockBasedTableReaderCapMemoryTest, CapMemoryUsageUnderCacheCapacity) {
426
- const std::size_t max_table_reader_num = BlockBasedTableReaderCapMemoryTest::
427
- CalculateMaxTableReaderNumBeforeCacheFull(
428
- table_reader_res_only_cache_->GetCapacity(),
429
- approx_table_reader_mem_);
428
+ const std::size_t max_table_reader_num_capped =
429
+ BlockBasedTableReaderCapMemoryTest::
430
+ CalculateMaxTableReaderNumBeforeCacheFull(
431
+ table_reader_res_only_cache_->GetCapacity(),
432
+ approx_table_reader_mem_);
433
+
434
+ // Acceptable estimtation errors coming from
435
+ // 1. overstimate max_table_reader_num_capped due to # dummy entries is high
436
+ // and results in metadata charge overhead greater than 1 dummy entry size
437
+ // (violating our assumption in calculating max_table_reader_num_capped)
438
+ // 2. overestimate/underestimate max_table_reader_num_capped due to the gap
439
+ // between ApproximateTableReaderMem() and actual table reader mem
440
+ std::size_t max_table_reader_num_capped_upper_bound =
441
+ (std::size_t)(max_table_reader_num_capped * 1.01);
442
+ std::size_t max_table_reader_num_capped_lower_bound =
443
+ (std::size_t)(max_table_reader_num_capped * 0.99);
444
+ std::size_t max_table_reader_num_uncapped =
445
+ (std::size_t)(max_table_reader_num_capped * 1.1);
446
+ ASSERT_GT(max_table_reader_num_uncapped,
447
+ max_table_reader_num_capped_upper_bound)
448
+ << "We need `max_table_reader_num_uncapped` > "
449
+ "`max_table_reader_num_capped_upper_bound` to differentiate cases "
450
+ "between "
451
+ "reserve_table_reader_memory_ == false and == true)";
430
452
 
431
453
  Status s = Status::OK();
432
454
  std::size_t opened_table_reader_num = 0;
433
455
  std::string table_name;
434
456
  std::vector<std::unique_ptr<BlockBasedTable>> tables;
435
-
436
457
  // Keep creating BlockBasedTableReader till hiting the memory limit based on
437
- // cache capacity and creation fails or reaching a big number of table readers
438
- while (s.ok() && opened_table_reader_num < 2 * max_table_reader_num) {
458
+ // cache capacity and creation fails (when reserve_table_reader_memory_ ==
459
+ // true) or reaching a specfied big number of table readers (when
460
+ // reserve_table_reader_memory_ == false)
461
+ while (s.ok() && opened_table_reader_num < max_table_reader_num_uncapped) {
439
462
  table_name = "table_" + std::to_string(opened_table_reader_num);
440
463
  CreateTable(table_name, compression_type_, kv_);
441
464
  tables.push_back(std::unique_ptr<BlockBasedTable>());
@@ -449,23 +472,14 @@ TEST_P(BlockBasedTableReaderCapMemoryTest, CapMemoryUsageUnderCacheCapacity) {
449
472
  }
450
473
 
451
474
  if (reserve_table_reader_memory_) {
452
- EXPECT_TRUE(s.IsMemoryLimit() &&
453
- opened_table_reader_num < 2 * max_table_reader_num)
454
- << "s: " << s.ToString() << " opened_table_reader_num: "
455
- << std::to_string(opened_table_reader_num);
475
+ EXPECT_TRUE(s.IsMemoryLimit()) << "s: " << s.ToString();
456
476
  EXPECT_TRUE(s.ToString().find("memory limit based on cache capacity") !=
457
477
  std::string::npos);
458
478
 
459
- // Acceptable estimtation errors coming from
460
- // 1. overstimate max_table_reader_num due to # dummy entries is high and
461
- // results in metadata charge overhead greater than 1 dummy entry size
462
- // (violating our assumption in calculating max_table_reader_nums)
463
- // 2. overestimate/underestimate max_table_reader_num due to the gap between
464
- // ApproximateTableReaderMem() and actual table reader mem
465
- EXPECT_GE(opened_table_reader_num, max_table_reader_num * 0.99);
466
- EXPECT_LE(opened_table_reader_num, max_table_reader_num * 1.01);
479
+ EXPECT_GE(opened_table_reader_num, max_table_reader_num_capped_lower_bound);
480
+ EXPECT_LE(opened_table_reader_num, max_table_reader_num_capped_upper_bound);
467
481
 
468
- std::size_t updated_max_table_reader_num =
482
+ std::size_t updated_max_table_reader_num_capped =
469
483
  BlockBasedTableReaderCapMemoryTest::
470
484
  CalculateMaxTableReaderNumBeforeCacheFull(
471
485
  table_reader_res_only_cache_->GetCapacity() / 2,
@@ -473,7 +487,7 @@ TEST_P(BlockBasedTableReaderCapMemoryTest, CapMemoryUsageUnderCacheCapacity) {
473
487
 
474
488
  // Keep deleting BlockBasedTableReader to lower down memory usage from the
475
489
  // memory limit to make the next creation succeeds
476
- while (opened_table_reader_num >= updated_max_table_reader_num) {
490
+ while (opened_table_reader_num >= updated_max_table_reader_num_capped) {
477
491
  tables.pop_back();
478
492
  --opened_table_reader_num;
479
493
  }
@@ -489,7 +503,8 @@ TEST_P(BlockBasedTableReaderCapMemoryTest, CapMemoryUsageUnderCacheCapacity) {
489
503
  tables.clear();
490
504
  EXPECT_EQ(table_reader_res_only_cache_->GetPinnedUsage(), 0);
491
505
  } else {
492
- EXPECT_TRUE(s.ok() && opened_table_reader_num == 2 * max_table_reader_num)
506
+ EXPECT_TRUE(s.ok() &&
507
+ opened_table_reader_num == max_table_reader_num_uncapped)
493
508
  << "s: " << s.ToString() << " opened_table_reader_num: "
494
509
  << std::to_string(opened_table_reader_num);
495
510
  EXPECT_EQ(table_reader_res_only_cache_->GetPinnedUsage(), 0);
@@ -0,0 +1,13 @@
1
+ The files in this directory originally come from
2
+ https://github.com/percona/PerconaFT/.
3
+
4
+ This directory only includes the "locktree" part of PerconaFT, and its
5
+ dependencies.
6
+
7
+ The following modifications were made:
8
+ - Make locktree usable outside of PerconaFT library
9
+ - Add shared read-only lock support
10
+
11
+ The files named *_subst.* are substitutes of the PerconaFT's files, they
12
+ contain replacements of PerconaFT's functionality.
13
+
@@ -83,8 +83,7 @@
83
83
  "ROCKSDB_PTHREAD_ADAPTIVE_MUTEX=1",
84
84
  "ROCKSDB_RANGESYNC_PRESENT=1",
85
85
  "ROCKSDB_SCHED_GETCPU_PRESENT=1",
86
- # "DROCKSDB_SUPPORT_THREAD_LOCAL=1",
87
- # "ROCKSDB_IOURING_PRESENT=1",
86
+ "ROCKSDB_IOURING_PRESENT=1",
88
87
  "HAVE_SSE42=1",
89
88
  "HAVE_BMI=1",
90
89
  "HAVE_LZCNT=1",
@@ -93,10 +92,10 @@
93
92
  "HAVE_UINT128_EXTENSION=1",
94
93
  "HAVE_ALIGNED_NEW=1",
95
94
  # "HAVE_FULLFSYNC=1",
96
- # "LIBURING=1",
97
95
  # "NUMA=1",
98
96
  # "TBB=1",
99
97
  ],
98
+ "dependencies": ["../liburing/liburing.gyp:liburing"],
100
99
  "cflags": [
101
100
  "-msse4.2",
102
101
  "-mpclmul",
@@ -118,7 +117,7 @@
118
117
  "xcode_settings": {
119
118
  "OTHER_CPLUSPLUSFLAGS": [
120
119
  "-mmacosx-version-min=10.15",
121
- "-std=c++17",
120
+ "-std=c++20",
122
121
  "-fno-omit-frame-pointer",
123
122
  "-momit-leaf-frame-pointer",
124
123
  "-arch x86_64",
@@ -0,0 +1,149 @@
1
+ Snappy, a fast compressor/decompressor.
2
+
3
+
4
+ Introduction
5
+ ============
6
+
7
+ Snappy is a compression/decompression library. It does not aim for maximum
8
+ compression, or compatibility with any other compression library; instead,
9
+ it aims for very high speeds and reasonable compression. For instance,
10
+ compared to the fastest mode of zlib, Snappy is an order of magnitude faster
11
+ for most inputs, but the resulting compressed files are anywhere from 20% to
12
+ 100% bigger. (For more information, see "Performance", below.)
13
+
14
+ Snappy has the following properties:
15
+
16
+ * Fast: Compression speeds at 250 MB/sec and beyond, with no assembler code.
17
+ See "Performance" below.
18
+ * Stable: Over the last few years, Snappy has compressed and decompressed
19
+ petabytes of data in Google's production environment. The Snappy bitstream
20
+ format is stable and will not change between versions.
21
+ * Robust: The Snappy decompressor is designed not to crash in the face of
22
+ corrupted or malicious input.
23
+ * Free and open source software: Snappy is licensed under a BSD-type license.
24
+ For more information, see the included COPYING file.
25
+
26
+ Snappy has previously been called "Zippy" in some Google presentations
27
+ and the like.
28
+
29
+
30
+ Performance
31
+ ===========
32
+
33
+ Snappy is intended to be fast. On a single core of a Core i7 processor
34
+ in 64-bit mode, it compresses at about 250 MB/sec or more and decompresses at
35
+ about 500 MB/sec or more. (These numbers are for the slowest inputs in our
36
+ benchmark suite; others are much faster.) In our tests, Snappy usually
37
+ is faster than algorithms in the same class (e.g. LZO, LZF, QuickLZ,
38
+ etc.) while achieving comparable compression ratios.
39
+
40
+ Typical compression ratios (based on the benchmark suite) are about 1.5-1.7x
41
+ for plain text, about 2-4x for HTML, and of course 1.0x for JPEGs, PNGs and
42
+ other already-compressed data. Similar numbers for zlib in its fastest mode
43
+ are 2.6-2.8x, 3-7x and 1.0x, respectively. More sophisticated algorithms are
44
+ capable of achieving yet higher compression rates, although usually at the
45
+ expense of speed. Of course, compression ratio will vary significantly with
46
+ the input.
47
+
48
+ Although Snappy should be fairly portable, it is primarily optimized
49
+ for 64-bit x86-compatible processors, and may run slower in other environments.
50
+ In particular:
51
+
52
+ - Snappy uses 64-bit operations in several places to process more data at
53
+ once than would otherwise be possible.
54
+ - Snappy assumes unaligned 32- and 64-bit loads and stores are cheap.
55
+ On some platforms, these must be emulated with single-byte loads
56
+ and stores, which is much slower.
57
+ - Snappy assumes little-endian throughout, and needs to byte-swap data in
58
+ several places if running on a big-endian platform.
59
+
60
+ Experience has shown that even heavily tuned code can be improved.
61
+ Performance optimizations, whether for 64-bit x86 or other platforms,
62
+ are of course most welcome; see "Contact", below.
63
+
64
+
65
+ Building
66
+ ========
67
+
68
+ CMake is supported and autotools will soon be deprecated.
69
+ You need CMake 3.4 or above to build:
70
+
71
+ mkdir build
72
+ cd build && cmake ../ && make
73
+
74
+
75
+ Usage
76
+ =====
77
+
78
+ Note that Snappy, both the implementation and the main interface,
79
+ is written in C++. However, several third-party bindings to other languages
80
+ are available; see the home page at http://google.github.io/snappy/
81
+ for more information. Also, if you want to use Snappy from C code, you can
82
+ use the included C bindings in snappy-c.h.
83
+
84
+ To use Snappy from your own C++ program, include the file "snappy.h" from
85
+ your calling file, and link against the compiled library.
86
+
87
+ There are many ways to call Snappy, but the simplest possible is
88
+
89
+ snappy::Compress(input.data(), input.size(), &output);
90
+
91
+ and similarly
92
+
93
+ snappy::Uncompress(input.data(), input.size(), &output);
94
+
95
+ where "input" and "output" are both instances of std::string.
96
+
97
+ There are other interfaces that are more flexible in various ways, including
98
+ support for custom (non-array) input sources. See the header file for more
99
+ information.
100
+
101
+
102
+ Tests and benchmarks
103
+ ====================
104
+
105
+ When you compile Snappy, snappy_unittest is compiled in addition to the
106
+ library itself. You do not need it to use the compressor from your own library,
107
+ but it contains several useful components for Snappy development.
108
+
109
+ First of all, it contains unit tests, verifying correctness on your machine in
110
+ various scenarios. If you want to change or optimize Snappy, please run the
111
+ tests to verify you have not broken anything. Note that if you have the
112
+ Google Test library installed, unit test behavior (especially failures) will be
113
+ significantly more user-friendly. You can find Google Test at
114
+
115
+ http://github.com/google/googletest
116
+
117
+ You probably also want the gflags library for handling of command-line flags;
118
+ you can find it at
119
+
120
+ http://gflags.github.io/gflags/
121
+
122
+ In addition to the unit tests, snappy contains microbenchmarks used to
123
+ tune compression and decompression performance. These are automatically run
124
+ before the unit tests, but you can disable them using the flag
125
+ --run_microbenchmarks=false if you have gflags installed (otherwise you will
126
+ need to edit the source).
127
+
128
+ Finally, snappy can benchmark Snappy against a few other compression libraries
129
+ (zlib, LZO, LZF, and QuickLZ), if they were detected at configure time.
130
+ To benchmark using a given file, give the compression algorithm you want to test
131
+ Snappy against (e.g. --zlib) and then a list of one or more file names on the
132
+ command line. The testdata/ directory contains the files used by the
133
+ microbenchmark, which should provide a reasonably balanced starting point for
134
+ benchmarking. (Note that baddata[1-3].snappy are not intended as benchmarks; they
135
+ are used to verify correctness in the presence of corrupted data in the unit
136
+ test.)
137
+
138
+
139
+ Contact
140
+ =======
141
+
142
+ Snappy is distributed through GitHub. For the latest version, a bug tracker,
143
+ and other information, see
144
+
145
+ http://google.github.io/snappy/
146
+
147
+ or the repository at
148
+
149
+ https://github.com/google/snappy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "5.2.35",
3
+ "version": "5.2.38",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
Binary file
Binary file
@@ -1,7 +0,0 @@
1
- macro(get_cxx_std_flags FLAGS_VARIABLE)
2
- if( CMAKE_CXX_STANDARD_REQUIRED )
3
- set(${FLAGS_VARIABLE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION})
4
- else()
5
- set(${FLAGS_VARIABLE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION})
6
- endif()
7
- endmacro()
@@ -1,29 +0,0 @@
1
- # - Find JeMalloc library
2
- # Find the native JeMalloc includes and library
3
- #
4
- # JeMalloc_INCLUDE_DIRS - where to find jemalloc.h, etc.
5
- # JeMalloc_LIBRARIES - List of libraries when using jemalloc.
6
- # JeMalloc_FOUND - True if jemalloc found.
7
-
8
- find_path(JeMalloc_INCLUDE_DIRS
9
- NAMES jemalloc/jemalloc.h
10
- HINTS ${JEMALLOC_ROOT_DIR}/include)
11
-
12
- find_library(JeMalloc_LIBRARIES
13
- NAMES jemalloc
14
- HINTS ${JEMALLOC_ROOT_DIR}/lib)
15
-
16
- include(FindPackageHandleStandardArgs)
17
- find_package_handle_standard_args(JeMalloc DEFAULT_MSG JeMalloc_LIBRARIES JeMalloc_INCLUDE_DIRS)
18
-
19
- mark_as_advanced(
20
- JeMalloc_LIBRARIES
21
- JeMalloc_INCLUDE_DIRS)
22
-
23
- if(JeMalloc_FOUND AND NOT (TARGET JeMalloc::JeMalloc))
24
- add_library (JeMalloc::JeMalloc UNKNOWN IMPORTED)
25
- set_target_properties(JeMalloc::JeMalloc
26
- PROPERTIES
27
- IMPORTED_LOCATION ${JeMalloc_LIBRARIES}
28
- INTERFACE_INCLUDE_DIRECTORIES ${JeMalloc_INCLUDE_DIRS})
29
- endif()
@@ -1,29 +0,0 @@
1
- # - Find NUMA
2
- # Find the NUMA library and includes
3
- #
4
- # NUMA_INCLUDE_DIRS - where to find numa.h, etc.
5
- # NUMA_LIBRARIES - List of libraries when using NUMA.
6
- # NUMA_FOUND - True if NUMA found.
7
-
8
- find_path(NUMA_INCLUDE_DIRS
9
- NAMES numa.h numaif.h
10
- HINTS ${NUMA_ROOT_DIR}/include)
11
-
12
- find_library(NUMA_LIBRARIES
13
- NAMES numa
14
- HINTS ${NUMA_ROOT_DIR}/lib)
15
-
16
- include(FindPackageHandleStandardArgs)
17
- find_package_handle_standard_args(NUMA DEFAULT_MSG NUMA_LIBRARIES NUMA_INCLUDE_DIRS)
18
-
19
- mark_as_advanced(
20
- NUMA_LIBRARIES
21
- NUMA_INCLUDE_DIRS)
22
-
23
- if(NUMA_FOUND AND NOT (TARGET NUMA::NUMA))
24
- add_library (NUMA::NUMA UNKNOWN IMPORTED)
25
- set_target_properties(NUMA::NUMA
26
- PROPERTIES
27
- IMPORTED_LOCATION ${NUMA_LIBRARIES}
28
- INTERFACE_INCLUDE_DIRECTORIES ${NUMA_INCLUDE_DIRS})
29
- endif()
@@ -1,29 +0,0 @@
1
- # - Find Snappy
2
- # Find the snappy compression library and includes
3
- #
4
- # Snappy_INCLUDE_DIRS - where to find snappy.h, etc.
5
- # Snappy_LIBRARIES - List of libraries when using snappy.
6
- # Snappy_FOUND - True if snappy found.
7
-
8
- find_path(Snappy_INCLUDE_DIRS
9
- NAMES snappy.h
10
- HINTS ${snappy_ROOT_DIR}/include)
11
-
12
- find_library(Snappy_LIBRARIES
13
- NAMES snappy
14
- HINTS ${snappy_ROOT_DIR}/lib)
15
-
16
- include(FindPackageHandleStandardArgs)
17
- find_package_handle_standard_args(Snappy DEFAULT_MSG Snappy_LIBRARIES Snappy_INCLUDE_DIRS)
18
-
19
- mark_as_advanced(
20
- Snappy_LIBRARIES
21
- Snappy_INCLUDE_DIRS)
22
-
23
- if(Snappy_FOUND AND NOT (TARGET Snappy::snappy))
24
- add_library (Snappy::snappy UNKNOWN IMPORTED)
25
- set_target_properties(Snappy::snappy
26
- PROPERTIES
27
- IMPORTED_LOCATION ${Snappy_LIBRARIES}
28
- INTERFACE_INCLUDE_DIRECTORIES ${Snappy_INCLUDE_DIRS})
29
- endif()
@@ -1,33 +0,0 @@
1
- # - Find TBB
2
- # Find the Thread Building Blocks library and includes
3
- #
4
- # TBB_INCLUDE_DIRS - where to find tbb.h, etc.
5
- # TBB_LIBRARIES - List of libraries when using TBB.
6
- # TBB_FOUND - True if TBB found.
7
-
8
- if(NOT DEFINED TBB_ROOT_DIR)
9
- set(TBB_ROOT_DIR "$ENV{TBBROOT}")
10
- endif()
11
-
12
- find_path(TBB_INCLUDE_DIRS
13
- NAMES tbb/tbb.h
14
- HINTS ${TBB_ROOT_DIR}/include)
15
-
16
- find_library(TBB_LIBRARIES
17
- NAMES tbb
18
- HINTS ${TBB_ROOT_DIR}/lib ENV LIBRARY_PATH)
19
-
20
- include(FindPackageHandleStandardArgs)
21
- find_package_handle_standard_args(TBB DEFAULT_MSG TBB_LIBRARIES TBB_INCLUDE_DIRS)
22
-
23
- mark_as_advanced(
24
- TBB_LIBRARIES
25
- TBB_INCLUDE_DIRS)
26
-
27
- if(TBB_FOUND AND NOT (TARGET TBB::TBB))
28
- add_library (TBB::TBB UNKNOWN IMPORTED)
29
- set_target_properties(TBB::TBB
30
- PROPERTIES
31
- IMPORTED_LOCATION ${TBB_LIBRARIES}
32
- INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS})
33
- endif()
@@ -1,29 +0,0 @@
1
- # - Find gflags library
2
- # Find the gflags includes and library
3
- #
4
- # GFLAGS_INCLUDE_DIR - where to find gflags.h.
5
- # GFLAGS_LIBRARIES - List of libraries when using gflags.
6
- # gflags_FOUND - True if gflags found.
7
-
8
- find_path(GFLAGS_INCLUDE_DIR
9
- NAMES gflags/gflags.h)
10
-
11
- find_library(GFLAGS_LIBRARIES
12
- NAMES gflags)
13
-
14
- include(FindPackageHandleStandardArgs)
15
- find_package_handle_standard_args(gflags
16
- DEFAULT_MSG GFLAGS_LIBRARIES GFLAGS_INCLUDE_DIR)
17
-
18
- mark_as_advanced(
19
- GFLAGS_LIBRARIES
20
- GFLAGS_INCLUDE_DIR)
21
-
22
- if(gflags_FOUND AND NOT (TARGET gflags::gflags))
23
- add_library(gflags::gflags UNKNOWN IMPORTED)
24
- set_target_properties(gflags::gflags
25
- PROPERTIES
26
- IMPORTED_LOCATION ${GFLAGS_LIBRARIES}
27
- INTERFACE_INCLUDE_DIRECTORIES ${GFLAGS_INCLUDE_DIR}
28
- IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
29
- endif()
@@ -1,29 +0,0 @@
1
- # - Find Lz4
2
- # Find the lz4 compression library and includes
3
- #
4
- # lz4_INCLUDE_DIRS - where to find lz4.h, etc.
5
- # lz4_LIBRARIES - List of libraries when using lz4.
6
- # lz4_FOUND - True if lz4 found.
7
-
8
- find_path(lz4_INCLUDE_DIRS
9
- NAMES lz4.h
10
- HINTS ${lz4_ROOT_DIR}/include)
11
-
12
- find_library(lz4_LIBRARIES
13
- NAMES lz4
14
- HINTS ${lz4_ROOT_DIR}/lib)
15
-
16
- include(FindPackageHandleStandardArgs)
17
- find_package_handle_standard_args(lz4 DEFAULT_MSG lz4_LIBRARIES lz4_INCLUDE_DIRS)
18
-
19
- mark_as_advanced(
20
- lz4_LIBRARIES
21
- lz4_INCLUDE_DIRS)
22
-
23
- if(lz4_FOUND AND NOT (TARGET lz4::lz4))
24
- add_library(lz4::lz4 UNKNOWN IMPORTED)
25
- set_target_properties(lz4::lz4
26
- PROPERTIES
27
- IMPORTED_LOCATION ${lz4_LIBRARIES}
28
- INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIRS})
29
- endif()
@@ -1,26 +0,0 @@
1
- # - Find liburing
2
- #
3
- # uring_INCLUDE_DIR - Where to find liburing.h
4
- # uring_LIBRARIES - List of libraries when using uring.
5
- # uring_FOUND - True if uring found.
6
-
7
- find_path(uring_INCLUDE_DIR
8
- NAMES liburing.h)
9
- find_library(uring_LIBRARIES
10
- NAMES liburing.a liburing)
11
-
12
- include(FindPackageHandleStandardArgs)
13
- find_package_handle_standard_args(uring
14
- DEFAULT_MSG uring_LIBRARIES uring_INCLUDE_DIR)
15
-
16
- mark_as_advanced(
17
- uring_INCLUDE_DIR
18
- uring_LIBRARIES)
19
-
20
- if(uring_FOUND AND NOT TARGET uring::uring)
21
- add_library(uring::uring UNKNOWN IMPORTED)
22
- set_target_properties(uring::uring PROPERTIES
23
- INTERFACE_INCLUDE_DIRECTORIES "${uring_INCLUDE_DIR}"
24
- IMPORTED_LINK_INTERFACE_LANGUAGES "C"
25
- IMPORTED_LOCATION "${uring_LIBRARIES}")
26
- endif()