@nxtedition/rocksdb 7.0.4 → 7.0.5

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 (135) hide show
  1. package/deps/liburing/liburing/README +46 -0
  2. package/deps/liburing/liburing/test/232c93d07b74-test.c +305 -0
  3. package/deps/liburing/liburing/test/35fa71a030ca-test.c +329 -0
  4. package/deps/liburing/liburing/test/500f9fbadef8-test.c +89 -0
  5. package/deps/liburing/liburing/test/7ad0e4b2f83c-test.c +93 -0
  6. package/deps/liburing/liburing/test/8a9973408177-test.c +106 -0
  7. package/deps/liburing/liburing/test/917257daa0fe-test.c +53 -0
  8. package/deps/liburing/liburing/test/Makefile +312 -0
  9. package/deps/liburing/liburing/test/a0908ae19763-test.c +58 -0
  10. package/deps/liburing/liburing/test/a4c0b3decb33-test.c +180 -0
  11. package/deps/liburing/liburing/test/accept-link.c +251 -0
  12. package/deps/liburing/liburing/test/accept-reuse.c +164 -0
  13. package/deps/liburing/liburing/test/accept-test.c +79 -0
  14. package/deps/liburing/liburing/test/accept.c +476 -0
  15. package/deps/liburing/liburing/test/across-fork.c +283 -0
  16. package/deps/liburing/liburing/test/b19062a56726-test.c +53 -0
  17. package/deps/liburing/liburing/test/b5837bd5311d-test.c +77 -0
  18. package/deps/liburing/liburing/test/ce593a6c480a-test.c +135 -0
  19. package/deps/liburing/liburing/test/close-opath.c +122 -0
  20. package/deps/liburing/liburing/test/config +10 -0
  21. package/deps/liburing/liburing/test/connect.c +398 -0
  22. package/deps/liburing/liburing/test/cq-full.c +96 -0
  23. package/deps/liburing/liburing/test/cq-overflow.c +294 -0
  24. package/deps/liburing/liburing/test/cq-peek-batch.c +102 -0
  25. package/deps/liburing/liburing/test/cq-ready.c +94 -0
  26. package/deps/liburing/liburing/test/cq-size.c +58 -0
  27. package/deps/liburing/liburing/test/d4ae271dfaae-test.c +96 -0
  28. package/deps/liburing/liburing/test/d77a67ed5f27-test.c +65 -0
  29. package/deps/liburing/liburing/test/defer.c +307 -0
  30. package/deps/liburing/liburing/test/double-poll-crash.c +186 -0
  31. package/deps/liburing/liburing/test/eeed8b54e0df-test.c +114 -0
  32. package/deps/liburing/liburing/test/empty-eownerdead.c +42 -0
  33. package/deps/liburing/liburing/test/eventfd-disable.c +151 -0
  34. package/deps/liburing/liburing/test/eventfd-ring.c +97 -0
  35. package/deps/liburing/liburing/test/eventfd.c +112 -0
  36. package/deps/liburing/liburing/test/fadvise.c +202 -0
  37. package/deps/liburing/liburing/test/fallocate.c +249 -0
  38. package/deps/liburing/liburing/test/fc2a85cb02ef-test.c +138 -0
  39. package/deps/liburing/liburing/test/file-register.c +843 -0
  40. package/deps/liburing/liburing/test/file-update.c +173 -0
  41. package/deps/liburing/liburing/test/files-exit-hang-poll.c +128 -0
  42. package/deps/liburing/liburing/test/files-exit-hang-timeout.c +134 -0
  43. package/deps/liburing/liburing/test/fixed-link.c +90 -0
  44. package/deps/liburing/liburing/test/fsync.c +224 -0
  45. package/deps/liburing/liburing/test/hardlink.c +136 -0
  46. package/deps/liburing/liburing/test/helpers.c +135 -0
  47. package/deps/liburing/liburing/test/helpers.h +67 -0
  48. package/deps/liburing/liburing/test/io-cancel.c +537 -0
  49. package/deps/liburing/liburing/test/io_uring_enter.c +296 -0
  50. package/deps/liburing/liburing/test/io_uring_register.c +664 -0
  51. package/deps/liburing/liburing/test/io_uring_setup.c +192 -0
  52. package/deps/liburing/liburing/test/iopoll.c +366 -0
  53. package/deps/liburing/liburing/test/lfs-openat-write.c +117 -0
  54. package/deps/liburing/liburing/test/lfs-openat.c +273 -0
  55. package/deps/liburing/liburing/test/link-timeout.c +1107 -0
  56. package/deps/liburing/liburing/test/link.c +496 -0
  57. package/deps/liburing/liburing/test/link_drain.c +229 -0
  58. package/deps/liburing/liburing/test/madvise.c +195 -0
  59. package/deps/liburing/liburing/test/mkdir.c +108 -0
  60. package/deps/liburing/liburing/test/multicqes_drain.c +383 -0
  61. package/deps/liburing/liburing/test/nop-all-sizes.c +107 -0
  62. package/deps/liburing/liburing/test/nop.c +115 -0
  63. package/deps/liburing/liburing/test/open-close.c +146 -0
  64. package/deps/liburing/liburing/test/openat2.c +240 -0
  65. package/deps/liburing/liburing/test/personality.c +204 -0
  66. package/deps/liburing/liburing/test/pipe-eof.c +81 -0
  67. package/deps/liburing/liburing/test/pipe-reuse.c +105 -0
  68. package/deps/liburing/liburing/test/poll-cancel-ton.c +139 -0
  69. package/deps/liburing/liburing/test/poll-cancel.c +135 -0
  70. package/deps/liburing/liburing/test/poll-link.c +227 -0
  71. package/deps/liburing/liburing/test/poll-many.c +208 -0
  72. package/deps/liburing/liburing/test/poll-mshot-update.c +273 -0
  73. package/deps/liburing/liburing/test/poll-ring.c +48 -0
  74. package/deps/liburing/liburing/test/poll-v-poll.c +353 -0
  75. package/deps/liburing/liburing/test/poll.c +109 -0
  76. package/deps/liburing/liburing/test/probe.c +137 -0
  77. package/deps/liburing/liburing/test/read-write.c +876 -0
  78. package/deps/liburing/liburing/test/register-restrictions.c +633 -0
  79. package/deps/liburing/liburing/test/rename.c +134 -0
  80. package/deps/liburing/liburing/test/ring-leak.c +173 -0
  81. package/deps/liburing/liburing/test/ring-leak2.c +249 -0
  82. package/deps/liburing/liburing/test/rsrc_tags.c +449 -0
  83. package/deps/liburing/liburing/test/runtests-loop.sh +16 -0
  84. package/deps/liburing/liburing/test/runtests.sh +170 -0
  85. package/deps/liburing/liburing/test/rw_merge_test.c +97 -0
  86. package/deps/liburing/liburing/test/self.c +91 -0
  87. package/deps/liburing/liburing/test/send_recv.c +291 -0
  88. package/deps/liburing/liburing/test/send_recvmsg.c +345 -0
  89. package/deps/liburing/liburing/test/sendmsg_fs_cve.c +198 -0
  90. package/deps/liburing/liburing/test/shared-wq.c +84 -0
  91. package/deps/liburing/liburing/test/short-read.c +75 -0
  92. package/deps/liburing/liburing/test/shutdown.c +163 -0
  93. package/deps/liburing/liburing/test/sigfd-deadlock.c +74 -0
  94. package/deps/liburing/liburing/test/socket-rw-eagain.c +156 -0
  95. package/deps/liburing/liburing/test/socket-rw.c +147 -0
  96. package/deps/liburing/liburing/test/splice.c +511 -0
  97. package/deps/liburing/liburing/test/sq-full-cpp.cc +45 -0
  98. package/deps/liburing/liburing/test/sq-full.c +45 -0
  99. package/deps/liburing/liburing/test/sq-poll-dup.c +200 -0
  100. package/deps/liburing/liburing/test/sq-poll-kthread.c +168 -0
  101. package/deps/liburing/liburing/test/sq-poll-share.c +137 -0
  102. package/deps/liburing/liburing/test/sq-space_left.c +159 -0
  103. package/deps/liburing/liburing/test/sqpoll-cancel-hang.c +159 -0
  104. package/deps/liburing/liburing/test/sqpoll-disable-exit.c +195 -0
  105. package/deps/liburing/liburing/test/sqpoll-exit-hang.c +77 -0
  106. package/deps/liburing/liburing/test/sqpoll-sleep.c +68 -0
  107. package/deps/liburing/liburing/test/statx.c +172 -0
  108. package/deps/liburing/liburing/test/stdout.c +232 -0
  109. package/deps/liburing/liburing/test/submit-link-fail.c +154 -0
  110. package/deps/liburing/liburing/test/submit-reuse.c +239 -0
  111. package/deps/liburing/liburing/test/symlink.c +116 -0
  112. package/deps/liburing/liburing/test/teardowns.c +58 -0
  113. package/deps/liburing/liburing/test/thread-exit.c +131 -0
  114. package/deps/liburing/liburing/test/timeout-new.c +246 -0
  115. package/deps/liburing/liburing/test/timeout-overflow.c +204 -0
  116. package/deps/liburing/liburing/test/timeout.c +1354 -0
  117. package/deps/liburing/liburing/test/unlink.c +111 -0
  118. package/deps/liburing/liburing/test/wakeup-hang.c +162 -0
  119. package/deps/rocksdb/rocksdb/README.md +32 -0
  120. package/deps/rocksdb/rocksdb/microbench/README.md +60 -0
  121. package/deps/rocksdb/rocksdb/plugin/README.md +43 -0
  122. package/deps/rocksdb/rocksdb/port/README +10 -0
  123. package/deps/rocksdb/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +13 -0
  124. package/package.json +1 -1
  125. package/deps/rocksdb/rocksdb/cmake/modules/CxxFlags.cmake +0 -7
  126. package/deps/rocksdb/rocksdb/cmake/modules/FindJeMalloc.cmake +0 -29
  127. package/deps/rocksdb/rocksdb/cmake/modules/FindNUMA.cmake +0 -29
  128. package/deps/rocksdb/rocksdb/cmake/modules/FindSnappy.cmake +0 -29
  129. package/deps/rocksdb/rocksdb/cmake/modules/FindTBB.cmake +0 -33
  130. package/deps/rocksdb/rocksdb/cmake/modules/Findgflags.cmake +0 -29
  131. package/deps/rocksdb/rocksdb/cmake/modules/Findlz4.cmake +0 -29
  132. package/deps/rocksdb/rocksdb/cmake/modules/Finduring.cmake +0 -26
  133. package/deps/rocksdb/rocksdb/cmake/modules/Findzstd.cmake +0 -29
  134. package/deps/rocksdb/rocksdb/cmake/modules/ReadVersion.cmake +0 -10
  135. package/package-lock.json +0 -23687
