rn-leveldb 3.11.0

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 (595) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +92 -0
  3. package/android/.project +34 -0
  4. package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
  5. package/android/CMakeLists.txt +69 -0
  6. package/android/build.gradle +125 -0
  7. package/android/cpp-adapter.cpp +19 -0
  8. package/android/gradle.properties +6 -0
  9. package/android/src/main/AndroidManifest.xml +4 -0
  10. package/android/src/main/java/com/reactnativeleveldb/LeveldbModule.java +57 -0
  11. package/android/src/main/java/com/reactnativeleveldb/LeveldbPackage.java +28 -0
  12. package/cpp/leveldb/.appveyor.yml +36 -0
  13. package/cpp/leveldb/.clang-format +18 -0
  14. package/cpp/leveldb/.travis.yml +88 -0
  15. package/cpp/leveldb/AUTHORS +12 -0
  16. package/cpp/leveldb/CMakeLists.txt +495 -0
  17. package/cpp/leveldb/CONTRIBUTING.md +36 -0
  18. package/cpp/leveldb/LICENSE +27 -0
  19. package/cpp/leveldb/NEWS +17 -0
  20. package/cpp/leveldb/README.md +231 -0
  21. package/cpp/leveldb/TODO +14 -0
  22. package/cpp/leveldb/benchmarks/db_bench.cc +990 -0
  23. package/cpp/leveldb/benchmarks/db_bench_sqlite3.cc +726 -0
  24. package/cpp/leveldb/benchmarks/db_bench_tree_db.cc +531 -0
  25. package/cpp/leveldb/cmake/leveldbConfig.cmake.in +9 -0
  26. package/cpp/leveldb/db/autocompact_test.cc +115 -0
  27. package/cpp/leveldb/db/builder.cc +82 -0
  28. package/cpp/leveldb/db/builder.h +30 -0
  29. package/cpp/leveldb/db/c.cc +562 -0
  30. package/cpp/leveldb/db/c_test.c +384 -0
  31. package/cpp/leveldb/db/corruption_test.cc +367 -0
  32. package/cpp/leveldb/db/db_impl.cc +1554 -0
  33. package/cpp/leveldb/db/db_impl.h +217 -0
  34. package/cpp/leveldb/db/db_iter.cc +318 -0
  35. package/cpp/leveldb/db/db_iter.h +26 -0
  36. package/cpp/leveldb/db/db_test.cc +2305 -0
  37. package/cpp/leveldb/db/dbformat.cc +136 -0
  38. package/cpp/leveldb/db/dbformat.h +224 -0
  39. package/cpp/leveldb/db/dbformat_test.cc +133 -0
  40. package/cpp/leveldb/db/dumpfile.cc +232 -0
  41. package/cpp/leveldb/db/fault_injection_test.cc +555 -0
  42. package/cpp/leveldb/db/filename.cc +141 -0
  43. package/cpp/leveldb/db/filename.h +83 -0
  44. package/cpp/leveldb/db/filename_test.cc +132 -0
  45. package/cpp/leveldb/db/leveldbutil.cc +64 -0
  46. package/cpp/leveldb/db/log_format.h +35 -0
  47. package/cpp/leveldb/db/log_reader.cc +274 -0
  48. package/cpp/leveldb/db/log_reader.h +112 -0
  49. package/cpp/leveldb/db/log_test.cc +563 -0
  50. package/cpp/leveldb/db/log_writer.cc +111 -0
  51. package/cpp/leveldb/db/log_writer.h +54 -0
  52. package/cpp/leveldb/db/memtable.cc +137 -0
  53. package/cpp/leveldb/db/memtable.h +87 -0
  54. package/cpp/leveldb/db/recovery_test.cc +339 -0
  55. package/cpp/leveldb/db/repair.cc +451 -0
  56. package/cpp/leveldb/db/skiplist.h +382 -0
  57. package/cpp/leveldb/db/skiplist_test.cc +373 -0
  58. package/cpp/leveldb/db/snapshot.h +95 -0
  59. package/cpp/leveldb/db/table_cache.cc +120 -0
  60. package/cpp/leveldb/db/table_cache.h +57 -0
  61. package/cpp/leveldb/db/version_edit.cc +257 -0
  62. package/cpp/leveldb/db/version_edit.h +106 -0
  63. package/cpp/leveldb/db/version_edit_test.cc +46 -0
  64. package/cpp/leveldb/db/version_set.cc +1562 -0
  65. package/cpp/leveldb/db/version_set.h +393 -0
  66. package/cpp/leveldb/db/version_set_test.cc +336 -0
  67. package/cpp/leveldb/db/write_batch.cc +150 -0
  68. package/cpp/leveldb/db/write_batch_internal.h +45 -0
  69. package/cpp/leveldb/db/write_batch_test.cc +137 -0
  70. package/cpp/leveldb/doc/benchmark.html +459 -0
  71. package/cpp/leveldb/doc/impl.md +172 -0
  72. package/cpp/leveldb/doc/index.md +523 -0
  73. package/cpp/leveldb/doc/log_format.md +75 -0
  74. package/cpp/leveldb/doc/table_format.md +107 -0
  75. package/cpp/leveldb/helpers/memenv/memenv.cc +390 -0
  76. package/cpp/leveldb/helpers/memenv/memenv.h +22 -0
  77. package/cpp/leveldb/helpers/memenv/memenv_test.cc +264 -0
  78. package/cpp/leveldb/include/leveldb/c.h +270 -0
  79. package/cpp/leveldb/include/leveldb/cache.h +111 -0
  80. package/cpp/leveldb/include/leveldb/comparator.h +64 -0
  81. package/cpp/leveldb/include/leveldb/db.h +167 -0
  82. package/cpp/leveldb/include/leveldb/dumpfile.h +28 -0
  83. package/cpp/leveldb/include/leveldb/env.h +417 -0
  84. package/cpp/leveldb/include/leveldb/export.h +33 -0
  85. package/cpp/leveldb/include/leveldb/filter_policy.h +72 -0
  86. package/cpp/leveldb/include/leveldb/iterator.h +112 -0
  87. package/cpp/leveldb/include/leveldb/options.h +187 -0
  88. package/cpp/leveldb/include/leveldb/slice.h +114 -0
  89. package/cpp/leveldb/include/leveldb/status.h +122 -0
  90. package/cpp/leveldb/include/leveldb/table.h +84 -0
  91. package/cpp/leveldb/include/leveldb/table_builder.h +93 -0
  92. package/cpp/leveldb/include/leveldb/write_batch.h +83 -0
  93. package/cpp/leveldb/issues/issue178_test.cc +90 -0
  94. package/cpp/leveldb/issues/issue200_test.cc +59 -0
  95. package/cpp/leveldb/issues/issue320_test.cc +131 -0
  96. package/cpp/leveldb/port/README.md +10 -0
  97. package/cpp/leveldb/port/port.h +19 -0
  98. package/cpp/leveldb/port/port_config.h.in +33 -0
  99. package/cpp/leveldb/port/port_example.h +100 -0
  100. package/cpp/leveldb/port/port_stdcxx.h +151 -0
  101. package/cpp/leveldb/port/thread_annotations.h +108 -0
  102. package/cpp/leveldb/table/block.cc +267 -0
  103. package/cpp/leveldb/table/block.h +44 -0
  104. package/cpp/leveldb/table/block_builder.cc +107 -0
  105. package/cpp/leveldb/table/block_builder.h +54 -0
  106. package/cpp/leveldb/table/filter_block.cc +106 -0
  107. package/cpp/leveldb/table/filter_block.h +68 -0
  108. package/cpp/leveldb/table/filter_block_test.cc +127 -0
  109. package/cpp/leveldb/table/format.cc +141 -0
  110. package/cpp/leveldb/table/format.h +99 -0
  111. package/cpp/leveldb/table/iterator.cc +76 -0
  112. package/cpp/leveldb/table/iterator_wrapper.h +92 -0
  113. package/cpp/leveldb/table/merger.cc +191 -0
  114. package/cpp/leveldb/table/merger.h +26 -0
  115. package/cpp/leveldb/table/table.cc +271 -0
  116. package/cpp/leveldb/table/table_builder.cc +265 -0
  117. package/cpp/leveldb/table/table_test.cc +834 -0
  118. package/cpp/leveldb/table/two_level_iterator.cc +171 -0
  119. package/cpp/leveldb/table/two_level_iterator.h +31 -0
  120. package/cpp/leveldb/third_party/benchmark/.clang-format +5 -0
  121. package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
  122. package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  123. package/cpp/leveldb/third_party/benchmark/.github/workflows/build-and-test.yml +38 -0
  124. package/cpp/leveldb/third_party/benchmark/.github/workflows/pylint.yml +26 -0
  125. package/cpp/leveldb/third_party/benchmark/.github/workflows/test_bindings.yml +24 -0
  126. package/cpp/leveldb/third_party/benchmark/.travis-libcxx-setup.sh +28 -0
  127. package/cpp/leveldb/third_party/benchmark/.travis.yml +231 -0
  128. package/cpp/leveldb/third_party/benchmark/.ycm_extra_conf.py +115 -0
  129. package/cpp/leveldb/third_party/benchmark/AUTHORS +58 -0
  130. package/cpp/leveldb/third_party/benchmark/BUILD.bazel +44 -0
  131. package/cpp/leveldb/third_party/benchmark/CMakeLists.txt +287 -0
  132. package/cpp/leveldb/third_party/benchmark/CONTRIBUTING.md +58 -0
  133. package/cpp/leveldb/third_party/benchmark/CONTRIBUTORS +83 -0
  134. package/cpp/leveldb/third_party/benchmark/LICENSE +202 -0
  135. package/cpp/leveldb/third_party/benchmark/README.md +1323 -0
  136. package/cpp/leveldb/third_party/benchmark/WORKSPACE +51 -0
  137. package/cpp/leveldb/third_party/benchmark/_config.yml +1 -0
  138. package/cpp/leveldb/third_party/benchmark/appveyor.yml +50 -0
  139. package/cpp/leveldb/third_party/benchmark/bindings/python/BUILD +3 -0
  140. package/cpp/leveldb/third_party/benchmark/bindings/python/build_defs.bzl +25 -0
  141. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/BUILD +38 -0
  142. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/__init__.py +156 -0
  143. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/benchmark.cc +180 -0
  144. package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/example.py +136 -0
  145. package/cpp/leveldb/third_party/benchmark/bindings/python/pybind11.BUILD +20 -0
  146. package/cpp/leveldb/third_party/benchmark/bindings/python/python_headers.BUILD +6 -0
  147. package/cpp/leveldb/third_party/benchmark/bindings/python/requirements.txt +2 -0
  148. package/cpp/leveldb/third_party/benchmark/cmake/AddCXXCompilerFlag.cmake +74 -0
  149. package/cpp/leveldb/third_party/benchmark/cmake/CXXFeatureCheck.cmake +69 -0
  150. package/cpp/leveldb/third_party/benchmark/cmake/Config.cmake.in +1 -0
  151. package/cpp/leveldb/third_party/benchmark/cmake/GetGitVersion.cmake +54 -0
  152. package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake +41 -0
  153. package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake.in +58 -0
  154. package/cpp/leveldb/third_party/benchmark/cmake/benchmark.pc.in +12 -0
  155. package/cpp/leveldb/third_party/benchmark/cmake/gnu_posix_regex.cpp +12 -0
  156. package/cpp/leveldb/third_party/benchmark/cmake/llvm-toolchain.cmake +8 -0
  157. package/cpp/leveldb/third_party/benchmark/cmake/posix_regex.cpp +14 -0
  158. package/cpp/leveldb/third_party/benchmark/cmake/split_list.cmake +3 -0
  159. package/cpp/leveldb/third_party/benchmark/cmake/std_regex.cpp +10 -0
  160. package/cpp/leveldb/third_party/benchmark/cmake/steady_clock.cpp +7 -0
  161. package/cpp/leveldb/third_party/benchmark/cmake/thread_safety_attributes.cpp +4 -0
  162. package/cpp/leveldb/third_party/benchmark/conan/CMakeLists.txt +7 -0
  163. package/cpp/leveldb/third_party/benchmark/conan/test_package/CMakeLists.txt +10 -0
  164. package/cpp/leveldb/third_party/benchmark/conan/test_package/conanfile.py +19 -0
  165. package/cpp/leveldb/third_party/benchmark/conan/test_package/test_package.cpp +18 -0
  166. package/cpp/leveldb/third_party/benchmark/conanfile.py +79 -0
  167. package/cpp/leveldb/third_party/benchmark/dependencies.md +18 -0
  168. package/cpp/leveldb/third_party/benchmark/docs/AssemblyTests.md +147 -0
  169. package/cpp/leveldb/third_party/benchmark/docs/_config.yml +1 -0
  170. package/cpp/leveldb/third_party/benchmark/docs/releasing.md +16 -0
  171. package/cpp/leveldb/third_party/benchmark/docs/tools.md +203 -0
  172. package/cpp/leveldb/third_party/benchmark/include/benchmark/benchmark.h +1604 -0
  173. package/cpp/leveldb/third_party/benchmark/requirements.txt +2 -0
  174. package/cpp/leveldb/third_party/benchmark/setup.py +140 -0
  175. package/cpp/leveldb/third_party/benchmark/src/CMakeLists.txt +114 -0
  176. package/cpp/leveldb/third_party/benchmark/src/arraysize.h +33 -0
  177. package/cpp/leveldb/third_party/benchmark/src/benchmark.cc +499 -0
  178. package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.cc +15 -0
  179. package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.h +53 -0
  180. package/cpp/leveldb/third_party/benchmark/src/benchmark_main.cc +17 -0
  181. package/cpp/leveldb/third_party/benchmark/src/benchmark_name.cc +58 -0
  182. package/cpp/leveldb/third_party/benchmark/src/benchmark_register.cc +515 -0
  183. package/cpp/leveldb/third_party/benchmark/src/benchmark_register.h +108 -0
  184. package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.cc +362 -0
  185. package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.h +51 -0
  186. package/cpp/leveldb/third_party/benchmark/src/check.h +82 -0
  187. package/cpp/leveldb/third_party/benchmark/src/colorprint.cc +188 -0
  188. package/cpp/leveldb/third_party/benchmark/src/colorprint.h +33 -0
  189. package/cpp/leveldb/third_party/benchmark/src/commandlineflags.cc +228 -0
  190. package/cpp/leveldb/third_party/benchmark/src/commandlineflags.h +103 -0
  191. package/cpp/leveldb/third_party/benchmark/src/complexity.cc +238 -0
  192. package/cpp/leveldb/third_party/benchmark/src/complexity.h +55 -0
  193. package/cpp/leveldb/third_party/benchmark/src/console_reporter.cc +177 -0
  194. package/cpp/leveldb/third_party/benchmark/src/counter.cc +80 -0
  195. package/cpp/leveldb/third_party/benchmark/src/counter.h +32 -0
  196. package/cpp/leveldb/third_party/benchmark/src/csv_reporter.cc +154 -0
  197. package/cpp/leveldb/third_party/benchmark/src/cycleclock.h +211 -0
  198. package/cpp/leveldb/third_party/benchmark/src/internal_macros.h +102 -0
  199. package/cpp/leveldb/third_party/benchmark/src/json_reporter.cc +255 -0
  200. package/cpp/leveldb/third_party/benchmark/src/log.h +74 -0
  201. package/cpp/leveldb/third_party/benchmark/src/mutex.h +155 -0
  202. package/cpp/leveldb/third_party/benchmark/src/re.h +158 -0
  203. package/cpp/leveldb/third_party/benchmark/src/reporter.cc +105 -0
  204. package/cpp/leveldb/third_party/benchmark/src/sleep.cc +67 -0
  205. package/cpp/leveldb/third_party/benchmark/src/sleep.h +15 -0
  206. package/cpp/leveldb/third_party/benchmark/src/statistics.cc +193 -0
  207. package/cpp/leveldb/third_party/benchmark/src/statistics.h +37 -0
  208. package/cpp/leveldb/third_party/benchmark/src/string_util.cc +255 -0
  209. package/cpp/leveldb/third_party/benchmark/src/string_util.h +59 -0
  210. package/cpp/leveldb/third_party/benchmark/src/sysinfo.cc +716 -0
  211. package/cpp/leveldb/third_party/benchmark/src/thread_manager.h +64 -0
  212. package/cpp/leveldb/third_party/benchmark/src/thread_timer.h +86 -0
  213. package/cpp/leveldb/third_party/benchmark/src/timers.cc +245 -0
  214. package/cpp/leveldb/third_party/benchmark/src/timers.h +48 -0
  215. package/cpp/leveldb/third_party/benchmark/test/AssemblyTests.cmake +46 -0
  216. package/cpp/leveldb/third_party/benchmark/test/BUILD +73 -0
  217. package/cpp/leveldb/third_party/benchmark/test/CMakeLists.txt +263 -0
  218. package/cpp/leveldb/third_party/benchmark/test/args_product_test.cc +77 -0
  219. package/cpp/leveldb/third_party/benchmark/test/basic_test.cc +136 -0
  220. package/cpp/leveldb/third_party/benchmark/test/benchmark_gtest.cc +134 -0
  221. package/cpp/leveldb/third_party/benchmark/test/benchmark_name_gtest.cc +74 -0
  222. package/cpp/leveldb/third_party/benchmark/test/benchmark_test.cc +245 -0
  223. package/cpp/leveldb/third_party/benchmark/test/clobber_memory_assembly_test.cc +64 -0
  224. package/cpp/leveldb/third_party/benchmark/test/commandlineflags_gtest.cc +201 -0
  225. package/cpp/leveldb/third_party/benchmark/test/complexity_test.cc +213 -0
  226. package/cpp/leveldb/third_party/benchmark/test/cxx03_test.cc +63 -0
  227. package/cpp/leveldb/third_party/benchmark/test/diagnostics_test.cc +80 -0
  228. package/cpp/leveldb/third_party/benchmark/test/display_aggregates_only_test.cc +43 -0
  229. package/cpp/leveldb/third_party/benchmark/test/donotoptimize_assembly_test.cc +163 -0
  230. package/cpp/leveldb/third_party/benchmark/test/donotoptimize_test.cc +52 -0
  231. package/cpp/leveldb/third_party/benchmark/test/filter_test.cc +104 -0
  232. package/cpp/leveldb/third_party/benchmark/test/fixture_test.cc +51 -0
  233. package/cpp/leveldb/third_party/benchmark/test/internal_threading_test.cc +184 -0
  234. package/cpp/leveldb/third_party/benchmark/test/link_main_test.cc +8 -0
  235. package/cpp/leveldb/third_party/benchmark/test/map_test.cc +57 -0
  236. package/cpp/leveldb/third_party/benchmark/test/memory_manager_test.cc +44 -0
  237. package/cpp/leveldb/third_party/benchmark/test/multiple_ranges_test.cc +96 -0
  238. package/cpp/leveldb/third_party/benchmark/test/options_test.cc +75 -0
  239. package/cpp/leveldb/third_party/benchmark/test/output_test.h +213 -0
  240. package/cpp/leveldb/third_party/benchmark/test/output_test_helper.cc +515 -0
  241. package/cpp/leveldb/third_party/benchmark/test/register_benchmark_test.cc +184 -0
  242. package/cpp/leveldb/third_party/benchmark/test/report_aggregates_only_test.cc +39 -0
  243. package/cpp/leveldb/third_party/benchmark/test/reporter_output_test.cc +747 -0
  244. package/cpp/leveldb/third_party/benchmark/test/skip_with_error_test.cc +195 -0
  245. package/cpp/leveldb/third_party/benchmark/test/state_assembly_test.cc +68 -0
  246. package/cpp/leveldb/third_party/benchmark/test/statistics_gtest.cc +28 -0
  247. package/cpp/leveldb/third_party/benchmark/test/string_util_gtest.cc +153 -0
  248. package/cpp/leveldb/third_party/benchmark/test/templated_fixture_test.cc +28 -0
  249. package/cpp/leveldb/third_party/benchmark/test/user_counters_tabular_test.cc +285 -0
  250. package/cpp/leveldb/third_party/benchmark/test/user_counters_test.cc +531 -0
  251. package/cpp/leveldb/third_party/benchmark/test/user_counters_thousands_test.cc +173 -0
  252. package/cpp/leveldb/third_party/benchmark/tools/BUILD.bazel +19 -0
  253. package/cpp/leveldb/third_party/benchmark/tools/compare.py +429 -0
  254. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run1.json +119 -0
  255. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run2.json +119 -0
  256. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test2_run.json +81 -0
  257. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run0.json +65 -0
  258. package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run1.json +65 -0
  259. package/cpp/leveldb/third_party/benchmark/tools/gbench/__init__.py +8 -0
  260. package/cpp/leveldb/third_party/benchmark/tools/gbench/report.py +903 -0
  261. package/cpp/leveldb/third_party/benchmark/tools/gbench/util.py +163 -0
  262. package/cpp/leveldb/third_party/benchmark/tools/requirements.txt +1 -0
  263. package/cpp/leveldb/third_party/benchmark/tools/strip_asm.py +151 -0
  264. package/cpp/leveldb/third_party/googletest/.clang-format +4 -0
  265. package/cpp/leveldb/third_party/googletest/.travis.yml +73 -0
  266. package/cpp/leveldb/third_party/googletest/BUILD.bazel +179 -0
  267. package/cpp/leveldb/third_party/googletest/CMakeLists.txt +36 -0
  268. package/cpp/leveldb/third_party/googletest/CONTRIBUTING.md +142 -0
  269. package/cpp/leveldb/third_party/googletest/LICENSE +28 -0
  270. package/cpp/leveldb/third_party/googletest/README.md +132 -0
  271. package/cpp/leveldb/third_party/googletest/WORKSPACE +23 -0
  272. package/cpp/leveldb/third_party/googletest/appveyor.yml +154 -0
  273. package/cpp/leveldb/third_party/googletest/ci/build-linux-bazel.sh +37 -0
  274. package/cpp/leveldb/third_party/googletest/ci/build-platformio.sh +2 -0
  275. package/cpp/leveldb/third_party/googletest/ci/env-linux.sh +41 -0
  276. package/cpp/leveldb/third_party/googletest/ci/env-osx.sh +47 -0
  277. package/cpp/leveldb/third_party/googletest/ci/get-nprocessors.sh +48 -0
  278. package/cpp/leveldb/third_party/googletest/ci/install-linux.sh +49 -0
  279. package/cpp/leveldb/third_party/googletest/ci/install-osx.sh +40 -0
  280. package/cpp/leveldb/third_party/googletest/ci/install-platformio.sh +5 -0
  281. package/cpp/leveldb/third_party/googletest/ci/log-config.sh +51 -0
  282. package/cpp/leveldb/third_party/googletest/ci/travis.sh +44 -0
  283. package/cpp/leveldb/third_party/googletest/googlemock/CMakeLists.txt +233 -0
  284. package/cpp/leveldb/third_party/googletest/googlemock/CONTRIBUTORS +40 -0
  285. package/cpp/leveldb/third_party/googletest/googlemock/LICENSE +28 -0
  286. package/cpp/leveldb/third_party/googletest/googlemock/README.md +44 -0
  287. package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock.pc.in +10 -0
  288. package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock_main.pc.in +10 -0
  289. package/cpp/leveldb/third_party/googletest/googlemock/docs/cheat_sheet.md +770 -0
  290. package/cpp/leveldb/third_party/googletest/googlemock/docs/cook_book.md +4270 -0
  291. package/cpp/leveldb/third_party/googletest/googlemock/docs/for_dummies.md +700 -0
  292. package/cpp/leveldb/third_party/googletest/googlemock/docs/gmock_faq.md +396 -0
  293. package/cpp/leveldb/third_party/googletest/googlemock/docs/pump_manual.md +187 -0
  294. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-actions.h +1193 -0
  295. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h +157 -0
  296. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-function-mocker.h +276 -0
  297. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h +1884 -0
  298. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump +627 -0
  299. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h +752 -0
  300. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +227 -0
  301. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h +1097 -0
  302. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump +346 -0
  303. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-matchers.h +4591 -0
  304. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h +162 -0
  305. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-matchers.h +92 -0
  306. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h +215 -0
  307. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h +1985 -0
  308. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock.h +101 -0
  309. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/README.md +16 -0
  310. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +10 -0
  311. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +12 -0
  312. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h +36 -0
  313. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-port.h +39 -0
  314. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h +472 -0
  315. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h +87 -0
  316. package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-pp.h +271 -0
  317. package/cpp/leveldb/third_party/googletest/googlemock/scripts/README.md +5 -0
  318. package/cpp/leveldb/third_party/googletest/googlemock/scripts/fuse_gmock_files.py +240 -0
  319. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/LICENSE +203 -0
  320. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README +34 -0
  321. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README.cppclean +115 -0
  322. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  323. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/ast.py +1761 -0
  324. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py +248 -0
  325. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py +540 -0
  326. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/keywords.py +56 -0
  327. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/tokenize.py +284 -0
  328. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/utils.py +37 -0
  329. package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/gmock_gen.py +30 -0
  330. package/cpp/leveldb/third_party/googletest/googlemock/scripts/pump.py +856 -0
  331. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-all.cc +46 -0
  332. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-cardinalities.cc +155 -0
  333. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-internal-utils.cc +200 -0
  334. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-matchers.cc +462 -0
  335. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-spec-builders.cc +892 -0
  336. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock.cc +213 -0
  337. package/cpp/leveldb/third_party/googletest/googlemock/src/gmock_main.cc +72 -0
  338. package/cpp/leveldb/third_party/googletest/googlemock/test/BUILD.bazel +110 -0
  339. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-actions_test.cc +1507 -0
  340. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-cardinalities_test.cc +429 -0
  341. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc.cc +16 -0
  342. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc_test.py +43 -0
  343. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_test.cc +696 -0
  344. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-actions_test.cc +1064 -0
  345. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-function-mockers_test.cc +659 -0
  346. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-matchers_test.cc +1323 -0
  347. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-internal-utils_test.cc +732 -0
  348. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-matchers_test.cc +6913 -0
  349. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-more-actions_test.cc +698 -0
  350. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc +500 -0
  351. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-port_test.cc +42 -0
  352. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp-string_test.cc +206 -0
  353. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp_test.cc +83 -0
  354. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-spec-builders_test.cc +2775 -0
  355. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_all_test.cc +49 -0
  356. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_ex_test.cc +80 -0
  357. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test.py +104 -0
  358. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test_.cc +99 -0
  359. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link2_test.cc +39 -0
  360. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.cc +39 -0
  361. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.h +690 -0
  362. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test.py +183 -0
  363. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_.cc +309 -0
  364. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_golden.txt +317 -0
  365. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_stress_test.cc +240 -0
  366. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test.cc +181 -0
  367. package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test_utils.py +108 -0
  368. package/cpp/leveldb/third_party/googletest/googlemock/test/pump_test.py +182 -0
  369. package/cpp/leveldb/third_party/googletest/googletest/CMakeLists.txt +329 -0
  370. package/cpp/leveldb/third_party/googletest/googletest/CONTRIBUTORS +38 -0
  371. package/cpp/leveldb/third_party/googletest/googletest/LICENSE +28 -0
  372. package/cpp/leveldb/third_party/googletest/googletest/README.md +244 -0
  373. package/cpp/leveldb/third_party/googletest/googletest/cmake/Config.cmake.in +9 -0
  374. package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest.pc.in +9 -0
  375. package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest_main.pc.in +10 -0
  376. package/cpp/leveldb/third_party/googletest/googletest/cmake/internal_utils.cmake +358 -0
  377. package/cpp/leveldb/third_party/googletest/googletest/cmake/libgtest.la.in +21 -0
  378. package/cpp/leveldb/third_party/googletest/googletest/docs/advanced.md +2567 -0
  379. package/cpp/leveldb/third_party/googletest/googletest/docs/faq.md +753 -0
  380. package/cpp/leveldb/third_party/googletest/googletest/docs/pkgconfig.md +219 -0
  381. package/cpp/leveldb/third_party/googletest/googletest/docs/primer.md +579 -0
  382. package/cpp/leveldb/third_party/googletest/googletest/docs/samples.md +22 -0
  383. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-death-test.h +343 -0
  384. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-matchers.h +750 -0
  385. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-message.h +219 -0
  386. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-param-test.h +514 -0
  387. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-printers.h +928 -0
  388. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-spi.h +238 -0
  389. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-test-part.h +184 -0
  390. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-typed-test.h +337 -0
  391. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest.h +2477 -0
  392. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_pred_impl.h +359 -0
  393. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_prod.h +61 -0
  394. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/README.md +56 -0
  395. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h +37 -0
  396. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  397. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest.h +37 -0
  398. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h +304 -0
  399. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h +211 -0
  400. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h +1411 -0
  401. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h +880 -0
  402. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h +111 -0
  403. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port.h +2227 -0
  404. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-string.h +171 -0
  405. package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h +183 -0
  406. package/cpp/leveldb/third_party/googletest/googletest/samples/prime_tables.h +126 -0
  407. package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.cc +66 -0
  408. package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.h +41 -0
  409. package/cpp/leveldb/third_party/googletest/googletest/samples/sample10_unittest.cc +139 -0
  410. package/cpp/leveldb/third_party/googletest/googletest/samples/sample1_unittest.cc +151 -0
  411. package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.cc +54 -0
  412. package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.h +81 -0
  413. package/cpp/leveldb/third_party/googletest/googletest/samples/sample2_unittest.cc +107 -0
  414. package/cpp/leveldb/third_party/googletest/googletest/samples/sample3-inl.h +172 -0
  415. package/cpp/leveldb/third_party/googletest/googletest/samples/sample3_unittest.cc +149 -0
  416. package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.cc +54 -0
  417. package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.h +53 -0
  418. package/cpp/leveldb/third_party/googletest/googletest/samples/sample4_unittest.cc +53 -0
  419. package/cpp/leveldb/third_party/googletest/googletest/samples/sample5_unittest.cc +196 -0
  420. package/cpp/leveldb/third_party/googletest/googletest/samples/sample6_unittest.cc +224 -0
  421. package/cpp/leveldb/third_party/googletest/googletest/samples/sample7_unittest.cc +117 -0
  422. package/cpp/leveldb/third_party/googletest/googletest/samples/sample8_unittest.cc +154 -0
  423. package/cpp/leveldb/third_party/googletest/googletest/samples/sample9_unittest.cc +156 -0
  424. package/cpp/leveldb/third_party/googletest/googletest/scripts/README.md +5 -0
  425. package/cpp/leveldb/third_party/googletest/googletest/scripts/common.py +83 -0
  426. package/cpp/leveldb/third_party/googletest/googletest/scripts/fuse_gtest_files.py +253 -0
  427. package/cpp/leveldb/third_party/googletest/googletest/scripts/gen_gtest_pred_impl.py +734 -0
  428. package/cpp/leveldb/third_party/googletest/googletest/scripts/gtest-config.in +274 -0
  429. package/cpp/leveldb/third_party/googletest/googletest/scripts/release_docs.py +158 -0
  430. package/cpp/leveldb/third_party/googletest/googletest/scripts/run_with_path.py +32 -0
  431. package/cpp/leveldb/third_party/googletest/googletest/scripts/upload.py +1402 -0
  432. package/cpp/leveldb/third_party/googletest/googletest/scripts/upload_gtest.py +78 -0
  433. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-all.cc +48 -0
  434. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-death-test.cc +1653 -0
  435. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-filepath.cc +382 -0
  436. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-internal-inl.h +1211 -0
  437. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-matchers.cc +97 -0
  438. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-port.cc +1399 -0
  439. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-printers.cc +442 -0
  440. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-test-part.cc +108 -0
  441. package/cpp/leveldb/third_party/googletest/googletest/src/gtest-typed-test.cc +118 -0
  442. package/cpp/leveldb/third_party/googletest/googletest/src/gtest.cc +6180 -0
  443. package/cpp/leveldb/third_party/googletest/googletest/src/gtest_main.cc +54 -0
  444. package/cpp/leveldb/third_party/googletest/googletest/test/BUILD.bazel +529 -0
  445. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest.py +208 -0
  446. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest_.cc +86 -0
  447. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test.py +236 -0
  448. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test_.cc +293 -0
  449. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test.py +127 -0
  450. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test_.cc +62 -0
  451. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test-test.cc +1516 -0
  452. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test_ex_test.cc +92 -0
  453. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test.py +117 -0
  454. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test_.cc +122 -0
  455. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filepath-test.cc +649 -0
  456. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest.py +639 -0
  457. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest_.cc +137 -0
  458. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-outfiles-test.py +191 -0
  459. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-output-unittest.py +778 -0
  460. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest.py +205 -0
  461. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest_.cc +156 -0
  462. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-listener-test.cc +518 -0
  463. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-message-test.cc +158 -0
  464. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-options-test.cc +216 -0
  465. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt +1137 -0
  466. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test.py +346 -0
  467. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test_.cc +1149 -0
  468. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test.py +63 -0
  469. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test_.cc +50 -0
  470. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test.py +62 -0
  471. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test_.cc +55 -0
  472. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.cc +1086 -0
  473. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.h +51 -0
  474. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test2-test.cc +61 -0
  475. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-port-test.cc +1272 -0
  476. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-printers-test.cc +1619 -0
  477. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test.py +323 -0
  478. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test_.cc +101 -0
  479. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test-part-test.cc +230 -0
  480. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test2_test.cc +61 -0
  481. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test.py +168 -0
  482. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test_.cc +71 -0
  483. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test.py +67 -0
  484. package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test_.cc +42 -0
  485. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test2_test.cc +44 -0
  486. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.cc +462 -0
  487. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.h +65 -0
  488. package/cpp/leveldb/third_party/googletest/googletest/test/gtest-unittest-api_test.cc +341 -0
  489. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_all_test.cc +46 -0
  490. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_assert_by_exception_test.cc +116 -0
  491. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_environment_test.cc +188 -0
  492. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test.py +170 -0
  493. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test_.cc +45 -0
  494. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_json_test_utils.py +60 -0
  495. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest.py +141 -0
  496. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest_.cc +51 -0
  497. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_main_unittest.cc +44 -0
  498. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_no_test_unittest.cc +54 -0
  499. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  500. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_premature_exit_test.cc +126 -0
  501. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_prod_test.cc +56 -0
  502. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_repeat_test.cc +233 -0
  503. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_check_output_test.py +59 -0
  504. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_environment_check_output_test.py +54 -0
  505. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc +49 -0
  506. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_test.cc +55 -0
  507. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_sole_header_test.cc +56 -0
  508. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_stress_test.cc +248 -0
  509. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_macro_stack_footprint_test.cc +89 -0
  510. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_utils.py +314 -0
  511. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test.py +63 -0
  512. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test_.cc +43 -0
  513. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_throw_on_failure_ex_test.cc +90 -0
  514. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_unittest.cc +7496 -0
  515. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile1_test_.cc +43 -0
  516. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile2_test_.cc +43 -0
  517. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfiles_test.py +135 -0
  518. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest.py +389 -0
  519. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest_.cc +188 -0
  520. package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_test_utils.py +196 -0
  521. package/cpp/leveldb/third_party/googletest/googletest/test/production.cc +35 -0
  522. package/cpp/leveldb/third_party/googletest/googletest/test/production.h +54 -0
  523. package/cpp/leveldb/third_party/googletest/library.json +66 -0
  524. package/cpp/leveldb/third_party/googletest/platformio.ini +47 -0
  525. package/cpp/leveldb/util/arena.cc +66 -0
  526. package/cpp/leveldb/util/arena.h +71 -0
  527. package/cpp/leveldb/util/arena_test.cc +66 -0
  528. package/cpp/leveldb/util/bloom.cc +92 -0
  529. package/cpp/leveldb/util/bloom_test.cc +159 -0
  530. package/cpp/leveldb/util/cache.cc +401 -0
  531. package/cpp/leveldb/util/cache_test.cc +229 -0
  532. package/cpp/leveldb/util/coding.cc +166 -0
  533. package/cpp/leveldb/util/coding.h +122 -0
  534. package/cpp/leveldb/util/coding_test.cc +198 -0
  535. package/cpp/leveldb/util/comparator.cc +75 -0
  536. package/cpp/leveldb/util/crc32c.cc +380 -0
  537. package/cpp/leveldb/util/crc32c.h +43 -0
  538. package/cpp/leveldb/util/crc32c_test.cc +61 -0
  539. package/cpp/leveldb/util/env.cc +108 -0
  540. package/cpp/leveldb/util/env_posix.cc +893 -0
  541. package/cpp/leveldb/util/env_posix_test.cc +353 -0
  542. package/cpp/leveldb/util/env_posix_test_helper.h +28 -0
  543. package/cpp/leveldb/util/env_test.cc +240 -0
  544. package/cpp/leveldb/util/env_windows.cc +796 -0
  545. package/cpp/leveldb/util/env_windows_test.cc +65 -0
  546. package/cpp/leveldb/util/env_windows_test_helper.h +25 -0
  547. package/cpp/leveldb/util/filter_policy.cc +11 -0
  548. package/cpp/leveldb/util/hash.cc +55 -0
  549. package/cpp/leveldb/util/hash.h +19 -0
  550. package/cpp/leveldb/util/hash_test.cc +46 -0
  551. package/cpp/leveldb/util/histogram.cc +272 -0
  552. package/cpp/leveldb/util/histogram.h +44 -0
  553. package/cpp/leveldb/util/logging.cc +82 -0
  554. package/cpp/leveldb/util/logging.h +44 -0
  555. package/cpp/leveldb/util/logging_test.cc +145 -0
  556. package/cpp/leveldb/util/mutexlock.h +39 -0
  557. package/cpp/leveldb/util/no_destructor.h +46 -0
  558. package/cpp/leveldb/util/no_destructor_test.cc +49 -0
  559. package/cpp/leveldb/util/options.cc +14 -0
  560. package/cpp/leveldb/util/posix_logger.h +130 -0
  561. package/cpp/leveldb/util/random.h +63 -0
  562. package/cpp/leveldb/util/status.cc +77 -0
  563. package/cpp/leveldb/util/status_test.cc +44 -0
  564. package/cpp/leveldb/util/testutil.cc +51 -0
  565. package/cpp/leveldb/util/testutil.h +82 -0
  566. package/cpp/leveldb/util/windows_logger.h +124 -0
  567. package/cpp/react-native-leveldb.cpp +694 -0
  568. package/cpp/react-native-leveldb.h +4 -0
  569. package/ios/Leveldb.h +9 -0
  570. package/ios/Leveldb.mm +35 -0
  571. package/ios/Leveldb.xcodeproj/project.pbxproj +288 -0
  572. package/lib/commonjs/fake.js +181 -0
  573. package/lib/commonjs/fake.js.map +1 -0
  574. package/lib/commonjs/fake.test.js +30 -0
  575. package/lib/commonjs/fake.test.js.map +1 -0
  576. package/lib/commonjs/index.js +172 -0
  577. package/lib/commonjs/index.js.map +1 -0
  578. package/lib/commonjs/package.json +1 -0
  579. package/lib/module/fake.js +171 -0
  580. package/lib/module/fake.js.map +1 -0
  581. package/lib/module/fake.test.js +30 -0
  582. package/lib/module/fake.test.js.map +1 -0
  583. package/lib/module/index.js +165 -0
  584. package/lib/module/index.js.map +1 -0
  585. package/lib/typescript/fake.d.ts +34 -0
  586. package/lib/typescript/fake.d.ts.map +1 -0
  587. package/lib/typescript/fake.test.d.ts +2 -0
  588. package/lib/typescript/fake.test.d.ts.map +1 -0
  589. package/lib/typescript/index.d.ts +72 -0
  590. package/lib/typescript/index.d.ts.map +1 -0
  591. package/package.json +157 -0
  592. package/rn-leveldb.podspec +30 -0
  593. package/src/fake.test.ts +37 -0
  594. package/src/fake.ts +203 -0
  595. package/src/index.ts +291 -0
