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.
- package/LICENSE +21 -0
- package/README.md +92 -0
- package/android/.project +34 -0
- package/android/.settings/org.eclipse.buildship.core.prefs +13 -0
- package/android/CMakeLists.txt +69 -0
- package/android/build.gradle +125 -0
- package/android/cpp-adapter.cpp +19 -0
- package/android/gradle.properties +6 -0
- package/android/src/main/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativeleveldb/LeveldbModule.java +57 -0
- package/android/src/main/java/com/reactnativeleveldb/LeveldbPackage.java +28 -0
- package/cpp/leveldb/.appveyor.yml +36 -0
- package/cpp/leveldb/.clang-format +18 -0
- package/cpp/leveldb/.travis.yml +88 -0
- package/cpp/leveldb/AUTHORS +12 -0
- package/cpp/leveldb/CMakeLists.txt +495 -0
- package/cpp/leveldb/CONTRIBUTING.md +36 -0
- package/cpp/leveldb/LICENSE +27 -0
- package/cpp/leveldb/NEWS +17 -0
- package/cpp/leveldb/README.md +231 -0
- package/cpp/leveldb/TODO +14 -0
- package/cpp/leveldb/benchmarks/db_bench.cc +990 -0
- package/cpp/leveldb/benchmarks/db_bench_sqlite3.cc +726 -0
- package/cpp/leveldb/benchmarks/db_bench_tree_db.cc +531 -0
- package/cpp/leveldb/cmake/leveldbConfig.cmake.in +9 -0
- package/cpp/leveldb/db/autocompact_test.cc +115 -0
- package/cpp/leveldb/db/builder.cc +82 -0
- package/cpp/leveldb/db/builder.h +30 -0
- package/cpp/leveldb/db/c.cc +562 -0
- package/cpp/leveldb/db/c_test.c +384 -0
- package/cpp/leveldb/db/corruption_test.cc +367 -0
- package/cpp/leveldb/db/db_impl.cc +1554 -0
- package/cpp/leveldb/db/db_impl.h +217 -0
- package/cpp/leveldb/db/db_iter.cc +318 -0
- package/cpp/leveldb/db/db_iter.h +26 -0
- package/cpp/leveldb/db/db_test.cc +2305 -0
- package/cpp/leveldb/db/dbformat.cc +136 -0
- package/cpp/leveldb/db/dbformat.h +224 -0
- package/cpp/leveldb/db/dbformat_test.cc +133 -0
- package/cpp/leveldb/db/dumpfile.cc +232 -0
- package/cpp/leveldb/db/fault_injection_test.cc +555 -0
- package/cpp/leveldb/db/filename.cc +141 -0
- package/cpp/leveldb/db/filename.h +83 -0
- package/cpp/leveldb/db/filename_test.cc +132 -0
- package/cpp/leveldb/db/leveldbutil.cc +64 -0
- package/cpp/leveldb/db/log_format.h +35 -0
- package/cpp/leveldb/db/log_reader.cc +274 -0
- package/cpp/leveldb/db/log_reader.h +112 -0
- package/cpp/leveldb/db/log_test.cc +563 -0
- package/cpp/leveldb/db/log_writer.cc +111 -0
- package/cpp/leveldb/db/log_writer.h +54 -0
- package/cpp/leveldb/db/memtable.cc +137 -0
- package/cpp/leveldb/db/memtable.h +87 -0
- package/cpp/leveldb/db/recovery_test.cc +339 -0
- package/cpp/leveldb/db/repair.cc +451 -0
- package/cpp/leveldb/db/skiplist.h +382 -0
- package/cpp/leveldb/db/skiplist_test.cc +373 -0
- package/cpp/leveldb/db/snapshot.h +95 -0
- package/cpp/leveldb/db/table_cache.cc +120 -0
- package/cpp/leveldb/db/table_cache.h +57 -0
- package/cpp/leveldb/db/version_edit.cc +257 -0
- package/cpp/leveldb/db/version_edit.h +106 -0
- package/cpp/leveldb/db/version_edit_test.cc +46 -0
- package/cpp/leveldb/db/version_set.cc +1562 -0
- package/cpp/leveldb/db/version_set.h +393 -0
- package/cpp/leveldb/db/version_set_test.cc +336 -0
- package/cpp/leveldb/db/write_batch.cc +150 -0
- package/cpp/leveldb/db/write_batch_internal.h +45 -0
- package/cpp/leveldb/db/write_batch_test.cc +137 -0
- package/cpp/leveldb/doc/benchmark.html +459 -0
- package/cpp/leveldb/doc/impl.md +172 -0
- package/cpp/leveldb/doc/index.md +523 -0
- package/cpp/leveldb/doc/log_format.md +75 -0
- package/cpp/leveldb/doc/table_format.md +107 -0
- package/cpp/leveldb/helpers/memenv/memenv.cc +390 -0
- package/cpp/leveldb/helpers/memenv/memenv.h +22 -0
- package/cpp/leveldb/helpers/memenv/memenv_test.cc +264 -0
- package/cpp/leveldb/include/leveldb/c.h +270 -0
- package/cpp/leveldb/include/leveldb/cache.h +111 -0
- package/cpp/leveldb/include/leveldb/comparator.h +64 -0
- package/cpp/leveldb/include/leveldb/db.h +167 -0
- package/cpp/leveldb/include/leveldb/dumpfile.h +28 -0
- package/cpp/leveldb/include/leveldb/env.h +417 -0
- package/cpp/leveldb/include/leveldb/export.h +33 -0
- package/cpp/leveldb/include/leveldb/filter_policy.h +72 -0
- package/cpp/leveldb/include/leveldb/iterator.h +112 -0
- package/cpp/leveldb/include/leveldb/options.h +187 -0
- package/cpp/leveldb/include/leveldb/slice.h +114 -0
- package/cpp/leveldb/include/leveldb/status.h +122 -0
- package/cpp/leveldb/include/leveldb/table.h +84 -0
- package/cpp/leveldb/include/leveldb/table_builder.h +93 -0
- package/cpp/leveldb/include/leveldb/write_batch.h +83 -0
- package/cpp/leveldb/issues/issue178_test.cc +90 -0
- package/cpp/leveldb/issues/issue200_test.cc +59 -0
- package/cpp/leveldb/issues/issue320_test.cc +131 -0
- package/cpp/leveldb/port/README.md +10 -0
- package/cpp/leveldb/port/port.h +19 -0
- package/cpp/leveldb/port/port_config.h.in +33 -0
- package/cpp/leveldb/port/port_example.h +100 -0
- package/cpp/leveldb/port/port_stdcxx.h +151 -0
- package/cpp/leveldb/port/thread_annotations.h +108 -0
- package/cpp/leveldb/table/block.cc +267 -0
- package/cpp/leveldb/table/block.h +44 -0
- package/cpp/leveldb/table/block_builder.cc +107 -0
- package/cpp/leveldb/table/block_builder.h +54 -0
- package/cpp/leveldb/table/filter_block.cc +106 -0
- package/cpp/leveldb/table/filter_block.h +68 -0
- package/cpp/leveldb/table/filter_block_test.cc +127 -0
- package/cpp/leveldb/table/format.cc +141 -0
- package/cpp/leveldb/table/format.h +99 -0
- package/cpp/leveldb/table/iterator.cc +76 -0
- package/cpp/leveldb/table/iterator_wrapper.h +92 -0
- package/cpp/leveldb/table/merger.cc +191 -0
- package/cpp/leveldb/table/merger.h +26 -0
- package/cpp/leveldb/table/table.cc +271 -0
- package/cpp/leveldb/table/table_builder.cc +265 -0
- package/cpp/leveldb/table/table_test.cc +834 -0
- package/cpp/leveldb/table/two_level_iterator.cc +171 -0
- package/cpp/leveldb/table/two_level_iterator.h +31 -0
- package/cpp/leveldb/third_party/benchmark/.clang-format +5 -0
- package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/bug_report.md +32 -0
- package/cpp/leveldb/third_party/benchmark/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/cpp/leveldb/third_party/benchmark/.github/workflows/build-and-test.yml +38 -0
- package/cpp/leveldb/third_party/benchmark/.github/workflows/pylint.yml +26 -0
- package/cpp/leveldb/third_party/benchmark/.github/workflows/test_bindings.yml +24 -0
- package/cpp/leveldb/third_party/benchmark/.travis-libcxx-setup.sh +28 -0
- package/cpp/leveldb/third_party/benchmark/.travis.yml +231 -0
- package/cpp/leveldb/third_party/benchmark/.ycm_extra_conf.py +115 -0
- package/cpp/leveldb/third_party/benchmark/AUTHORS +58 -0
- package/cpp/leveldb/third_party/benchmark/BUILD.bazel +44 -0
- package/cpp/leveldb/third_party/benchmark/CMakeLists.txt +287 -0
- package/cpp/leveldb/third_party/benchmark/CONTRIBUTING.md +58 -0
- package/cpp/leveldb/third_party/benchmark/CONTRIBUTORS +83 -0
- package/cpp/leveldb/third_party/benchmark/LICENSE +202 -0
- package/cpp/leveldb/third_party/benchmark/README.md +1323 -0
- package/cpp/leveldb/third_party/benchmark/WORKSPACE +51 -0
- package/cpp/leveldb/third_party/benchmark/_config.yml +1 -0
- package/cpp/leveldb/third_party/benchmark/appveyor.yml +50 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/BUILD +3 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/build_defs.bzl +25 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/BUILD +38 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/__init__.py +156 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/benchmark.cc +180 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/google_benchmark/example.py +136 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/pybind11.BUILD +20 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/python_headers.BUILD +6 -0
- package/cpp/leveldb/third_party/benchmark/bindings/python/requirements.txt +2 -0
- package/cpp/leveldb/third_party/benchmark/cmake/AddCXXCompilerFlag.cmake +74 -0
- package/cpp/leveldb/third_party/benchmark/cmake/CXXFeatureCheck.cmake +69 -0
- package/cpp/leveldb/third_party/benchmark/cmake/Config.cmake.in +1 -0
- package/cpp/leveldb/third_party/benchmark/cmake/GetGitVersion.cmake +54 -0
- package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake +41 -0
- package/cpp/leveldb/third_party/benchmark/cmake/GoogleTest.cmake.in +58 -0
- package/cpp/leveldb/third_party/benchmark/cmake/benchmark.pc.in +12 -0
- package/cpp/leveldb/third_party/benchmark/cmake/gnu_posix_regex.cpp +12 -0
- package/cpp/leveldb/third_party/benchmark/cmake/llvm-toolchain.cmake +8 -0
- package/cpp/leveldb/third_party/benchmark/cmake/posix_regex.cpp +14 -0
- package/cpp/leveldb/third_party/benchmark/cmake/split_list.cmake +3 -0
- package/cpp/leveldb/third_party/benchmark/cmake/std_regex.cpp +10 -0
- package/cpp/leveldb/third_party/benchmark/cmake/steady_clock.cpp +7 -0
- package/cpp/leveldb/third_party/benchmark/cmake/thread_safety_attributes.cpp +4 -0
- package/cpp/leveldb/third_party/benchmark/conan/CMakeLists.txt +7 -0
- package/cpp/leveldb/third_party/benchmark/conan/test_package/CMakeLists.txt +10 -0
- package/cpp/leveldb/third_party/benchmark/conan/test_package/conanfile.py +19 -0
- package/cpp/leveldb/third_party/benchmark/conan/test_package/test_package.cpp +18 -0
- package/cpp/leveldb/third_party/benchmark/conanfile.py +79 -0
- package/cpp/leveldb/third_party/benchmark/dependencies.md +18 -0
- package/cpp/leveldb/third_party/benchmark/docs/AssemblyTests.md +147 -0
- package/cpp/leveldb/third_party/benchmark/docs/_config.yml +1 -0
- package/cpp/leveldb/third_party/benchmark/docs/releasing.md +16 -0
- package/cpp/leveldb/third_party/benchmark/docs/tools.md +203 -0
- package/cpp/leveldb/third_party/benchmark/include/benchmark/benchmark.h +1604 -0
- package/cpp/leveldb/third_party/benchmark/requirements.txt +2 -0
- package/cpp/leveldb/third_party/benchmark/setup.py +140 -0
- package/cpp/leveldb/third_party/benchmark/src/CMakeLists.txt +114 -0
- package/cpp/leveldb/third_party/benchmark/src/arraysize.h +33 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark.cc +499 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.cc +15 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_api_internal.h +53 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_main.cc +17 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_name.cc +58 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_register.cc +515 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_register.h +108 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.cc +362 -0
- package/cpp/leveldb/third_party/benchmark/src/benchmark_runner.h +51 -0
- package/cpp/leveldb/third_party/benchmark/src/check.h +82 -0
- package/cpp/leveldb/third_party/benchmark/src/colorprint.cc +188 -0
- package/cpp/leveldb/third_party/benchmark/src/colorprint.h +33 -0
- package/cpp/leveldb/third_party/benchmark/src/commandlineflags.cc +228 -0
- package/cpp/leveldb/third_party/benchmark/src/commandlineflags.h +103 -0
- package/cpp/leveldb/third_party/benchmark/src/complexity.cc +238 -0
- package/cpp/leveldb/third_party/benchmark/src/complexity.h +55 -0
- package/cpp/leveldb/third_party/benchmark/src/console_reporter.cc +177 -0
- package/cpp/leveldb/third_party/benchmark/src/counter.cc +80 -0
- package/cpp/leveldb/third_party/benchmark/src/counter.h +32 -0
- package/cpp/leveldb/third_party/benchmark/src/csv_reporter.cc +154 -0
- package/cpp/leveldb/third_party/benchmark/src/cycleclock.h +211 -0
- package/cpp/leveldb/third_party/benchmark/src/internal_macros.h +102 -0
- package/cpp/leveldb/third_party/benchmark/src/json_reporter.cc +255 -0
- package/cpp/leveldb/third_party/benchmark/src/log.h +74 -0
- package/cpp/leveldb/third_party/benchmark/src/mutex.h +155 -0
- package/cpp/leveldb/third_party/benchmark/src/re.h +158 -0
- package/cpp/leveldb/third_party/benchmark/src/reporter.cc +105 -0
- package/cpp/leveldb/third_party/benchmark/src/sleep.cc +67 -0
- package/cpp/leveldb/third_party/benchmark/src/sleep.h +15 -0
- package/cpp/leveldb/third_party/benchmark/src/statistics.cc +193 -0
- package/cpp/leveldb/third_party/benchmark/src/statistics.h +37 -0
- package/cpp/leveldb/third_party/benchmark/src/string_util.cc +255 -0
- package/cpp/leveldb/third_party/benchmark/src/string_util.h +59 -0
- package/cpp/leveldb/third_party/benchmark/src/sysinfo.cc +716 -0
- package/cpp/leveldb/third_party/benchmark/src/thread_manager.h +64 -0
- package/cpp/leveldb/third_party/benchmark/src/thread_timer.h +86 -0
- package/cpp/leveldb/third_party/benchmark/src/timers.cc +245 -0
- package/cpp/leveldb/third_party/benchmark/src/timers.h +48 -0
- package/cpp/leveldb/third_party/benchmark/test/AssemblyTests.cmake +46 -0
- package/cpp/leveldb/third_party/benchmark/test/BUILD +73 -0
- package/cpp/leveldb/third_party/benchmark/test/CMakeLists.txt +263 -0
- package/cpp/leveldb/third_party/benchmark/test/args_product_test.cc +77 -0
- package/cpp/leveldb/third_party/benchmark/test/basic_test.cc +136 -0
- package/cpp/leveldb/third_party/benchmark/test/benchmark_gtest.cc +134 -0
- package/cpp/leveldb/third_party/benchmark/test/benchmark_name_gtest.cc +74 -0
- package/cpp/leveldb/third_party/benchmark/test/benchmark_test.cc +245 -0
- package/cpp/leveldb/third_party/benchmark/test/clobber_memory_assembly_test.cc +64 -0
- package/cpp/leveldb/third_party/benchmark/test/commandlineflags_gtest.cc +201 -0
- package/cpp/leveldb/third_party/benchmark/test/complexity_test.cc +213 -0
- package/cpp/leveldb/third_party/benchmark/test/cxx03_test.cc +63 -0
- package/cpp/leveldb/third_party/benchmark/test/diagnostics_test.cc +80 -0
- package/cpp/leveldb/third_party/benchmark/test/display_aggregates_only_test.cc +43 -0
- package/cpp/leveldb/third_party/benchmark/test/donotoptimize_assembly_test.cc +163 -0
- package/cpp/leveldb/third_party/benchmark/test/donotoptimize_test.cc +52 -0
- package/cpp/leveldb/third_party/benchmark/test/filter_test.cc +104 -0
- package/cpp/leveldb/third_party/benchmark/test/fixture_test.cc +51 -0
- package/cpp/leveldb/third_party/benchmark/test/internal_threading_test.cc +184 -0
- package/cpp/leveldb/third_party/benchmark/test/link_main_test.cc +8 -0
- package/cpp/leveldb/third_party/benchmark/test/map_test.cc +57 -0
- package/cpp/leveldb/third_party/benchmark/test/memory_manager_test.cc +44 -0
- package/cpp/leveldb/third_party/benchmark/test/multiple_ranges_test.cc +96 -0
- package/cpp/leveldb/third_party/benchmark/test/options_test.cc +75 -0
- package/cpp/leveldb/third_party/benchmark/test/output_test.h +213 -0
- package/cpp/leveldb/third_party/benchmark/test/output_test_helper.cc +515 -0
- package/cpp/leveldb/third_party/benchmark/test/register_benchmark_test.cc +184 -0
- package/cpp/leveldb/third_party/benchmark/test/report_aggregates_only_test.cc +39 -0
- package/cpp/leveldb/third_party/benchmark/test/reporter_output_test.cc +747 -0
- package/cpp/leveldb/third_party/benchmark/test/skip_with_error_test.cc +195 -0
- package/cpp/leveldb/third_party/benchmark/test/state_assembly_test.cc +68 -0
- package/cpp/leveldb/third_party/benchmark/test/statistics_gtest.cc +28 -0
- package/cpp/leveldb/third_party/benchmark/test/string_util_gtest.cc +153 -0
- package/cpp/leveldb/third_party/benchmark/test/templated_fixture_test.cc +28 -0
- package/cpp/leveldb/third_party/benchmark/test/user_counters_tabular_test.cc +285 -0
- package/cpp/leveldb/third_party/benchmark/test/user_counters_test.cc +531 -0
- package/cpp/leveldb/third_party/benchmark/test/user_counters_thousands_test.cc +173 -0
- package/cpp/leveldb/third_party/benchmark/tools/BUILD.bazel +19 -0
- package/cpp/leveldb/third_party/benchmark/tools/compare.py +429 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run1.json +119 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test1_run2.json +119 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test2_run.json +81 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run0.json +65 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/Inputs/test3_run1.json +65 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/__init__.py +8 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/report.py +903 -0
- package/cpp/leveldb/third_party/benchmark/tools/gbench/util.py +163 -0
- package/cpp/leveldb/third_party/benchmark/tools/requirements.txt +1 -0
- package/cpp/leveldb/third_party/benchmark/tools/strip_asm.py +151 -0
- package/cpp/leveldb/third_party/googletest/.clang-format +4 -0
- package/cpp/leveldb/third_party/googletest/.travis.yml +73 -0
- package/cpp/leveldb/third_party/googletest/BUILD.bazel +179 -0
- package/cpp/leveldb/third_party/googletest/CMakeLists.txt +36 -0
- package/cpp/leveldb/third_party/googletest/CONTRIBUTING.md +142 -0
- package/cpp/leveldb/third_party/googletest/LICENSE +28 -0
- package/cpp/leveldb/third_party/googletest/README.md +132 -0
- package/cpp/leveldb/third_party/googletest/WORKSPACE +23 -0
- package/cpp/leveldb/third_party/googletest/appveyor.yml +154 -0
- package/cpp/leveldb/third_party/googletest/ci/build-linux-bazel.sh +37 -0
- package/cpp/leveldb/third_party/googletest/ci/build-platformio.sh +2 -0
- package/cpp/leveldb/third_party/googletest/ci/env-linux.sh +41 -0
- package/cpp/leveldb/third_party/googletest/ci/env-osx.sh +47 -0
- package/cpp/leveldb/third_party/googletest/ci/get-nprocessors.sh +48 -0
- package/cpp/leveldb/third_party/googletest/ci/install-linux.sh +49 -0
- package/cpp/leveldb/third_party/googletest/ci/install-osx.sh +40 -0
- package/cpp/leveldb/third_party/googletest/ci/install-platformio.sh +5 -0
- package/cpp/leveldb/third_party/googletest/ci/log-config.sh +51 -0
- package/cpp/leveldb/third_party/googletest/ci/travis.sh +44 -0
- package/cpp/leveldb/third_party/googletest/googlemock/CMakeLists.txt +233 -0
- package/cpp/leveldb/third_party/googletest/googlemock/CONTRIBUTORS +40 -0
- package/cpp/leveldb/third_party/googletest/googlemock/LICENSE +28 -0
- package/cpp/leveldb/third_party/googletest/googlemock/README.md +44 -0
- package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock.pc.in +10 -0
- package/cpp/leveldb/third_party/googletest/googlemock/cmake/gmock_main.pc.in +10 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/cheat_sheet.md +770 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/cook_book.md +4270 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/for_dummies.md +700 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/gmock_faq.md +396 -0
- package/cpp/leveldb/third_party/googletest/googlemock/docs/pump_manual.md +187 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-actions.h +1193 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h +157 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-function-mocker.h +276 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h +1884 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h.pump +627 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h +752 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +227 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h +1097 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h.pump +346 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-matchers.h +4591 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-actions.h +162 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-more-matchers.h +92 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-nice-strict.h +215 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h +1985 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/gmock.h +101 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/README.md +16 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +10 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +12 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h +36 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/custom/gmock-port.h +39 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h +472 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-port.h +87 -0
- package/cpp/leveldb/third_party/googletest/googlemock/include/gmock/internal/gmock-pp.h +271 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/README.md +5 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/fuse_gmock_files.py +240 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/LICENSE +203 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README +34 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/README.cppclean +115 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/ast.py +1761 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class.py +248 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/gmock_class_test.py +540 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/keywords.py +56 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/tokenize.py +284 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/cpp/utils.py +37 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/generator/gmock_gen.py +30 -0
- package/cpp/leveldb/third_party/googletest/googlemock/scripts/pump.py +856 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-all.cc +46 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-cardinalities.cc +155 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-internal-utils.cc +200 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-matchers.cc +462 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock-spec-builders.cc +892 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock.cc +213 -0
- package/cpp/leveldb/third_party/googletest/googlemock/src/gmock_main.cc +72 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/BUILD.bazel +110 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-actions_test.cc +1507 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-cardinalities_test.cc +429 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc.cc +16 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_nc_test.py +43 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-function-mocker_test.cc +696 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-actions_test.cc +1064 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-function-mockers_test.cc +659 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-generated-matchers_test.cc +1323 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-internal-utils_test.cc +732 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-matchers_test.cc +6913 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-more-actions_test.cc +698 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-nice-strict_test.cc +500 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-port_test.cc +42 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp-string_test.cc +206 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-pp_test.cc +83 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock-spec-builders_test.cc +2775 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_all_test.cc +49 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_ex_test.cc +80 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test.py +104 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_leak_test_.cc +99 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link2_test.cc +39 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.cc +39 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_link_test.h +690 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test.py +183 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_.cc +309 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_output_test_golden.txt +317 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_stress_test.cc +240 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test.cc +181 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/gmock_test_utils.py +108 -0
- package/cpp/leveldb/third_party/googletest/googlemock/test/pump_test.py +182 -0
- package/cpp/leveldb/third_party/googletest/googletest/CMakeLists.txt +329 -0
- package/cpp/leveldb/third_party/googletest/googletest/CONTRIBUTORS +38 -0
- package/cpp/leveldb/third_party/googletest/googletest/LICENSE +28 -0
- package/cpp/leveldb/third_party/googletest/googletest/README.md +244 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/Config.cmake.in +9 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest.pc.in +9 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/gtest_main.pc.in +10 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/internal_utils.cmake +358 -0
- package/cpp/leveldb/third_party/googletest/googletest/cmake/libgtest.la.in +21 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/advanced.md +2567 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/faq.md +753 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/pkgconfig.md +219 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/primer.md +579 -0
- package/cpp/leveldb/third_party/googletest/googletest/docs/samples.md +22 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-death-test.h +343 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-matchers.h +750 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-message.h +219 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-param-test.h +514 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-printers.h +928 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-spi.h +238 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-test-part.h +184 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest-typed-test.h +337 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest.h +2477 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_pred_impl.h +359 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/gtest_prod.h +61 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/README.md +56 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h +37 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/custom/gtest.h +37 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h +304 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h +211 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-internal.h +1411 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h +880 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h +111 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-port.h +2227 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-string.h +171 -0
- package/cpp/leveldb/third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h +183 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/prime_tables.h +126 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.cc +66 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample1.h +41 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample10_unittest.cc +139 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample1_unittest.cc +151 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample2.h +81 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample2_unittest.cc +107 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample3-inl.h +172 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample3_unittest.cc +149 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample4.h +53 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample4_unittest.cc +53 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample5_unittest.cc +196 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample6_unittest.cc +224 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample7_unittest.cc +117 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample8_unittest.cc +154 -0
- package/cpp/leveldb/third_party/googletest/googletest/samples/sample9_unittest.cc +156 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/README.md +5 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/common.py +83 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/fuse_gtest_files.py +253 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/gen_gtest_pred_impl.py +734 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/gtest-config.in +274 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/release_docs.py +158 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/run_with_path.py +32 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/upload.py +1402 -0
- package/cpp/leveldb/third_party/googletest/googletest/scripts/upload_gtest.py +78 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-all.cc +48 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-death-test.cc +1653 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-filepath.cc +382 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-internal-inl.h +1211 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-matchers.cc +97 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-port.cc +1399 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-printers.cc +442 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-test-part.cc +108 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest-typed-test.cc +118 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest.cc +6180 -0
- package/cpp/leveldb/third_party/googletest/googletest/src/gtest_main.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/BUILD.bazel +529 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest.py +208 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-break-on-failure-unittest_.cc +86 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test.py +236 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-catch-exceptions-test_.cc +293 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test.py +127 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-color-test_.cc +62 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test-test.cc +1516 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-death-test_ex_test.cc +92 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test.py +117 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-env-var-test_.cc +122 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filepath-test.cc +649 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest.py +639 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-filter-unittest_.cc +137 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-outfiles-test.py +191 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-json-output-unittest.py +778 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest.py +205 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-list-tests-unittest_.cc +156 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-listener-test.cc +518 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-message-test.cc +158 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-options-test.cc +216 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test-golden-lin.txt +1137 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test.py +346 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-output-test_.cc +1149 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test.py +63 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name1-test_.cc +50 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test.py +62 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-invalid-name2-test_.cc +55 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.cc +1086 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test-test.h +51 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-param-test2-test.cc +61 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-port-test.cc +1272 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-printers-test.cc +1619 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test.py +323 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-shuffle-test_.cc +101 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test-part-test.cc +230 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-test2_test.cc +61 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test.py +168 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-throw-on-failure-test_.cc +71 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test.py +67 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/googletest-uninitialized-test_.cc +42 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test2_test.cc +44 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.cc +462 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-typed-test_test.h +65 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest-unittest-api_test.cc +341 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_all_test.cc +46 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_assert_by_exception_test.cc +116 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_environment_test.cc +188 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test.py +170 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_help_test_.cc +45 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_json_test_utils.py +60 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest.py +141 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_list_output_unittest_.cc +51 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_main_unittest.cc +44 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_no_test_unittest.cc +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_premature_exit_test.cc +126 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_prod_test.cc +56 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_repeat_test.cc +233 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_check_output_test.py +59 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_environment_check_output_test.py +54 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_in_environment_setup_test.cc +49 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_skip_test.cc +55 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_sole_header_test.cc +56 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_stress_test.cc +248 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_macro_stack_footprint_test.cc +89 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_test_utils.py +314 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test.py +63 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_testbridge_test_.cc +43 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_throw_on_failure_ex_test.cc +90 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_unittest.cc +7496 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile1_test_.cc +43 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfile2_test_.cc +43 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_outfiles_test.py +135 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest.py +389 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_output_unittest_.cc +188 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/gtest_xml_test_utils.py +196 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/production.cc +35 -0
- package/cpp/leveldb/third_party/googletest/googletest/test/production.h +54 -0
- package/cpp/leveldb/third_party/googletest/library.json +66 -0
- package/cpp/leveldb/third_party/googletest/platformio.ini +47 -0
- package/cpp/leveldb/util/arena.cc +66 -0
- package/cpp/leveldb/util/arena.h +71 -0
- package/cpp/leveldb/util/arena_test.cc +66 -0
- package/cpp/leveldb/util/bloom.cc +92 -0
- package/cpp/leveldb/util/bloom_test.cc +159 -0
- package/cpp/leveldb/util/cache.cc +401 -0
- package/cpp/leveldb/util/cache_test.cc +229 -0
- package/cpp/leveldb/util/coding.cc +166 -0
- package/cpp/leveldb/util/coding.h +122 -0
- package/cpp/leveldb/util/coding_test.cc +198 -0
- package/cpp/leveldb/util/comparator.cc +75 -0
- package/cpp/leveldb/util/crc32c.cc +380 -0
- package/cpp/leveldb/util/crc32c.h +43 -0
- package/cpp/leveldb/util/crc32c_test.cc +61 -0
- package/cpp/leveldb/util/env.cc +108 -0
- package/cpp/leveldb/util/env_posix.cc +893 -0
- package/cpp/leveldb/util/env_posix_test.cc +353 -0
- package/cpp/leveldb/util/env_posix_test_helper.h +28 -0
- package/cpp/leveldb/util/env_test.cc +240 -0
- package/cpp/leveldb/util/env_windows.cc +796 -0
- package/cpp/leveldb/util/env_windows_test.cc +65 -0
- package/cpp/leveldb/util/env_windows_test_helper.h +25 -0
- package/cpp/leveldb/util/filter_policy.cc +11 -0
- package/cpp/leveldb/util/hash.cc +55 -0
- package/cpp/leveldb/util/hash.h +19 -0
- package/cpp/leveldb/util/hash_test.cc +46 -0
- package/cpp/leveldb/util/histogram.cc +272 -0
- package/cpp/leveldb/util/histogram.h +44 -0
- package/cpp/leveldb/util/logging.cc +82 -0
- package/cpp/leveldb/util/logging.h +44 -0
- package/cpp/leveldb/util/logging_test.cc +145 -0
- package/cpp/leveldb/util/mutexlock.h +39 -0
- package/cpp/leveldb/util/no_destructor.h +46 -0
- package/cpp/leveldb/util/no_destructor_test.cc +49 -0
- package/cpp/leveldb/util/options.cc +14 -0
- package/cpp/leveldb/util/posix_logger.h +130 -0
- package/cpp/leveldb/util/random.h +63 -0
- package/cpp/leveldb/util/status.cc +77 -0
- package/cpp/leveldb/util/status_test.cc +44 -0
- package/cpp/leveldb/util/testutil.cc +51 -0
- package/cpp/leveldb/util/testutil.h +82 -0
- package/cpp/leveldb/util/windows_logger.h +124 -0
- package/cpp/react-native-leveldb.cpp +694 -0
- package/cpp/react-native-leveldb.h +4 -0
- package/ios/Leveldb.h +9 -0
- package/ios/Leveldb.mm +35 -0
- package/ios/Leveldb.xcodeproj/project.pbxproj +288 -0
- package/lib/commonjs/fake.js +181 -0
- package/lib/commonjs/fake.js.map +1 -0
- package/lib/commonjs/fake.test.js +30 -0
- package/lib/commonjs/fake.test.js.map +1 -0
- package/lib/commonjs/index.js +172 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/module/fake.js +171 -0
- package/lib/module/fake.js.map +1 -0
- package/lib/module/fake.test.js +30 -0
- package/lib/module/fake.test.js.map +1 -0
- package/lib/module/index.js +165 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/fake.d.ts +34 -0
- package/lib/typescript/fake.d.ts.map +1 -0
- package/lib/typescript/fake.test.d.ts +2 -0
- package/lib/typescript/fake.test.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +72 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/package.json +157 -0
- package/rn-leveldb.podspec +30 -0
- package/src/fake.test.ts +37 -0
- package/src/fake.ts +203 -0
- 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
|