@@ -0,0 +1,111 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ /*
3
+ * Description: run various nop tests
4
+ *
5
+ */
6
+ #include <errno.h>
7
+ #include <stdio.h>
8
+ #include <unistd.h>
9
+ #include <stdlib.h>
10
+ #include <string.h>
11
+ #include <fcntl.h>
12
+
13
+ #include "liburing.h"
14
+
15
+ static int test_unlink(struct io_uring *ring, const char *old)
16
+ {
17
+ struct io_uring_cqe *cqe;
18
+ struct io_uring_sqe *sqe;
19
+ int ret;
20
+
21
+ sqe = io_uring_get_sqe(ring);
22
+ if (!sqe) {
23
+ fprintf(stderr, "get sqe failed\n");
24
+ goto err;
25
+ }
26
+ io_uring_prep_unlinkat(sqe, AT_FDCWD, old, 0);
27
+
28
+ ret = io_uring_submit(ring);
29
+ if (ret <= 0) {
30
+ fprintf(stderr, "sqe submit failed: %d\n", ret);
31
+ goto err;
32
+ }
33
+
34
+ ret = io_uring_wait_cqe(ring, &cqe);
35
+ if (ret < 0) {
36
+ fprintf(stderr, "wait completion %d\n", ret);
37
+ goto err;
38
+ }
39
+ ret = cqe->res;
40
+ io_uring_cqe_seen(ring, cqe);
41
+ return ret;
42
+ err:
43
+ return 1;
44
+ }
45
+
46
+ static int stat_file(const char *buf)
47
+ {
48
+ struct stat sb;
49
+
50
+ if (!stat(buf, &sb))
51
+ return 0;
52
+
53
+ return errno;
54
+ }
55
+
56
+ int main(int argc, char *argv[])
57
+ {
58
+ struct io_uring ring;
59
+ char buf[32] = "./XXXXXX";
60
+ int ret;
61
+
62
+ if (argc > 1)
63
+ return 0;
64
+
65
+ ret = io_uring_queue_init(1, &ring, 0);
66
+ if (ret) {
67
+ fprintf(stderr, "ring setup failed: %d\n", ret);
68
+ return 1;
69
+ }
70
+
71
+ ret = mkstemp(buf);
72
+ if (ret < 0) {
73
+ perror("mkstemp");
74
+ return 1;
75
+ }
76
+ close(ret);
77
+
78
+ if (stat_file(buf) != 0) {
79
+ perror("stat");
80
+ return 1;
81
+ }
82
+
83
+ ret = test_unlink(&ring, buf);
84
+ if (ret < 0) {
85
+ if (ret == -EBADF || ret == -EINVAL) {
86
+ fprintf(stdout, "Unlink not supported, skipping\n");
87
+ unlink(buf);
88
+ return 0;
89
+ }
90
+ fprintf(stderr, "rename: %s\n", strerror(-ret));
91
+ goto err;
92
+ } else if (ret)
93
+ goto err;
94
+
95
+ ret = stat_file(buf);
96
+ if (ret != ENOENT) {
97
+ fprintf(stderr, "stat got %s\n", strerror(ret));
98
+ return 1;
99
+ }
100
+
101
+ ret = test_unlink(&ring, "/3/2/3/1/z/y");
102
+ if (ret != -ENOENT) {
103
+ fprintf(stderr, "invalid unlink got %s\n", strerror(-ret));
104
+ return 1;
105
+ }
106
+
107
+ return 0;
108
+ err:
109
+ unlink(buf);
110
+ return 1;
111
+ }
@@ -0,0 +1,162 @@
1
+ /* SPDX-License-Identifier: MIT */
2
+ #include <sys/eventfd.h>
3
+ #include <unistd.h>
4
+ #include <stdio.h>
5
+ #include <stdlib.h>
6
+ #include <string.h>
7
+ #include <pthread.h>
8
+ #include <liburing.h>
9
+ #include <fcntl.h>
10
+ #include <poll.h>
11
+ #include <sys/time.h>
12
+
13
+ struct thread_data {
14
+ struct io_uring *ring;
15
+ int write_fd;
16
+ };
17
+
18
+ static void error_exit(char *message)
19
+ {
20
+ perror(message);
21
+ exit(1);
22
+ }
23
+
24
+ static void *listener_thread(void *data)
25
+ {
26
+ struct thread_data *td = data;
27
+ struct io_uring_cqe *cqe;
28
+ int ret;
29
+
30
+ ret = io_uring_wait_cqe(td->ring, &cqe);
31
+ if (ret < 0) {
32
+ fprintf(stderr, "Error waiting for completion: %s\n",
33
+ strerror(-ret));
34
+ goto err;
35
+ }
36
+ if (cqe->res < 0) {
37
+ fprintf(stderr, "Error in async operation: %s\n", strerror(-cqe->res));
38
+ goto err;
39
+ }
40
+ io_uring_cqe_seen(td->ring, cqe);
41
+ return NULL;
42
+ err:
43
+ return (void *) 1;
44
+ }
45
+
46
+ static void *wakeup_io_uring(void *data)
47
+ {
48
+ struct thread_data *td = data;
49
+ int res;
50
+
51
+ res = eventfd_write(td->write_fd, (eventfd_t) 1L);
52
+ if (res < 0) {
53
+ perror("eventfd_write");
54
+ return (void *) 1;
55
+ }
56
+ return NULL;
57
+ }
58
+
59
+ static int test_pipes(void)
60
+ {
61
+ struct io_uring_sqe *sqe;
62
+ struct thread_data td;
63
+ struct io_uring ring;
64
+ pthread_t t1, t2;
65
+ int ret, fds[2];
66
+ void *pret;
67
+
68
+ if (pipe(fds) < 0)
69
+ error_exit("eventfd");
70
+
71
+ ret = io_uring_queue_init(8, &ring, 0);
72
+ if (ret) {
73
+ fprintf(stderr, "Unable to setup io_uring: %s\n", strerror(-ret));
74
+ return 1;
75
+ }
76
+
77
+ td.write_fd = fds[1];
78
+ td.ring = &ring;
79
+
80
+ sqe = io_uring_get_sqe(&ring);
81
+ io_uring_prep_poll_add(sqe, fds[0], POLLIN);
82
+ sqe->user_data = 2;
83
+ ret = io_uring_submit(&ring);
84
+ if (ret != 1) {
85
+ fprintf(stderr, "ring_submit=%d\n", ret);
86
+ return 1;
87
+ }
88
+
89
+ pthread_create(&t1, NULL, listener_thread, &td);
90
+
91
+ sleep(1);
92
+
93
+ pthread_create(&t2, NULL, wakeup_io_uring, &td);
94
+ pthread_join(t1, &pret);
95
+
96
+ io_uring_queue_exit(&ring);
97
+ return pret != NULL;
98
+ }
99
+
100
+ static int test_eventfd(void)
101
+ {
102
+ struct io_uring_sqe *sqe;
103
+ struct thread_data td;
104
+ struct io_uring ring;
105
+ pthread_t t1, t2;
106
+ int efd, ret;
107
+ void *pret;
108
+
109
+ efd = eventfd(0, 0);
110
+ if (efd < 0)
111
+ error_exit("eventfd");
112
+
113
+ ret = io_uring_queue_init(8, &ring, 0);
114
+ if (ret) {
115
+ fprintf(stderr, "Unable to setup io_uring: %s\n", strerror(-ret));
116
+ return 1;
117
+ }
118
+
119
+ td.write_fd = efd;
120
+ td.ring = &ring;
121
+
122
+ sqe = io_uring_get_sqe(&ring);
123
+ io_uring_prep_poll_add(sqe, efd, POLLIN);
124
+ sqe->user_data = 2;
125
+ ret = io_uring_submit(&ring);
126
+ if (ret != 1) {
127
+ fprintf(stderr, "ring_submit=%d\n", ret);
128
+ return 1;
129
+ }
130
+
131
+ pthread_create(&t1, NULL, listener_thread, &td);
132
+
133
+ sleep(1);
134
+
135
+ pthread_create(&t2, NULL, wakeup_io_uring, &td);
136
+ pthread_join(t1, &pret);
137
+
138
+ io_uring_queue_exit(&ring);
139
+ return pret != NULL;
140
+ }
141
+
142
+ int main(int argc, char *argv[])
143
+ {
144
+ int ret;
145
+
146
+ if (argc > 1)
147
+ return 0;
148
+
149
+ ret = test_pipes();
150
+ if (ret) {
151
+ fprintf(stderr, "test_pipe failed\n");
152
+ return ret;
153
+ }
154
+
155
+ ret = test_eventfd();
156
+ if (ret) {
157
+ fprintf(stderr, "test_eventfd failed\n");
158
+ return ret;
159
+ }
160
+
161
+ return 0;
162
+ }
@@ -0,0 +1,32 @@
1
+ ## RocksDB: A Persistent Key-Value Store for Flash and RAM Storage
2
+
3
+ [![CircleCI Status](https://circleci.com/gh/facebook/rocksdb.svg?style=svg)](https://circleci.com/gh/facebook/rocksdb)
4
+ [![TravisCI Status](https://api.travis-ci.com/facebook/rocksdb.svg?branch=main)](https://travis-ci.com/github/facebook/rocksdb)
5
+ [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/fbgfu0so3afcno78/branch/main?svg=true)](https://ci.appveyor.com/project/Facebook/rocksdb/branch/main)
6
+ [![PPC64le Build Status](http://140-211-168-68-openstack.osuosl.org:8080/buildStatus/icon?job=rocksdb&style=plastic)](http://140-211-168-68-openstack.osuosl.org:8080/job/rocksdb)
7
+
8
+ RocksDB is developed and maintained by Facebook Database Engineering Team.
9
+ It is built on earlier work on [LevelDB](https://github.com/google/leveldb) by Sanjay Ghemawat (sanjay@google.com)
10
+ and Jeff Dean (jeff@google.com)
11
+
12
+ This code is a library that forms the core building block for a fast
13
+ key-value server, especially suited for storing data on flash drives.
14
+ It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs
15
+ between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF)
16
+ and Space-Amplification-Factor (SAF). It has multi-threaded compactions,
17
+ making it especially suitable for storing multiple terabytes of data in a
18
+ single database.
19
+
20
+ Start with example usage here: https://github.com/facebook/rocksdb/tree/main/examples
21
+
22
+ See the [github wiki](https://github.com/facebook/rocksdb/wiki) for more explanation.
23
+
24
+ The public interface is in `include/`. Callers should not include or
25
+ rely on the details of any other header files in this package. Those
26
+ internal APIs may be changed without warning.
27
+
28
+ Questions and discussions are welcome on the [RocksDB Developers Public](https://www.facebook.com/groups/rocksdb.dev/) Facebook group and [email list](https://groups.google.com/g/rocksdb) on Google Groups.
29
+
30
+ ## License
31
+
32
+ RocksDB is dual-licensed under both the GPLv2 (found in the COPYING file in the root directory) and Apache 2.0 License (found in the LICENSE.Apache file in the root directory). You may select, at your option, one of the above-listed licenses.
@@ -0,0 +1,60 @@
1
+ # RocksDB Micro-Benchmark
2
+
3
+ ## Overview
4
+
5
+ RocksDB micro-benchmark is a set of tests for benchmarking a single component or simple DB operations. The test artificially generates input data and executes the same operation with it to collect and report performance metrics. As it's focusing on testing a single, well-defined operation, the result is more precise and reproducible, which also has its limitation of not representing a real production use case. The test author needs to carefully design the microbench to represent its true purpose.
6
+
7
+ The tests are based on [Google Benchmark](https://github.com/google/benchmark) library, which provides a standard framework for writing benchmarks.
8
+
9
+ ## How to Run
10
+ ### Prerequisite
11
+ Install the [Google Benchmark](https://github.com/google/benchmark) version `1.6.0` or above.
12
+
13
+ *Note: Google Benchmark `1.6.x` is incompatible with previous versions like `1.5.x`, please make sure you're using the newer version.*
14
+
15
+ ### Build and Run
16
+ With `Makefile`:
17
+ ```bash
18
+ $ DEBUG_LEVEL=0 make run_microbench
19
+ ```
20
+ Or with cmake:
21
+ ```bash
22
+ $ mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_BENCHMARK
23
+ $ make run_microbench
24
+ ```
25
+
26
+ *Note: Please run the benchmark code in release build.*
27
+ ### Run Single Test
28
+ Example:
29
+ ```bash
30
+ $ make db_basic_bench
31
+ $ ./db_basic_bench --benchmark_filter=<TEST_NAME>
32
+ ```
33
+
34
+ ## Best Practices
35
+ #### * Use the Same Test Directory Setting as Unittest
36
+ Most of the Micro-benchmark tests use the same test directory setup as unittest, so it could be overridden by:
37
+ ```bash
38
+ $ TEST_TMPDIR=/mydata/tmp/ ./db_basic_bench --benchmark_filter=<TEST_NAME>
39
+ ```
40
+ Please also follow that when designing new tests.
41
+
42
+ #### * Avoid Using Debug API
43
+ Even though micro-benchmark is a test, avoid using internal Debug API like TEST_WaitForRun() which is designed for unittest. As benchmark tests are designed for release build, don't use any of that.
44
+
45
+ #### * Pay Attention to Local Optimization
46
+ As a micro-benchmark is focusing on a single component or area, make sure it is a key part for impacting the overall application performance.
47
+
48
+ The compiler might be able to optimize the code that not the same way as the whole application, and if the test data input is simple and small, it may be able to all cached in CPU memory, which is leading to a wrong metric. Take these into consideration when designing the tests.
49
+
50
+ #### * Names of user-defined counters/metrics has to be `[A-Za-z0-9_]`
51
+ It's a restriction of the metrics collecting and reporting system RocksDB is using internally. It will also help integrate with more systems.
52
+
53
+ #### * Minimize the Metrics Variation
54
+ Try reducing the test result variation, one way to check that is running the test multiple times and check the CV (Coefficient of Variation) reported by gbenchmark.
55
+ ```bash
56
+ $ ./db_basic_bench --benchmark_filter=<TEST_NAME> --benchmark_repetitions=10
57
+ ...
58
+ <TEST_NAME>_cv 3.2%
59
+ ```
60
+ RocksDB has background compaction jobs which may cause the test result to vary a lot. If the micro-benchmark is not purposely testing the operation while compaction is in progress, it should wait for the compaction to finish (`db_impl->WaitForCompact()`) or disable auto-compaction.
@@ -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
+
@@ -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
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "7.0.4",
3
+ "version": "7.0.5",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -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()