@@ -0,0 +1,523 @@
1
+ leveldb
2
+ =======
3
+
4
+ _Jeff Dean, Sanjay Ghemawat_
5
+
6
+ The leveldb library provides a persistent key value store. Keys and values are
7
+ arbitrary byte arrays. The keys are ordered within the key value store
8
+ according to a user-specified comparator function.
9
+
10
+ ## Opening A Database
11
+
12
+ A leveldb database has a name which corresponds to a file system directory. All
13
+ of the contents of database are stored in this directory. The following example
14
+ shows how to open a database, creating it if necessary:
15
+
16
+ ```c++
17
+ #include <cassert>
18
+ #include "leveldb/db.h"
19
+
20
+ leveldb::DB* db;
21
+ leveldb::Options options;
22
+ options.create_if_missing = true;
23
+ leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db);
24
+ assert(status.ok());
25
+ ...
26
+ ```
27
+
28
+ If you want to raise an error if the database already exists, add the following
29
+ line before the `leveldb::DB::Open` call:
30
+
31
+ ```c++
32
+ options.error_if_exists = true;
33
+ ```
34
+
35
+ ## Status
36
+
37
+ You may have noticed the `leveldb::Status` type above. Values of this type are
38
+ returned by most functions in leveldb that may encounter an error. You can check
39
+ if such a result is ok, and also print an associated error message:
40
+
41
+ ```c++
42
+ leveldb::Status s = ...;
43
+ if (!s.ok()) cerr << s.ToString() << endl;
44
+ ```
45
+
46
+ ## Closing A Database
47
+
48
+ When you are done with a database, just delete the database object. Example:
49
+
50
+ ```c++
51
+ ... open the db as described above ...
52
+ ... do something with db ...
53
+ delete db;
54
+ ```
55
+
56
+ ## Reads And Writes
57
+
58
+ The database provides Put, Delete, and Get methods to modify/query the database.
59
+ For example, the following code moves the value stored under key1 to key2.
60
+
61
+ ```c++
62
+ std::string value;
63
+ leveldb::Status s = db->Get(leveldb::ReadOptions(), key1, &value);
64
+ if (s.ok()) s = db->Put(leveldb::WriteOptions(), key2, value);
65
+ if (s.ok()) s = db->Delete(leveldb::WriteOptions(), key1);
66
+ ```
67
+
68
+ ## Atomic Updates
69
+
70
+ Note that if the process dies after the Put of key2 but before the delete of
71
+ key1, the same value may be left stored under multiple keys. Such problems can
72
+ be avoided by using the `WriteBatch` class to atomically apply a set of updates:
73
+
74
+ ```c++
75
+ #include "leveldb/write_batch.h"
76
+ ...
77
+ std::string value;
78
+ leveldb::Status s = db->Get(leveldb::ReadOptions(), key1, &value);
79
+ if (s.ok()) {
80
+ leveldb::WriteBatch batch;
81
+ batch.Delete(key1);
82
+ batch.Put(key2, value);
83
+ s = db->Write(leveldb::WriteOptions(), &batch);
84
+ }
85
+ ```
86
+
87
+ The `WriteBatch` holds a sequence of edits to be made to the database, and these
88
+ edits within the batch are applied in order. Note that we called Delete before
89
+ Put so that if key1 is identical to key2, we do not end up erroneously dropping
90
+ the value entirely.
91
+
92
+ Apart from its atomicity benefits, `WriteBatch` may also be used to speed up
93
+ bulk updates by placing lots of individual mutations into the same batch.
94
+
95
+ ## Synchronous Writes
96
+
97
+ By default, each write to leveldb is asynchronous: it returns after pushing the
98
+ write from the process into the operating system. The transfer from operating
99
+ system memory to the underlying persistent storage happens asynchronously. The
100
+ sync flag can be turned on for a particular write to make the write operation
101
+ not return until the data being written has been pushed all the way to
102
+ persistent storage. (On Posix systems, this is implemented by calling either
103
+ `fsync(...)` or `fdatasync(...)` or `msync(..., MS_SYNC)` before the write
104
+ operation returns.)
105
+
106
+ ```c++
107
+ leveldb::WriteOptions write_options;
108
+ write_options.sync = true;
109
+ db->Put(write_options, ...);
110
+ ```
111
+
112
+ Asynchronous writes are often more than a thousand times as fast as synchronous
113
+ writes. The downside of asynchronous writes is that a crash of the machine may
114
+ cause the last few updates to be lost. Note that a crash of just the writing
115
+ process (i.e., not a reboot) will not cause any loss since even when sync is
116
+ false, an update is pushed from the process memory into the operating system
117
+ before it is considered done.
118
+
119
+ Asynchronous writes can often be used safely. For example, when loading a large
120
+ amount of data into the database you can handle lost updates by restarting the
121
+ bulk load after a crash. A hybrid scheme is also possible where every Nth write
122
+ is synchronous, and in the event of a crash, the bulk load is restarted just
123
+ after the last synchronous write finished by the previous run. (The synchronous
124
+ write can update a marker that describes where to restart on a crash.)
125
+
126
+ `WriteBatch` provides an alternative to asynchronous writes. Multiple updates
127
+ may be placed in the same WriteBatch and applied together using a synchronous
128
+ write (i.e., `write_options.sync` is set to true). The extra cost of the
129
+ synchronous write will be amortized across all of the writes in the batch.
130
+
131
+ ## Concurrency
132
+
133
+ A database may only be opened by one process at a time. The leveldb
134
+ implementation acquires a lock from the operating system to prevent misuse.
135
+ Within a single process, the same `leveldb::DB` object may be safely shared by
136
+ multiple concurrent threads. I.e., different threads may write into or fetch
137
+ iterators or call Get on the same database without any external synchronization
138
+ (the leveldb implementation will automatically do the required synchronization).
139
+ However other objects (like Iterator and `WriteBatch`) may require external
140
+ synchronization. If two threads share such an object, they must protect access
141
+ to it using their own locking protocol. More details are available in the public
142
+ header files.
143
+
144
+ ## Iteration
145
+
146
+ The following example demonstrates how to print all key,value pairs in a
147
+ database.
148
+
149
+ ```c++
150
+ leveldb::Iterator* it = db->NewIterator(leveldb::ReadOptions());
151
+ for (it->SeekToFirst(); it->Valid(); it->Next()) {
152
+ cout << it->key().ToString() << ": " << it->value().ToString() << endl;
153
+ }
154
+ assert(it->status().ok()); // Check for any errors found during the scan
155
+ delete it;
156
+ ```
157
+
158
+ The following variation shows how to process just the keys in the range
159
+ [start,limit):
160
+
161
+ ```c++
162
+ for (it->Seek(start);
163
+ it->Valid() && it->key().ToString() < limit;
164
+ it->Next()) {
165
+ ...
166
+ }
167
+ ```
168
+
169
+ You can also process entries in reverse order. (Caveat: reverse iteration may be
170
+ somewhat slower than forward iteration.)
171
+
172
+ ```c++
173
+ for (it->SeekToLast(); it->Valid(); it->Prev()) {
174
+ ...
175
+ }
176
+ ```
177
+
178
+ ## Snapshots
179
+
180
+ Snapshots provide consistent read-only views over the entire state of the
181
+ key-value store. `ReadOptions::snapshot` may be non-NULL to indicate that a
182
+ read should operate on a particular version of the DB state. If
183
+ `ReadOptions::snapshot` is NULL, the read will operate on an implicit snapshot
184
+ of the current state.
185
+
186
+ Snapshots are created by the `DB::GetSnapshot()` method:
187
+
188
+ ```c++
189
+ leveldb::ReadOptions options;
190
+ options.snapshot = db->GetSnapshot();
191
+ ... apply some updates to db ...
192
+ leveldb::Iterator* iter = db->NewIterator(options);
193
+ ... read using iter to view the state when the snapshot was created ...
194
+ delete iter;
195
+ db->ReleaseSnapshot(options.snapshot);
196
+ ```
197
+
198
+ Note that when a snapshot is no longer needed, it should be released using the
199
+ `DB::ReleaseSnapshot` interface. This allows the implementation to get rid of
200
+ state that was being maintained just to support reading as of that snapshot.
201
+
202
+ ## Slice
203
+
204
+ The return value of the `it->key()` and `it->value()` calls above are instances
205
+ of the `leveldb::Slice` type. Slice is a simple structure that contains a length
206
+ and a pointer to an external byte array. Returning a Slice is a cheaper
207
+ alternative to returning a `std::string` since we do not need to copy
208
+ potentially large keys and values. In addition, leveldb methods do not return
209
+ null-terminated C-style strings since leveldb keys and values are allowed to
210
+ contain `'\0'` bytes.
211
+
212
+ C++ strings and null-terminated C-style strings can be easily converted to a
213
+ Slice:
214
+
215
+ ```c++
216
+ leveldb::Slice s1 = "hello";
217
+
218
+ std::string str("world");
219
+ leveldb::Slice s2 = str;
220
+ ```
221
+
222
+ A Slice can be easily converted back to a C++ string:
223
+
224
+ ```c++
225
+ std::string str = s1.ToString();
226
+ assert(str == std::string("hello"));
227
+ ```
228
+
229
+ Be careful when using Slices since it is up to the caller to ensure that the
230
+ external byte array into which the Slice points remains live while the Slice is
231
+ in use. For example, the following is buggy:
232
+
233
+ ```c++
234
+ leveldb::Slice slice;
235
+ if (...) {
236
+ std::string str = ...;
237
+ slice = str;
238
+ }
239
+ Use(slice);
240
+ ```
241
+
242
+ When the if statement goes out of scope, str will be destroyed and the backing
243
+ storage for slice will disappear.
244
+
245
+ ## Comparators
246
+
247
+ The preceding examples used the default ordering function for key, which orders
248
+ bytes lexicographically. You can however supply a custom comparator when opening
249
+ a database. For example, suppose each database key consists of two numbers and
250
+ we should sort by the first number, breaking ties by the second number. First,
251
+ define a proper subclass of `leveldb::Comparator` that expresses these rules:
252
+
253
+ ```c++
254
+ class TwoPartComparator : public leveldb::Comparator {
255
+ public:
256
+ // Three-way comparison function:
257
+ // if a < b: negative result
258
+ // if a > b: positive result
259
+ // else: zero result
260
+ int Compare(const leveldb::Slice& a, const leveldb::Slice& b) const {
261
+ int a1, a2, b1, b2;
262
+ ParseKey(a, &a1, &a2);
263
+ ParseKey(b, &b1, &b2);
264
+ if (a1 < b1) return -1;
265
+ if (a1 > b1) return +1;
266
+ if (a2 < b2) return -1;
267
+ if (a2 > b2) return +1;
268
+ return 0;
269
+ }
270
+
271
+ // Ignore the following methods for now:
272
+ const char* Name() const { return "TwoPartComparator"; }
273
+ void FindShortestSeparator(std::string*, const leveldb::Slice&) const {}
274
+ void FindShortSuccessor(std::string*) const {}
275
+ };
276
+ ```
277
+
278
+ Now create a database using this custom comparator:
279
+
280
+ ```c++
281
+ TwoPartComparator cmp;
282
+ leveldb::DB* db;
283
+ leveldb::Options options;
284
+ options.create_if_missing = true;
285
+ options.comparator = &cmp;
286
+ leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db);
287
+ ...
288
+ ```
289
+
290
+ ### Backwards compatibility
291
+
292
+ The result of the comparator's Name method is attached to the database when it
293
+ is created, and is checked on every subsequent database open. If the name
294
+ changes, the `leveldb::DB::Open` call will fail. Therefore, change the name if
295
+ and only if the new key format and comparison function are incompatible with
296
+ existing databases, and it is ok to discard the contents of all existing
297
+ databases.
298
+
299
+ You can however still gradually evolve your key format over time with a little
300
+ bit of pre-planning. For example, you could store a version number at the end of
301
+ each key (one byte should suffice for most uses). When you wish to switch to a
302
+ new key format (e.g., adding an optional third part to the keys processed by
303
+ `TwoPartComparator`), (a) keep the same comparator name (b) increment the
304
+ version number for new keys (c) change the comparator function so it uses the
305
+ version numbers found in the keys to decide how to interpret them.
306
+
307
+ ## Performance
308
+
309
+ Performance can be tuned by changing the default values of the types defined in
310
+ `include/options.h`.
311
+
312
+ ### Block size
313
+
314
+ leveldb groups adjacent keys together into the same block and such a block is
315
+ the unit of transfer to and from persistent storage. The default block size is
316
+ approximately 4096 uncompressed bytes. Applications that mostly do bulk scans
317
+ over the contents of the database may wish to increase this size. Applications
318
+ that do a lot of point reads of small values may wish to switch to a smaller
319
+ block size if performance measurements indicate an improvement. There isn't much
320
+ benefit in using blocks smaller than one kilobyte, or larger than a few
321
+ megabytes. Also note that compression will be more effective with larger block
322
+ sizes.
323
+
324
+ ### Compression
325
+
326
+ Each block is individually compressed before being written to persistent
327
+ storage. Compression is on by default since the default compression method is
328
+ very fast, and is automatically disabled for uncompressible data. In rare cases,
329
+ applications may want to disable compression entirely, but should only do so if
330
+ benchmarks show a performance improvement:
331
+
332
+ ```c++
333
+ leveldb::Options options;
334
+ options.compression = leveldb::kNoCompression;
335
+ ... leveldb::DB::Open(options, name, ...) ....
336
+ ```
337
+
338
+ ### Cache
339
+
340
+ The contents of the database are stored in a set of files in the filesystem and
341
+ each file stores a sequence of compressed blocks. If options.block_cache is
342
+ non-NULL, it is used to cache frequently used uncompressed block contents.
343
+
344
+ ```c++
345
+ #include "leveldb/cache.h"
346
+
347
+ leveldb::Options options;
348
+ options.block_cache = leveldb::NewLRUCache(100 * 1048576); // 100MB cache
349
+ leveldb::DB* db;
350
+ leveldb::DB::Open(options, name, &db);
351
+ ... use the db ...
352
+ delete db
353
+ delete options.block_cache;
354
+ ```
355
+
356
+ Note that the cache holds uncompressed data, and therefore it should be sized
357
+ according to application level data sizes, without any reduction from
358
+ compression. (Caching of compressed blocks is left to the operating system
359
+ buffer cache, or any custom Env implementation provided by the client.)
360
+
361
+ When performing a bulk read, the application may wish to disable caching so that
362
+ the data processed by the bulk read does not end up displacing most of the
363
+ cached contents. A per-iterator option can be used to achieve this:
364
+
365
+ ```c++
366
+ leveldb::ReadOptions options;
367
+ options.fill_cache = false;
368
+ leveldb::Iterator* it = db->NewIterator(options);
369
+ for (it->SeekToFirst(); it->Valid(); it->Next()) {
370
+ ...
371
+ }
372
+ ```
373
+
374
+ ### Key Layout
375
+
376
+ Note that the unit of disk transfer and caching is a block. Adjacent keys
377
+ (according to the database sort order) will usually be placed in the same block.
378
+ Therefore the application can improve its performance by placing keys that are
379
+ accessed together near each other and placing infrequently used keys in a
380
+ separate region of the key space.
381
+
382
+ For example, suppose we are implementing a simple file system on top of leveldb.
383
+ The types of entries we might wish to store are:
384
+
385
+ filename -> permission-bits, length, list of file_block_ids
386
+ file_block_id -> data
387
+
388
+ We might want to prefix filename keys with one letter (say '/') and the
389
+ `file_block_id` keys with a different letter (say '0') so that scans over just
390
+ the metadata do not force us to fetch and cache bulky file contents.
391
+
392
+ ### Filters
393
+
394
+ Because of the way leveldb data is organized on disk, a single `Get()` call may
395
+ involve multiple reads from disk. The optional FilterPolicy mechanism can be
396
+ used to reduce the number of disk reads substantially.
397
+
398
+ ```c++
399
+ leveldb::Options options;
400
+ options.filter_policy = NewBloomFilterPolicy(10);
401
+ leveldb::DB* db;
402
+ leveldb::DB::Open(options, "/tmp/testdb", &db);
403
+ ... use the database ...
404
+ delete db;
405
+ delete options.filter_policy;
406
+ ```
407
+
408
+ The preceding code associates a Bloom filter based filtering policy with the
409
+ database. Bloom filter based filtering relies on keeping some number of bits of
410
+ data in memory per key (in this case 10 bits per key since that is the argument
411
+ we passed to `NewBloomFilterPolicy`). This filter will reduce the number of
412
+ unnecessary disk reads needed for Get() calls by a factor of approximately
413
+ a 100. Increasing the bits per key will lead to a larger reduction at the cost
414
+ of more memory usage. We recommend that applications whose working set does not
415
+ fit in memory and that do a lot of random reads set a filter policy.
416
+
417
+ If you are using a custom comparator, you should ensure that the filter policy
418
+ you are using is compatible with your comparator. For example, consider a
419
+ comparator that ignores trailing spaces when comparing keys.
420
+ `NewBloomFilterPolicy` must not be used with such a comparator. Instead, the
421
+ application should provide a custom filter policy that also ignores trailing
422
+ spaces. For example:
423
+
424
+ ```c++
425
+ class CustomFilterPolicy : public leveldb::FilterPolicy {
426
+ private:
427
+ FilterPolicy* builtin_policy_;
428
+
429
+ public:
430
+ CustomFilterPolicy() : builtin_policy_(NewBloomFilterPolicy(10)) {}
431
+ ~CustomFilterPolicy() { delete builtin_policy_; }
432
+
433
+ const char* Name() const { return "IgnoreTrailingSpacesFilter"; }
434
+
435
+ void CreateFilter(const Slice* keys, int n, std::string* dst) const {
436
+ // Use builtin bloom filter code after removing trailing spaces
437
+ std::vector<Slice> trimmed(n);
438
+ for (int i = 0; i < n; i++) {
439
+ trimmed[i] = RemoveTrailingSpaces(keys[i]);
440
+ }
441
+ return builtin_policy_->CreateFilter(trimmed.data(), n, dst);
442
+ }
443
+ };
444
+ ```
445
+
446
+ Advanced applications may provide a filter policy that does not use a bloom
447
+ filter but uses some other mechanism for summarizing a set of keys. See
448
+ `leveldb/filter_policy.h` for detail.
449
+
450
+ ## Checksums
451
+
452
+ leveldb associates checksums with all data it stores in the file system. There
453
+ are two separate controls provided over how aggressively these checksums are
454
+ verified:
455
+
456
+ `ReadOptions::verify_checksums` may be set to true to force checksum
457
+ verification of all data that is read from the file system on behalf of a
458
+ particular read. By default, no such verification is done.
459
+
460
+ `Options::paranoid_checks` may be set to true before opening a database to make
461
+ the database implementation raise an error as soon as it detects an internal
462
+ corruption. Depending on which portion of the database has been corrupted, the
463
+ error may be raised when the database is opened, or later by another database
464
+ operation. By default, paranoid checking is off so that the database can be used
465
+ even if parts of its persistent storage have been corrupted.
466
+
467
+ If a database is corrupted (perhaps it cannot be opened when paranoid checking
468
+ is turned on), the `leveldb::RepairDB` function may be used to recover as much
469
+ of the data as possible
470
+
471
+ ## Approximate Sizes
472
+
473
+ The `GetApproximateSizes` method can used to get the approximate number of bytes
474
+ of file system space used by one or more key ranges.
475
+
476
+ ```c++
477
+ leveldb::Range ranges[2];
478
+ ranges[0] = leveldb::Range("a", "c");
479
+ ranges[1] = leveldb::Range("x", "z");
480
+ uint64_t sizes[2];
481
+ db->GetApproximateSizes(ranges, 2, sizes);
482
+ ```
483
+
484
+ The preceding call will set `sizes[0]` to the approximate number of bytes of
485
+ file system space used by the key range `[a..c)` and `sizes[1]` to the
486
+ approximate number of bytes used by the key range `[x..z)`.
487
+
488
+ ## Environment
489
+
490
+ All file operations (and other operating system calls) issued by the leveldb
491
+ implementation are routed through a `leveldb::Env` object. Sophisticated clients
492
+ may wish to provide their own Env implementation to get better control.
493
+ For example, an application may introduce artificial delays in the file IO
494
+ paths to limit the impact of leveldb on other activities in the system.
495
+
496
+ ```c++
497
+ class SlowEnv : public leveldb::Env {
498
+ ... implementation of the Env interface ...
499
+ };
500
+
501
+ SlowEnv env;
502
+ leveldb::Options options;
503
+ options.env = &env;
504
+ Status s = leveldb::DB::Open(options, ...);
505
+ ```
506
+
507
+ ## Porting
508
+
509
+ leveldb may be ported to a new platform by providing platform specific
510
+ implementations of the types/methods/functions exported by
511
+ `leveldb/port/port.h`. See `leveldb/port/port_example.h` for more details.
512
+
513
+ In addition, the new platform may need a new default `leveldb::Env`
514
+ implementation. See `leveldb/util/env_posix.h` for an example.
515
+
516
+ ## Other Information
517
+
518
+ Details about the leveldb implementation may be found in the following
519
+ documents:
520
+
521
+ 1. [Implementation notes](impl.md)
522
+ 2. [Format of an immutable Table file](table_format.md)
523
+ 3. [Format of a log file](log_format.md)
@@ -0,0 +1,75 @@
1
+ leveldb Log format
2
+ ==================
3
+ The log file contents are a sequence of 32KB blocks. The only exception is that
4
+ the tail of the file may contain a partial block.
5
+
6
+ Each block consists of a sequence of records:
7
+
8
+ block := record* trailer?
9
+ record :=
10
+ checksum: uint32 // crc32c of type and data[] ; little-endian
11
+ length: uint16 // little-endian
12
+ type: uint8 // One of FULL, FIRST, MIDDLE, LAST
13
+ data: uint8[length]
14
+
15
+ A record never starts within the last six bytes of a block (since it won't fit).
16
+ Any leftover bytes here form the trailer, which must consist entirely of zero
17
+ bytes and must be skipped by readers.
18
+
19
+ Aside: if exactly seven bytes are left in the current block, and a new non-zero
20
+ length record is added, the writer must emit a FIRST record (which contains zero
21
+ bytes of user data) to fill up the trailing seven bytes of the block and then
22
+ emit all of the user data in subsequent blocks.
23
+
24
+ More types may be added in the future. Some Readers may skip record types they
25
+ do not understand, others may report that some data was skipped.
26
+
27
+ FULL == 1
28
+ FIRST == 2
29
+ MIDDLE == 3
30
+ LAST == 4
31
+
32
+ The FULL record contains the contents of an entire user record.
33
+
34
+ FIRST, MIDDLE, LAST are types used for user records that have been split into
35
+ multiple fragments (typically because of block boundaries). FIRST is the type
36
+ of the first fragment of a user record, LAST is the type of the last fragment of
37
+ a user record, and MIDDLE is the type of all interior fragments of a user
38
+ record.
39
+
40
+ Example: consider a sequence of user records:
41
+
42
+ A: length 1000
43
+ B: length 97270
44
+ C: length 8000
45
+
46
+ **A** will be stored as a FULL record in the first block.
47
+
48
+ **B** will be split into three fragments: first fragment occupies the rest of
49
+ the first block, second fragment occupies the entirety of the second block, and
50
+ the third fragment occupies a prefix of the third block. This will leave six
51
+ bytes free in the third block, which will be left empty as the trailer.
52
+
53
+ **C** will be stored as a FULL record in the fourth block.
54
+
55
+ ----
56
+
57
+ ## Some benefits over the recordio format:
58
+
59
+ 1. We do not need any heuristics for resyncing - just go to next block boundary
60
+ and scan. If there is a corruption, skip to the next block. As a
61
+ side-benefit, we do not get confused when part of the contents of one log
62
+ file are embedded as a record inside another log file.
63
+
64
+ 2. Splitting at approximate boundaries (e.g., for mapreduce) is simple: find the
65
+ next block boundary and skip records until we hit a FULL or FIRST record.
66
+
67
+ 3. We do not need extra buffering for large records.
68
+
69
+ ## Some downsides compared to recordio format:
70
+
71
+ 1. No packing of tiny records. This could be fixed by adding a new record type,
72
+ so it is a shortcoming of the current implementation, not necessarily the
73
+ format.
74
+
75
+ 2. No compression. Again, this could be fixed by adding new record types.
@@ -0,0 +1,107 @@
1
+ leveldb File format
2
+ ===================
3
+
4
+ <beginning_of_file>
5
+ [data block 1]
6
+ [data block 2]
7
+ ...
8
+ [data block N]
9
+ [meta block 1]
10
+ ...
11
+ [meta block K]
12
+ [metaindex block]
13
+ [index block]
14
+ [Footer] (fixed size; starts at file_size - sizeof(Footer))
15
+ <end_of_file>
16
+
17
+ The file contains internal pointers. Each such pointer is called
18
+ a BlockHandle and contains the following information:
19
+
20
+ offset: varint64
21
+ size: varint64
22
+
23
+ See [varints](https://developers.google.com/protocol-buffers/docs/encoding#varints)
24
+ for an explanation of varint64 format.
25
+
26
+ 1. The sequence of key/value pairs in the file are stored in sorted
27
+ order and partitioned into a sequence of data blocks. These blocks
28
+ come one after another at the beginning of the file. Each data block
29
+ is formatted according to the code in `block_builder.cc`, and then
30
+ optionally compressed.
31
+
32
+ 2. After the data blocks we store a bunch of meta blocks. The
33
+ supported meta block types are described below. More meta block types
34
+ may be added in the future. Each meta block is again formatted using
35
+ `block_builder.cc` and then optionally compressed.
36
+
37
+ 3. A "metaindex" block. It contains one entry for every other meta
38
+ block where the key is the name of the meta block and the value is a
39
+ BlockHandle pointing to that meta block.
40
+
41
+ 4. An "index" block. This block contains one entry per data block,
42
+ where the key is a string >= last key in that data block and before
43
+ the first key in the successive data block. The value is the
44
+ BlockHandle for the data block.
45
+
46
+ 5. At the very end of the file is a fixed length footer that contains
47
+ the BlockHandle of the metaindex and index blocks as well as a magic number.
48
+
49
+ metaindex_handle: char[p]; // Block handle for metaindex
50
+ index_handle: char[q]; // Block handle for index
51
+ padding: char[40-p-q];// zeroed bytes to make fixed length
52
+ // (40==2*BlockHandle::kMaxEncodedLength)
53
+ magic: fixed64; // == 0xdb4775248b80fb57 (little-endian)
54
+
55
+ ## "filter" Meta Block
56
+
57
+ If a `FilterPolicy` was specified when the database was opened, a
58
+ filter block is stored in each table. The "metaindex" block contains
59
+ an entry that maps from `filter.<N>` to the BlockHandle for the filter
60
+ block where `<N>` is the string returned by the filter policy's
61
+ `Name()` method.
62
+
63
+ The filter block stores a sequence of filters, where filter i contains
64
+ the output of `FilterPolicy::CreateFilter()` on all keys that are stored
65
+ in a block whose file offset falls within the range
66
+
67
+ [ i*base ... (i+1)*base-1 ]
68
+
69
+ Currently, "base" is 2KB. So for example, if blocks X and Y start in
70
+ the range `[ 0KB .. 2KB-1 ]`, all of the keys in X and Y will be
71
+ converted to a filter by calling `FilterPolicy::CreateFilter()`, and the
72
+ resulting filter will be stored as the first filter in the filter
73
+ block.
74
+
75
+ The filter block is formatted as follows:
76
+
77
+ [filter 0]
78
+ [filter 1]
79
+ [filter 2]
80
+ ...
81
+ [filter N-1]
82
+
83
+ [offset of filter 0] : 4 bytes
84
+ [offset of filter 1] : 4 bytes
85
+ [offset of filter 2] : 4 bytes
86
+ ...
87
+ [offset of filter N-1] : 4 bytes
88
+
89
+ [offset of beginning of offset array] : 4 bytes
90
+ lg(base) : 1 byte
91
+
92
+ The offset array at the end of the filter block allows efficient
93
+ mapping from a data block offset to the corresponding filter.
94
+
95
+ ## "stats" Meta Block
96
+
97
+ This meta block contains a bunch of stats. The key is the name
98
+ of the statistic. The value contains the statistic.
99
+
100
+ TODO(postrelease): record following stats.
101
+
102
+ data size
103
+ index size
104
+ key size (uncompressed)
105
+ value size (uncompressed)
106
+ number of entries
107
+ number of data blocks