rocksdb-native 0.0.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/.clang-format +15 -0
- package/.github/workflows/test-node.yml +23 -0
- package/.gitmodules +4 -0
- package/CMakeLists.txt +33 -0
- package/LICENSE +201 -0
- package/NOTICE +13 -0
- package/README.md +15 -0
- package/binding.c +470 -0
- package/binding.js +1 -0
- package/index.js +276 -0
- package/package.json +19 -0
- package/vendor/rocksdb/.circleci/config.yml +892 -0
- package/vendor/rocksdb/.circleci/ubsan_suppression_list.txt +6 -0
- package/vendor/rocksdb/.clang-format +5 -0
- package/vendor/rocksdb/.github/workflows/sanity_check.yml +47 -0
- package/vendor/rocksdb/.lgtm.yml +4 -0
- package/vendor/rocksdb/AUTHORS +12 -0
- package/vendor/rocksdb/CMakeLists.txt +1591 -0
- package/vendor/rocksdb/CODE_OF_CONDUCT.md +77 -0
- package/vendor/rocksdb/CONTRIBUTING.md +17 -0
- package/vendor/rocksdb/COPYING +339 -0
- package/vendor/rocksdb/DEFAULT_OPTIONS_HISTORY.md +24 -0
- package/vendor/rocksdb/DUMP_FORMAT.md +16 -0
- package/vendor/rocksdb/HISTORY.md +2399 -0
- package/vendor/rocksdb/INSTALL.md +220 -0
- package/vendor/rocksdb/LANGUAGE-BINDINGS.md +26 -0
- package/vendor/rocksdb/LICENSE.Apache +202 -0
- package/vendor/rocksdb/LICENSE.leveldb +29 -0
- package/vendor/rocksdb/Makefile +2579 -0
- package/vendor/rocksdb/PLUGINS.md +8 -0
- package/vendor/rocksdb/README.md +29 -0
- package/vendor/rocksdb/TARGETS +5599 -0
- package/vendor/rocksdb/USERS.md +165 -0
- package/vendor/rocksdb/Vagrantfile +39 -0
- package/vendor/rocksdb/WINDOWS_PORT.md +228 -0
- package/vendor/rocksdb/buckifier/bench-slow.json +6163 -0
- package/vendor/rocksdb/buckifier/bench.json +1594 -0
- package/vendor/rocksdb/buckifier/buckify_rocksdb.py +333 -0
- package/vendor/rocksdb/buckifier/check_buck_targets.sh +32 -0
- package/vendor/rocksdb/buckifier/rocks_test_runner.sh +6 -0
- package/vendor/rocksdb/buckifier/targets_builder.py +150 -0
- package/vendor/rocksdb/buckifier/targets_cfg.py +41 -0
- package/vendor/rocksdb/buckifier/util.py +118 -0
- package/vendor/rocksdb/build_tools/amalgamate.py +168 -0
- package/vendor/rocksdb/build_tools/benchmark_log_tool.py +238 -0
- package/vendor/rocksdb/build_tools/build_detect_platform +804 -0
- package/vendor/rocksdb/build_tools/check-sources.sh +48 -0
- package/vendor/rocksdb/build_tools/dependencies_platform010.sh +22 -0
- package/vendor/rocksdb/build_tools/dockerbuild.sh +3 -0
- package/vendor/rocksdb/build_tools/error_filter.py +181 -0
- package/vendor/rocksdb/build_tools/fb_compile_mongo.sh +55 -0
- package/vendor/rocksdb/build_tools/fbcode_config.sh +175 -0
- package/vendor/rocksdb/build_tools/fbcode_config_platform010.sh +175 -0
- package/vendor/rocksdb/build_tools/format-diff.sh +203 -0
- package/vendor/rocksdb/build_tools/gnu_parallel +7971 -0
- package/vendor/rocksdb/build_tools/make_package.sh +129 -0
- package/vendor/rocksdb/build_tools/ps_with_stack +38 -0
- package/vendor/rocksdb/build_tools/regression_build_test.sh +396 -0
- package/vendor/rocksdb/build_tools/run_ci_db_test.ps1 +493 -0
- package/vendor/rocksdb/build_tools/setup_centos7.sh +45 -0
- package/vendor/rocksdb/build_tools/ubuntu20_image/Dockerfile +57 -0
- package/vendor/rocksdb/build_tools/update_dependencies.sh +106 -0
- package/vendor/rocksdb/build_tools/version.sh +23 -0
- package/vendor/rocksdb/cache/cache.cc +158 -0
- package/vendor/rocksdb/cache/cache_bench.cc +20 -0
- package/vendor/rocksdb/cache/cache_bench_tool.cc +969 -0
- package/vendor/rocksdb/cache/cache_entry_roles.cc +104 -0
- package/vendor/rocksdb/cache/cache_entry_roles.h +20 -0
- package/vendor/rocksdb/cache/cache_entry_stats.h +182 -0
- package/vendor/rocksdb/cache/cache_helpers.cc +40 -0
- package/vendor/rocksdb/cache/cache_helpers.h +139 -0
- package/vendor/rocksdb/cache/cache_key.cc +364 -0
- package/vendor/rocksdb/cache/cache_key.h +143 -0
- package/vendor/rocksdb/cache/cache_reservation_manager.cc +184 -0
- package/vendor/rocksdb/cache/cache_reservation_manager.h +317 -0
- package/vendor/rocksdb/cache/cache_reservation_manager_test.cc +469 -0
- package/vendor/rocksdb/cache/cache_test.cc +1061 -0
- package/vendor/rocksdb/cache/charged_cache.cc +109 -0
- package/vendor/rocksdb/cache/charged_cache.h +59 -0
- package/vendor/rocksdb/cache/clock_cache.cc +1482 -0
- package/vendor/rocksdb/cache/clock_cache.h +707 -0
- package/vendor/rocksdb/cache/compressed_secondary_cache.cc +304 -0
- package/vendor/rocksdb/cache/compressed_secondary_cache.h +132 -0
- package/vendor/rocksdb/cache/compressed_secondary_cache_test.cc +983 -0
- package/vendor/rocksdb/cache/lru_cache.cc +723 -0
- package/vendor/rocksdb/cache/lru_cache.h +467 -0
- package/vendor/rocksdb/cache/lru_cache_test.cc +2559 -0
- package/vendor/rocksdb/cache/secondary_cache.cc +44 -0
- package/vendor/rocksdb/cache/secondary_cache_adapter.cc +295 -0
- package/vendor/rocksdb/cache/secondary_cache_adapter.h +52 -0
- package/vendor/rocksdb/cache/sharded_cache.cc +137 -0
- package/vendor/rocksdb/cache/sharded_cache.h +309 -0
- package/vendor/rocksdb/cache/typed_cache.h +375 -0
- package/vendor/rocksdb/cmake/RocksDBConfig.cmake.in +54 -0
- package/vendor/rocksdb/common.mk +30 -0
- package/vendor/rocksdb/crash_test.mk +107 -0
- package/vendor/rocksdb/db/arena_wrapped_db_iter.cc +163 -0
- package/vendor/rocksdb/db/arena_wrapped_db_iter.h +127 -0
- package/vendor/rocksdb/db/blob/blob_constants.h +16 -0
- package/vendor/rocksdb/db/blob/blob_contents.cc +42 -0
- package/vendor/rocksdb/db/blob/blob_contents.h +59 -0
- package/vendor/rocksdb/db/blob/blob_counting_iterator.h +150 -0
- package/vendor/rocksdb/db/blob/blob_counting_iterator_test.cc +327 -0
- package/vendor/rocksdb/db/blob/blob_fetcher.cc +34 -0
- package/vendor/rocksdb/db/blob/blob_fetcher.h +37 -0
- package/vendor/rocksdb/db/blob/blob_file_addition.cc +156 -0
- package/vendor/rocksdb/db/blob/blob_file_addition.h +67 -0
- package/vendor/rocksdb/db/blob/blob_file_addition_test.cc +211 -0
- package/vendor/rocksdb/db/blob/blob_file_builder.cc +426 -0
- package/vendor/rocksdb/db/blob/blob_file_builder.h +112 -0
- package/vendor/rocksdb/db/blob/blob_file_builder_test.cc +680 -0
- package/vendor/rocksdb/db/blob/blob_file_cache.cc +101 -0
- package/vendor/rocksdb/db/blob/blob_file_cache.h +56 -0
- package/vendor/rocksdb/db/blob/blob_file_cache_test.cc +278 -0
- package/vendor/rocksdb/db/blob/blob_file_completion_callback.h +84 -0
- package/vendor/rocksdb/db/blob/blob_file_garbage.cc +134 -0
- package/vendor/rocksdb/db/blob/blob_file_garbage.h +57 -0
- package/vendor/rocksdb/db/blob/blob_file_garbage_test.cc +174 -0
- package/vendor/rocksdb/db/blob/blob_file_meta.cc +62 -0
- package/vendor/rocksdb/db/blob/blob_file_meta.h +170 -0
- package/vendor/rocksdb/db/blob/blob_file_reader.cc +624 -0
- package/vendor/rocksdb/db/blob/blob_file_reader.h +112 -0
- package/vendor/rocksdb/db/blob/blob_file_reader_test.cc +1023 -0
- package/vendor/rocksdb/db/blob/blob_garbage_meter.cc +100 -0
- package/vendor/rocksdb/db/blob/blob_garbage_meter.h +102 -0
- package/vendor/rocksdb/db/blob/blob_garbage_meter_test.cc +197 -0
- package/vendor/rocksdb/db/blob/blob_index.h +187 -0
- package/vendor/rocksdb/db/blob/blob_log_format.cc +143 -0
- package/vendor/rocksdb/db/blob/blob_log_format.h +164 -0
- package/vendor/rocksdb/db/blob/blob_log_sequential_reader.cc +134 -0
- package/vendor/rocksdb/db/blob/blob_log_sequential_reader.h +83 -0
- package/vendor/rocksdb/db/blob/blob_log_writer.cc +178 -0
- package/vendor/rocksdb/db/blob/blob_log_writer.h +83 -0
- package/vendor/rocksdb/db/blob/blob_read_request.h +58 -0
- package/vendor/rocksdb/db/blob/blob_source.cc +459 -0
- package/vendor/rocksdb/db/blob/blob_source.h +161 -0
- package/vendor/rocksdb/db/blob/blob_source_test.cc +1611 -0
- package/vendor/rocksdb/db/blob/db_blob_basic_test.cc +2237 -0
- package/vendor/rocksdb/db/blob/db_blob_compaction_test.cc +899 -0
- package/vendor/rocksdb/db/blob/db_blob_corruption_test.cc +80 -0
- package/vendor/rocksdb/db/blob/db_blob_index_test.cc +596 -0
- package/vendor/rocksdb/db/blob/prefetch_buffer_collection.cc +21 -0
- package/vendor/rocksdb/db/blob/prefetch_buffer_collection.h +38 -0
- package/vendor/rocksdb/db/builder.cc +447 -0
- package/vendor/rocksdb/db/builder.h +78 -0
- package/vendor/rocksdb/db/c.cc +6559 -0
- package/vendor/rocksdb/db/c_test.c +3609 -0
- package/vendor/rocksdb/db/column_family.cc +1708 -0
- package/vendor/rocksdb/db/column_family.h +851 -0
- package/vendor/rocksdb/db/column_family_test.cc +3382 -0
- package/vendor/rocksdb/db/compact_files_test.cc +492 -0
- package/vendor/rocksdb/db/compaction/clipping_iterator.h +281 -0
- package/vendor/rocksdb/db/compaction/clipping_iterator_test.cc +259 -0
- package/vendor/rocksdb/db/compaction/compaction.cc +857 -0
- package/vendor/rocksdb/db/compaction/compaction.h +565 -0
- package/vendor/rocksdb/db/compaction/compaction_iteration_stats.h +49 -0
- package/vendor/rocksdb/db/compaction/compaction_iterator.cc +1445 -0
- package/vendor/rocksdb/db/compaction/compaction_iterator.h +530 -0
- package/vendor/rocksdb/db/compaction/compaction_iterator_test.cc +1618 -0
- package/vendor/rocksdb/db/compaction/compaction_job.cc +2054 -0
- package/vendor/rocksdb/db/compaction/compaction_job.h +504 -0
- package/vendor/rocksdb/db/compaction/compaction_job_stats_test.cc +965 -0
- package/vendor/rocksdb/db/compaction/compaction_job_test.cc +2444 -0
- package/vendor/rocksdb/db/compaction/compaction_outputs.cc +784 -0
- package/vendor/rocksdb/db/compaction/compaction_outputs.h +403 -0
- package/vendor/rocksdb/db/compaction/compaction_picker.cc +1225 -0
- package/vendor/rocksdb/db/compaction/compaction_picker.h +318 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_fifo.cc +471 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_fifo.h +60 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_level.cc +888 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_level.h +33 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_test.cc +4074 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_universal.cc +1452 -0
- package/vendor/rocksdb/db/compaction/compaction_picker_universal.h +30 -0
- package/vendor/rocksdb/db/compaction/compaction_service_job.cc +833 -0
- package/vendor/rocksdb/db/compaction/compaction_service_test.cc +954 -0
- package/vendor/rocksdb/db/compaction/compaction_state.cc +46 -0
- package/vendor/rocksdb/db/compaction/compaction_state.h +42 -0
- package/vendor/rocksdb/db/compaction/file_pri.h +92 -0
- package/vendor/rocksdb/db/compaction/sst_partitioner.cc +83 -0
- package/vendor/rocksdb/db/compaction/subcompaction_state.cc +106 -0
- package/vendor/rocksdb/db/compaction/subcompaction_state.h +220 -0
- package/vendor/rocksdb/db/compaction/tiered_compaction_test.cc +2149 -0
- package/vendor/rocksdb/db/comparator_db_test.cc +678 -0
- package/vendor/rocksdb/db/convenience.cc +81 -0
- package/vendor/rocksdb/db/corruption_test.cc +1670 -0
- package/vendor/rocksdb/db/cuckoo_table_db_test.cc +351 -0
- package/vendor/rocksdb/db/db_basic_test.cc +4777 -0
- package/vendor/rocksdb/db/db_block_cache_test.cc +1972 -0
- package/vendor/rocksdb/db/db_bloom_filter_test.cc +3513 -0
- package/vendor/rocksdb/db/db_clip_test.cc +142 -0
- package/vendor/rocksdb/db/db_compaction_filter_test.cc +1030 -0
- package/vendor/rocksdb/db/db_compaction_test.cc +9424 -0
- package/vendor/rocksdb/db/db_dynamic_level_test.cc +499 -0
- package/vendor/rocksdb/db/db_encryption_test.cc +126 -0
- package/vendor/rocksdb/db/db_filesnapshot.cc +436 -0
- package/vendor/rocksdb/db/db_flush_test.cc +3202 -0
- package/vendor/rocksdb/db/db_impl/compacted_db_impl.cc +260 -0
- package/vendor/rocksdb/db/db_impl/compacted_db_impl.h +157 -0
- package/vendor/rocksdb/db/db_impl/db_impl.cc +6132 -0
- package/vendor/rocksdb/db/db_impl/db_impl.h +2841 -0
- package/vendor/rocksdb/db/db_impl/db_impl_compaction_flush.cc +3980 -0
- package/vendor/rocksdb/db/db_impl/db_impl_debug.cc +314 -0
- package/vendor/rocksdb/db/db_impl/db_impl_experimental.cc +159 -0
- package/vendor/rocksdb/db/db_impl/db_impl_files.cc +1014 -0
- package/vendor/rocksdb/db/db_impl/db_impl_open.cc +2202 -0
- package/vendor/rocksdb/db/db_impl/db_impl_readonly.cc +334 -0
- package/vendor/rocksdb/db/db_impl/db_impl_readonly.h +173 -0
- package/vendor/rocksdb/db/db_impl/db_impl_secondary.cc +964 -0
- package/vendor/rocksdb/db/db_impl/db_impl_secondary.h +406 -0
- package/vendor/rocksdb/db/db_impl/db_impl_write.cc +2487 -0
- package/vendor/rocksdb/db/db_info_dumper.cc +147 -0
- package/vendor/rocksdb/db/db_info_dumper.h +15 -0
- package/vendor/rocksdb/db/db_inplace_update_test.cc +262 -0
- package/vendor/rocksdb/db/db_io_failure_test.cc +589 -0
- package/vendor/rocksdb/db/db_iter.cc +1708 -0
- package/vendor/rocksdb/db/db_iter.h +411 -0
- package/vendor/rocksdb/db/db_iter_stress_test.cc +658 -0
- package/vendor/rocksdb/db/db_iter_test.cc +3195 -0
- package/vendor/rocksdb/db/db_iterator_test.cc +3304 -0
- package/vendor/rocksdb/db/db_kv_checksum_test.cc +885 -0
- package/vendor/rocksdb/db/db_log_iter_test.cc +297 -0
- package/vendor/rocksdb/db/db_logical_block_size_cache_test.cc +505 -0
- package/vendor/rocksdb/db/db_memtable_test.cc +344 -0
- package/vendor/rocksdb/db/db_merge_operand_test.cc +488 -0
- package/vendor/rocksdb/db/db_merge_operator_test.cc +866 -0
- package/vendor/rocksdb/db/db_options_test.cc +1330 -0
- package/vendor/rocksdb/db/db_properties_test.cc +2377 -0
- package/vendor/rocksdb/db/db_range_del_test.cc +3414 -0
- package/vendor/rocksdb/db/db_rate_limiter_test.cc +437 -0
- package/vendor/rocksdb/db/db_readonly_with_timestamp_test.cc +956 -0
- package/vendor/rocksdb/db/db_secondary_test.cc +1691 -0
- package/vendor/rocksdb/db/db_sst_test.cc +1865 -0
- package/vendor/rocksdb/db/db_statistics_test.cc +292 -0
- package/vendor/rocksdb/db/db_table_properties_test.cc +623 -0
- package/vendor/rocksdb/db/db_tailing_iter_test.cc +595 -0
- package/vendor/rocksdb/db/db_test.cc +7359 -0
- package/vendor/rocksdb/db/db_test2.cc +7679 -0
- package/vendor/rocksdb/db/db_test_util.cc +1759 -0
- package/vendor/rocksdb/db/db_test_util.h +1340 -0
- package/vendor/rocksdb/db/db_universal_compaction_test.cc +2227 -0
- package/vendor/rocksdb/db/db_wal_test.cc +2433 -0
- package/vendor/rocksdb/db/db_with_timestamp_basic_test.cc +4016 -0
- package/vendor/rocksdb/db/db_with_timestamp_compaction_test.cc +353 -0
- package/vendor/rocksdb/db/db_with_timestamp_test_util.cc +96 -0
- package/vendor/rocksdb/db/db_with_timestamp_test_util.h +126 -0
- package/vendor/rocksdb/db/db_write_buffer_manager_test.cc +927 -0
- package/vendor/rocksdb/db/db_write_test.cc +795 -0
- package/vendor/rocksdb/db/dbformat.cc +213 -0
- package/vendor/rocksdb/db/dbformat.h +869 -0
- package/vendor/rocksdb/db/dbformat_test.cc +214 -0
- package/vendor/rocksdb/db/deletefile_test.cc +603 -0
- package/vendor/rocksdb/db/error_handler.cc +792 -0
- package/vendor/rocksdb/db/error_handler.h +124 -0
- package/vendor/rocksdb/db/error_handler_fs_test.cc +2862 -0
- package/vendor/rocksdb/db/event_helpers.cc +323 -0
- package/vendor/rocksdb/db/event_helpers.h +78 -0
- package/vendor/rocksdb/db/experimental.cc +144 -0
- package/vendor/rocksdb/db/external_sst_file_basic_test.cc +2084 -0
- package/vendor/rocksdb/db/external_sst_file_ingestion_job.cc +1104 -0
- package/vendor/rocksdb/db/external_sst_file_ingestion_job.h +238 -0
- package/vendor/rocksdb/db/external_sst_file_test.cc +2859 -0
- package/vendor/rocksdb/db/fault_injection_test.cc +637 -0
- package/vendor/rocksdb/db/file_indexer.cc +218 -0
- package/vendor/rocksdb/db/file_indexer.h +140 -0
- package/vendor/rocksdb/db/file_indexer_test.cc +352 -0
- package/vendor/rocksdb/db/filename_test.cc +241 -0
- package/vendor/rocksdb/db/flush_job.cc +1097 -0
- package/vendor/rocksdb/db/flush_job.h +200 -0
- package/vendor/rocksdb/db/flush_job_test.cc +743 -0
- package/vendor/rocksdb/db/flush_scheduler.cc +86 -0
- package/vendor/rocksdb/db/flush_scheduler.h +55 -0
- package/vendor/rocksdb/db/forward_iterator.cc +1070 -0
- package/vendor/rocksdb/db/forward_iterator.h +166 -0
- package/vendor/rocksdb/db/forward_iterator_bench.cc +378 -0
- package/vendor/rocksdb/db/history_trimming_iterator.h +95 -0
- package/vendor/rocksdb/db/import_column_family_job.cc +364 -0
- package/vendor/rocksdb/db/import_column_family_job.h +82 -0
- package/vendor/rocksdb/db/import_column_family_test.cc +748 -0
- package/vendor/rocksdb/db/internal_stats.cc +2121 -0
- package/vendor/rocksdb/db/internal_stats.h +875 -0
- package/vendor/rocksdb/db/job_context.h +237 -0
- package/vendor/rocksdb/db/kv_checksum.h +484 -0
- package/vendor/rocksdb/db/listener_test.cc +1598 -0
- package/vendor/rocksdb/db/log_format.h +55 -0
- package/vendor/rocksdb/db/log_reader.cc +934 -0
- package/vendor/rocksdb/db/log_reader.h +241 -0
- package/vendor/rocksdb/db/log_test.cc +1216 -0
- package/vendor/rocksdb/db/log_writer.cc +279 -0
- package/vendor/rocksdb/db/log_writer.h +144 -0
- package/vendor/rocksdb/db/logs_with_prep_tracker.cc +67 -0
- package/vendor/rocksdb/db/logs_with_prep_tracker.h +62 -0
- package/vendor/rocksdb/db/lookup_key.h +68 -0
- package/vendor/rocksdb/db/malloc_stats.cc +53 -0
- package/vendor/rocksdb/db/malloc_stats.h +22 -0
- package/vendor/rocksdb/db/manual_compaction_test.cc +308 -0
- package/vendor/rocksdb/db/memtable.cc +1675 -0
- package/vendor/rocksdb/db/memtable.h +660 -0
- package/vendor/rocksdb/db/memtable_list.cc +987 -0
- package/vendor/rocksdb/db/memtable_list.h +471 -0
- package/vendor/rocksdb/db/memtable_list_test.cc +1037 -0
- package/vendor/rocksdb/db/merge_context.h +147 -0
- package/vendor/rocksdb/db/merge_helper.cc +606 -0
- package/vendor/rocksdb/db/merge_helper.h +224 -0
- package/vendor/rocksdb/db/merge_helper_test.cc +298 -0
- package/vendor/rocksdb/db/merge_operator.cc +85 -0
- package/vendor/rocksdb/db/merge_test.cc +621 -0
- package/vendor/rocksdb/db/obsolete_files_test.cc +317 -0
- package/vendor/rocksdb/db/options_file_test.cc +110 -0
- package/vendor/rocksdb/db/output_validator.cc +33 -0
- package/vendor/rocksdb/db/output_validator.h +48 -0
- package/vendor/rocksdb/db/perf_context_test.cc +1158 -0
- package/vendor/rocksdb/db/periodic_task_scheduler.cc +111 -0
- package/vendor/rocksdb/db/periodic_task_scheduler.h +108 -0
- package/vendor/rocksdb/db/periodic_task_scheduler_test.cc +229 -0
- package/vendor/rocksdb/db/pinned_iterators_manager.h +92 -0
- package/vendor/rocksdb/db/plain_table_db_test.cc +1348 -0
- package/vendor/rocksdb/db/post_memtable_callback.h +25 -0
- package/vendor/rocksdb/db/pre_release_callback.h +37 -0
- package/vendor/rocksdb/db/prefix_test.cc +894 -0
- package/vendor/rocksdb/db/range_del_aggregator.cc +555 -0
- package/vendor/rocksdb/db/range_del_aggregator.h +478 -0
- package/vendor/rocksdb/db/range_del_aggregator_bench.cc +280 -0
- package/vendor/rocksdb/db/range_del_aggregator_test.cc +713 -0
- package/vendor/rocksdb/db/range_tombstone_fragmenter.cc +502 -0
- package/vendor/rocksdb/db/range_tombstone_fragmenter.h +356 -0
- package/vendor/rocksdb/db/range_tombstone_fragmenter_test.cc +555 -0
- package/vendor/rocksdb/db/read_callback.h +54 -0
- package/vendor/rocksdb/db/repair.cc +839 -0
- package/vendor/rocksdb/db/repair_test.cc +484 -0
- package/vendor/rocksdb/db/seqno_time_test.cc +994 -0
- package/vendor/rocksdb/db/seqno_to_time_mapping.cc +341 -0
- package/vendor/rocksdb/db/seqno_to_time_mapping.h +189 -0
- package/vendor/rocksdb/db/snapshot_checker.h +58 -0
- package/vendor/rocksdb/db/snapshot_impl.cc +25 -0
- package/vendor/rocksdb/db/snapshot_impl.h +239 -0
- package/vendor/rocksdb/db/table_cache.cc +710 -0
- package/vendor/rocksdb/db/table_cache.h +283 -0
- package/vendor/rocksdb/db/table_cache_sync_and_async.h +130 -0
- package/vendor/rocksdb/db/table_properties_collector.cc +74 -0
- package/vendor/rocksdb/db/table_properties_collector.h +177 -0
- package/vendor/rocksdb/db/table_properties_collector_test.cc +512 -0
- package/vendor/rocksdb/db/transaction_log_impl.cc +296 -0
- package/vendor/rocksdb/db/transaction_log_impl.h +128 -0
- package/vendor/rocksdb/db/trim_history_scheduler.cc +54 -0
- package/vendor/rocksdb/db/trim_history_scheduler.h +46 -0
- package/vendor/rocksdb/db/version_builder.cc +1426 -0
- package/vendor/rocksdb/db/version_builder.h +93 -0
- package/vendor/rocksdb/db/version_builder_test.cc +1840 -0
- package/vendor/rocksdb/db/version_edit.cc +1059 -0
- package/vendor/rocksdb/db/version_edit.h +702 -0
- package/vendor/rocksdb/db/version_edit_handler.cc +1017 -0
- package/vendor/rocksdb/db/version_edit_handler.h +334 -0
- package/vendor/rocksdb/db/version_edit_test.cc +732 -0
- package/vendor/rocksdb/db/version_set.cc +7286 -0
- package/vendor/rocksdb/db/version_set.h +1714 -0
- package/vendor/rocksdb/db/version_set_sync_and_async.h +172 -0
- package/vendor/rocksdb/db/version_set_test.cc +3659 -0
- package/vendor/rocksdb/db/version_util.h +72 -0
- package/vendor/rocksdb/db/wal_edit.cc +211 -0
- package/vendor/rocksdb/db/wal_edit.h +177 -0
- package/vendor/rocksdb/db/wal_edit_test.cc +213 -0
- package/vendor/rocksdb/db/wal_manager.cc +527 -0
- package/vendor/rocksdb/db/wal_manager.h +136 -0
- package/vendor/rocksdb/db/wal_manager_test.cc +336 -0
- package/vendor/rocksdb/db/wide/db_wide_basic_test.cc +1042 -0
- package/vendor/rocksdb/db/wide/wide_column_serialization.cc +182 -0
- package/vendor/rocksdb/db/wide/wide_column_serialization.h +77 -0
- package/vendor/rocksdb/db/wide/wide_column_serialization_test.cc +338 -0
- package/vendor/rocksdb/db/wide/wide_columns.cc +22 -0
- package/vendor/rocksdb/db/write_batch.cc +3142 -0
- package/vendor/rocksdb/db/write_batch_base.cc +94 -0
- package/vendor/rocksdb/db/write_batch_internal.h +401 -0
- package/vendor/rocksdb/db/write_batch_test.cc +1112 -0
- package/vendor/rocksdb/db/write_callback.h +27 -0
- package/vendor/rocksdb/db/write_callback_test.cc +454 -0
- package/vendor/rocksdb/db/write_controller.cc +121 -0
- package/vendor/rocksdb/db/write_controller.h +148 -0
- package/vendor/rocksdb/db/write_controller_test.cc +248 -0
- package/vendor/rocksdb/db/write_stall_stats.cc +179 -0
- package/vendor/rocksdb/db/write_stall_stats.h +47 -0
- package/vendor/rocksdb/db/write_thread.cc +844 -0
- package/vendor/rocksdb/db/write_thread.h +464 -0
- package/vendor/rocksdb/db_stress_tool/CMakeLists.txt +18 -0
- package/vendor/rocksdb/db_stress_tool/batched_ops_stress.cc +593 -0
- package/vendor/rocksdb/db_stress_tool/cf_consistency_stress.cc +892 -0
- package/vendor/rocksdb/db_stress_tool/db_stress.cc +25 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_common.cc +491 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_common.h +674 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_compaction_filter.h +96 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_driver.cc +216 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_driver.h +18 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_env_wrapper.h +78 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_gflags.cc +1094 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_listener.cc +189 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_listener.h +269 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_shared_state.cc +17 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_shared_state.h +437 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_stat.cc +17 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_stat.h +219 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_table_properties_collector.h +65 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_test_base.cc +3294 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_test_base.h +327 -0
- package/vendor/rocksdb/db_stress_tool/db_stress_tool.cc +371 -0
- package/vendor/rocksdb/db_stress_tool/expected_state.cc +780 -0
- package/vendor/rocksdb/db_stress_tool/expected_state.h +329 -0
- package/vendor/rocksdb/db_stress_tool/expected_value.cc +122 -0
- package/vendor/rocksdb/db_stress_tool/expected_value.h +206 -0
- package/vendor/rocksdb/db_stress_tool/multi_ops_txns_stress.cc +1761 -0
- package/vendor/rocksdb/db_stress_tool/multi_ops_txns_stress.h +446 -0
- package/vendor/rocksdb/db_stress_tool/no_batched_ops_stress.cc +1906 -0
- package/vendor/rocksdb/docs/CNAME +1 -0
- package/vendor/rocksdb/docs/CONTRIBUTING.md +115 -0
- package/vendor/rocksdb/docs/Gemfile +4 -0
- package/vendor/rocksdb/docs/LICENSE-DOCUMENTATION +385 -0
- package/vendor/rocksdb/docs/README.md +80 -0
- package/vendor/rocksdb/docs/TEMPLATE-INFORMATION.md +17 -0
- package/vendor/rocksdb/docs/_config.yml +85 -0
- package/vendor/rocksdb/docs/_data/authors.yml +81 -0
- package/vendor/rocksdb/docs/_data/features.yml +19 -0
- package/vendor/rocksdb/docs/_data/nav.yml +30 -0
- package/vendor/rocksdb/docs/_data/nav_docs.yml +3 -0
- package/vendor/rocksdb/docs/_data/powered_by.yml +1 -0
- package/vendor/rocksdb/docs/_data/powered_by_highlight.yml +1 -0
- package/vendor/rocksdb/docs/_data/promo.yml +6 -0
- package/vendor/rocksdb/docs/_docs/faq.md +48 -0
- package/vendor/rocksdb/docs/_docs/getting-started.md +78 -0
- package/vendor/rocksdb/docs/_includes/blog_pagination.html +28 -0
- package/vendor/rocksdb/docs/_includes/content/gridblocks.html +5 -0
- package/vendor/rocksdb/docs/_includes/content/items/gridblock.html +37 -0
- package/vendor/rocksdb/docs/_includes/doc.html +25 -0
- package/vendor/rocksdb/docs/_includes/doc_paging.html +0 -0
- package/vendor/rocksdb/docs/_includes/footer.html +34 -0
- package/vendor/rocksdb/docs/_includes/head.html +23 -0
- package/vendor/rocksdb/docs/_includes/header.html +19 -0
- package/vendor/rocksdb/docs/_includes/hero.html +0 -0
- package/vendor/rocksdb/docs/_includes/home_header.html +22 -0
- package/vendor/rocksdb/docs/_includes/katex_import.html +3 -0
- package/vendor/rocksdb/docs/_includes/katex_render.html +210 -0
- package/vendor/rocksdb/docs/_includes/nav/collection_nav.html +64 -0
- package/vendor/rocksdb/docs/_includes/nav/collection_nav_group.html +19 -0
- package/vendor/rocksdb/docs/_includes/nav/collection_nav_group_item.html +1 -0
- package/vendor/rocksdb/docs/_includes/nav/header_nav.html +30 -0
- package/vendor/rocksdb/docs/_includes/nav.html +37 -0
- package/vendor/rocksdb/docs/_includes/nav_search.html +15 -0
- package/vendor/rocksdb/docs/_includes/plugins/all_share.html +3 -0
- package/vendor/rocksdb/docs/_includes/plugins/ascii_cinema.html +2 -0
- package/vendor/rocksdb/docs/_includes/plugins/button.html +6 -0
- package/vendor/rocksdb/docs/_includes/plugins/github_star.html +4 -0
- package/vendor/rocksdb/docs/_includes/plugins/github_watch.html +4 -0
- package/vendor/rocksdb/docs/_includes/plugins/google_share.html +5 -0
- package/vendor/rocksdb/docs/_includes/plugins/iframe.html +6 -0
- package/vendor/rocksdb/docs/_includes/plugins/like_button.html +18 -0
- package/vendor/rocksdb/docs/_includes/plugins/plugin_row.html +5 -0
- package/vendor/rocksdb/docs/_includes/plugins/post_social_plugins.html +41 -0
- package/vendor/rocksdb/docs/_includes/plugins/slideshow.html +88 -0
- package/vendor/rocksdb/docs/_includes/plugins/twitter_follow.html +12 -0
- package/vendor/rocksdb/docs/_includes/plugins/twitter_share.html +11 -0
- package/vendor/rocksdb/docs/_includes/post.html +40 -0
- package/vendor/rocksdb/docs/_includes/powered_by.html +28 -0
- package/vendor/rocksdb/docs/_includes/social_plugins.html +31 -0
- package/vendor/rocksdb/docs/_includes/ui/button.html +1 -0
- package/vendor/rocksdb/docs/_layouts/basic.html +12 -0
- package/vendor/rocksdb/docs/_layouts/blog.html +11 -0
- package/vendor/rocksdb/docs/_layouts/blog_default.html +14 -0
- package/vendor/rocksdb/docs/_layouts/default.html +12 -0
- package/vendor/rocksdb/docs/_layouts/doc_default.html +14 -0
- package/vendor/rocksdb/docs/_layouts/doc_page.html +10 -0
- package/vendor/rocksdb/docs/_layouts/docs.html +5 -0
- package/vendor/rocksdb/docs/_layouts/home.html +26 -0
- package/vendor/rocksdb/docs/_layouts/page.html +3 -0
- package/vendor/rocksdb/docs/_layouts/plain.html +10 -0
- package/vendor/rocksdb/docs/_layouts/post.html +8 -0
- package/vendor/rocksdb/docs/_layouts/redirect.html +6 -0
- package/vendor/rocksdb/docs/_layouts/top-level.html +10 -0
- package/vendor/rocksdb/docs/_posts/2014-03-27-how-to-backup-rocksdb.markdown +135 -0
- package/vendor/rocksdb/docs/_posts/2014-03-27-how-to-persist-in-memory-rocksdb-database.markdown +54 -0
- package/vendor/rocksdb/docs/_posts/2014-04-02-the-1st-rocksdb-local-meetup-held-on-march-27-2014.markdown +53 -0
- package/vendor/rocksdb/docs/_posts/2014-04-07-rocksdb-2-8-release.markdown +40 -0
- package/vendor/rocksdb/docs/_posts/2014-04-21-indexing-sst-files-for-better-lookup-performance.markdown +28 -0
- package/vendor/rocksdb/docs/_posts/2014-05-14-lock.markdown +88 -0
- package/vendor/rocksdb/docs/_posts/2014-05-19-rocksdb-3-0-release.markdown +24 -0
- package/vendor/rocksdb/docs/_posts/2014-05-22-rocksdb-3-1-release.markdown +20 -0
- package/vendor/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown +47 -0
- package/vendor/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown +89 -0
- package/vendor/rocksdb/docs/_posts/2014-06-27-rocksdb-3-2-release.markdown +30 -0
- package/vendor/rocksdb/docs/_posts/2014-07-29-rocksdb-3-3-release.markdown +34 -0
- package/vendor/rocksdb/docs/_posts/2014-09-12-cuckoo.markdown +74 -0
- package/vendor/rocksdb/docs/_posts/2014-09-12-new-bloom-filter-format.markdown +52 -0
- package/vendor/rocksdb/docs/_posts/2014-09-15-rocksdb-3-5-release.markdown +38 -0
- package/vendor/rocksdb/docs/_posts/2015-01-16-migrating-from-leveldb-to-rocksdb-2.markdown +112 -0
- package/vendor/rocksdb/docs/_posts/2015-02-24-reading-rocksdb-options-from-a-file.markdown +41 -0
- package/vendor/rocksdb/docs/_posts/2015-02-27-write-batch-with-index.markdown +20 -0
- package/vendor/rocksdb/docs/_posts/2015-04-22-integrating-rocksdb-with-mongodb-2.markdown +16 -0
- package/vendor/rocksdb/docs/_posts/2015-06-12-rocksdb-in-osquery.markdown +10 -0
- package/vendor/rocksdb/docs/_posts/2015-07-15-rocksdb-2015-h2-roadmap.markdown +92 -0
- package/vendor/rocksdb/docs/_posts/2015-07-17-spatial-indexing-in-rocksdb.markdown +78 -0
- package/vendor/rocksdb/docs/_posts/2015-07-22-rocksdb-is-now-available-in-windows-platform.markdown +30 -0
- package/vendor/rocksdb/docs/_posts/2015-07-23-dynamic-level.markdown +29 -0
- package/vendor/rocksdb/docs/_posts/2015-10-27-getthreadlist.markdown +193 -0
- package/vendor/rocksdb/docs/_posts/2015-11-10-use-checkpoints-for-efficient-snapshots.markdown +45 -0
- package/vendor/rocksdb/docs/_posts/2015-11-16-analysis-file-read-latency-by-level.markdown +244 -0
- package/vendor/rocksdb/docs/_posts/2016-01-29-compaction_pri.markdown +51 -0
- package/vendor/rocksdb/docs/_posts/2016-02-24-rocksdb-4-2-release.markdown +41 -0
- package/vendor/rocksdb/docs/_posts/2016-02-25-rocksdb-ama.markdown +20 -0
- package/vendor/rocksdb/docs/_posts/2016-03-07-rocksdb-options-file.markdown +24 -0
- package/vendor/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown +60 -0
- package/vendor/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown +48 -0
- package/vendor/rocksdb/docs/_posts/2016-09-28-rocksdb-4-11-2-released.markdown +49 -0
- package/vendor/rocksdb/docs/_posts/2017-01-06-rocksdb-5-0-1-released.markdown +26 -0
- package/vendor/rocksdb/docs/_posts/2017-02-07-rocksdb-5-1-2-released.markdown +15 -0
- package/vendor/rocksdb/docs/_posts/2017-02-17-bulkoad-ingest-sst-file.markdown +50 -0
- package/vendor/rocksdb/docs/_posts/2017-03-02-rocksdb-5-2-1-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2017-05-12-partitioned-index-filter.markdown +34 -0
- package/vendor/rocksdb/docs/_posts/2017-05-14-core-local-stats.markdown +106 -0
- package/vendor/rocksdb/docs/_posts/2017-05-26-rocksdb-5-4-5-released.markdown +39 -0
- package/vendor/rocksdb/docs/_posts/2017-06-26-17-level-based-changes.markdown +60 -0
- package/vendor/rocksdb/docs/_posts/2017-06-29-rocksdb-5-5-1-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2017-07-25-rocksdb-5-6-1-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2017-08-24-pinnableslice.markdown +37 -0
- package/vendor/rocksdb/docs/_posts/2017-08-25-flushwal.markdown +26 -0
- package/vendor/rocksdb/docs/_posts/2017-09-28-rocksdb-5-8-released.markdown +25 -0
- package/vendor/rocksdb/docs/_posts/2017-12-18-17-auto-tuned-rate-limiter.markdown +28 -0
- package/vendor/rocksdb/docs/_posts/2017-12-19-write-prepared-txn.markdown +41 -0
- package/vendor/rocksdb/docs/_posts/2018-02-05-rocksdb-5-10-2-released.markdown +22 -0
- package/vendor/rocksdb/docs/_posts/2018-08-01-rocksdb-tuning-advisor.markdown +58 -0
- package/vendor/rocksdb/docs/_posts/2018-08-23-data-block-hash-index.markdown +118 -0
- package/vendor/rocksdb/docs/_posts/2018-11-21-delete-range.markdown +292 -0
- package/vendor/rocksdb/docs/_posts/2019-03-08-format-version-4.markdown +36 -0
- package/vendor/rocksdb/docs/_posts/2019-08-15-unordered-write.markdown +56 -0
- package/vendor/rocksdb/docs/_posts/2021-04-12-universal-improvements.markdown +46 -0
- package/vendor/rocksdb/docs/_posts/2021-05-26-integrated-blob-db.markdown +101 -0
- package/vendor/rocksdb/docs/_posts/2021-05-26-online-validation.markdown +17 -0
- package/vendor/rocksdb/docs/_posts/2021-05-27-rocksdb-secondary-cache.markdown +195 -0
- package/vendor/rocksdb/docs/_posts/2021-05-31-dictionary-compression.markdown +157 -0
- package/vendor/rocksdb/docs/_posts/2021-12-29-ribbon-filter.markdown +281 -0
- package/vendor/rocksdb/docs/_posts/2022-07-18-per-key-value-checksum.markdown +142 -0
- package/vendor/rocksdb/docs/_posts/2022-10-05-lost-buffered-write-recovery.markdown +123 -0
- package/vendor/rocksdb/docs/_posts/2022-10-07-asynchronous-io-in-rocksdb.markdown +133 -0
- package/vendor/rocksdb/docs/_posts/2022-10-31-align-compaction-output-file.markdown +107 -0
- package/vendor/rocksdb/docs/_posts/2022-11-09-time-aware-tiered-storage.markdown +121 -0
- package/vendor/rocksdb/docs/_sass/_base.scss +492 -0
- package/vendor/rocksdb/docs/_sass/_blog.scss +47 -0
- package/vendor/rocksdb/docs/_sass/_buttons.scss +47 -0
- package/vendor/rocksdb/docs/_sass/_footer.scss +82 -0
- package/vendor/rocksdb/docs/_sass/_gridBlock.scss +115 -0
- package/vendor/rocksdb/docs/_sass/_header.scss +139 -0
- package/vendor/rocksdb/docs/_sass/_poweredby.scss +69 -0
- package/vendor/rocksdb/docs/_sass/_promo.scss +55 -0
- package/vendor/rocksdb/docs/_sass/_react_docs_nav.scss +332 -0
- package/vendor/rocksdb/docs/_sass/_react_header_nav.scss +141 -0
- package/vendor/rocksdb/docs/_sass/_reset.scss +43 -0
- package/vendor/rocksdb/docs/_sass/_search.scss +142 -0
- package/vendor/rocksdb/docs/_sass/_slideshow.scss +48 -0
- package/vendor/rocksdb/docs/_sass/_syntax-highlighting.scss +129 -0
- package/vendor/rocksdb/docs/_sass/_tables.scss +47 -0
- package/vendor/rocksdb/docs/_top-level/support.md +22 -0
- package/vendor/rocksdb/docs/blog/all.html +20 -0
- package/vendor/rocksdb/docs/blog/index.html +12 -0
- package/vendor/rocksdb/docs/css/main.scss +159 -0
- package/vendor/rocksdb/docs/doc-type-examples/2016-04-07-blog-post-example.md +21 -0
- package/vendor/rocksdb/docs/doc-type-examples/docs-hello-world.md +12 -0
- package/vendor/rocksdb/docs/doc-type-examples/top-level-example.md +8 -0
- package/vendor/rocksdb/docs/docs/index.html +6 -0
- package/vendor/rocksdb/docs/feed.xml +30 -0
- package/vendor/rocksdb/docs/index.md +9 -0
- package/vendor/rocksdb/docs/static/favicon.png +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Black.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Black.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-BlackItalic.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-BlackItalic.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Italic.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Italic.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Light.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Light.woff2 +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Regular.woff +0 -0
- package/vendor/rocksdb/docs/static/fonts/LatoLatin-Regular.woff2 +0 -0
- package/vendor/rocksdb/docs/static/images/Resize-of-20140327_200754-300x225.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/compaction_output_file_size_compare.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_align.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_normal.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_trival_move.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/file_size_compare.png +0 -0
- package/vendor/rocksdb/docs/static/images/align-compaction-output/write_amp_compare.png +0 -0
- package/vendor/rocksdb/docs/static/images/asynchronous-io/mget_async.png +0 -0
- package/vendor/rocksdb/docs/static/images/asynchronous-io/scan_async.png +0 -0
- package/vendor/rocksdb/docs/static/images/binaryseek.png +0 -0
- package/vendor/rocksdb/docs/static/images/bloom_fp_vs_bpk.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/full-range.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/l0-l1-contend.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/l1-l2-contend.png +0 -0
- package/vendor/rocksdb/docs/static/images/compaction/part-range-old.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/block-format-binary-seek.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/block-format-hash-index.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/hash-index-data-structure.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/perf-cache-miss.png +0 -0
- package/vendor/rocksdb/docs/static/images/data-block-hash-index/perf-throughput.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_collapsed.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_key_schema.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_sst_blocks.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_uncollapsed.png +0 -0
- package/vendor/rocksdb/docs/static/images/delrange/delrange_write_path.png +0 -0
- package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_raw_sampled.png +0 -0
- package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_sst_blocks.png +0 -0
- package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_zstd_trained.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Legacy_Vs_Integrated.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_RW_RO_Perf.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Amp.png +0 -0
- package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Perf.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Memtable-entry.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Memtable-write.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Memtable.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Writebatch-to-Memtable.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Writebatch.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-fragment.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-read.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-write.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Write-batch.png +0 -0
- package/vendor/rocksdb/docs/static/images/kv-checksum/Writebatch-write.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/angry-cat.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/basic-setup.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/happy-cat.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/replay-extension.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/test-fs-writable-file.png +0 -0
- package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/trace-extension.png +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-blockindex.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-fileindex.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-filelayout.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-readiopath.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-tieredstorage.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/pcache-writeiopath.jpg +0 -0
- package/vendor/rocksdb/docs/static/images/promo-adapt.svg +8 -0
- package/vendor/rocksdb/docs/static/images/promo-flash.svg +28 -0
- package/vendor/rocksdb/docs/static/images/promo-operations.svg +6 -0
- package/vendor/rocksdb/docs/static/images/promo-performance.svg +134 -0
- package/vendor/rocksdb/docs/static/images/rate-limiter/auto-tuned-write-KBps-series.png +0 -0
- package/vendor/rocksdb/docs/static/images/rate-limiter/write-KBps-cdf.png +0 -0
- package/vendor/rocksdb/docs/static/images/rate-limiter/write-KBps-series.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/Mixgraph_hit_rate.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/Mixgraph_throughput.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/arch_diagram.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/insert_flow.png +0 -0
- package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/lookup_flow.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/compaction_moving_up_conflict.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/per_key_placement_compaction.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_design.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_overview.png +0 -0
- package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_problem.png +0 -0
- package/vendor/rocksdb/docs/static/images/tree_example1.png +0 -0
- package/vendor/rocksdb/docs/static/logo.svg +76 -0
- package/vendor/rocksdb/docs/static/og_image.png +0 -0
- package/vendor/rocksdb/env/composite_env.cc +534 -0
- package/vendor/rocksdb/env/composite_env_wrapper.h +378 -0
- package/vendor/rocksdb/env/emulated_clock.h +114 -0
- package/vendor/rocksdb/env/env.cc +1233 -0
- package/vendor/rocksdb/env/env_basic_test.cc +397 -0
- package/vendor/rocksdb/env/env_chroot.cc +148 -0
- package/vendor/rocksdb/env/env_chroot.h +55 -0
- package/vendor/rocksdb/env/env_encryption.cc +1346 -0
- package/vendor/rocksdb/env/env_encryption_ctr.h +114 -0
- package/vendor/rocksdb/env/env_posix.cc +524 -0
- package/vendor/rocksdb/env/env_test.cc +3577 -0
- package/vendor/rocksdb/env/file_system.cc +277 -0
- package/vendor/rocksdb/env/file_system_tracer.cc +564 -0
- package/vendor/rocksdb/env/file_system_tracer.h +461 -0
- package/vendor/rocksdb/env/fs_posix.cc +1284 -0
- package/vendor/rocksdb/env/fs_readonly.h +105 -0
- package/vendor/rocksdb/env/fs_remap.cc +341 -0
- package/vendor/rocksdb/env/fs_remap.h +137 -0
- package/vendor/rocksdb/env/io_posix.cc +1733 -0
- package/vendor/rocksdb/env/io_posix.h +523 -0
- package/vendor/rocksdb/env/io_posix_test.cc +141 -0
- package/vendor/rocksdb/env/mock_env.cc +1058 -0
- package/vendor/rocksdb/env/mock_env.h +144 -0
- package/vendor/rocksdb/env/mock_env_test.cc +84 -0
- package/vendor/rocksdb/env/unique_id_gen.cc +164 -0
- package/vendor/rocksdb/env/unique_id_gen.h +85 -0
- package/vendor/rocksdb/examples/CMakeLists.txt +45 -0
- package/vendor/rocksdb/examples/Makefile +58 -0
- package/vendor/rocksdb/examples/README.md +2 -0
- package/vendor/rocksdb/examples/c_simple_example.c +96 -0
- package/vendor/rocksdb/examples/column_families_example.cc +88 -0
- package/vendor/rocksdb/examples/compact_files_example.cc +177 -0
- package/vendor/rocksdb/examples/compaction_filter_example.cc +96 -0
- package/vendor/rocksdb/examples/multi_processes_example.cc +393 -0
- package/vendor/rocksdb/examples/optimistic_transaction_example.cc +190 -0
- package/vendor/rocksdb/examples/options_file_example.cc +132 -0
- package/vendor/rocksdb/examples/rocksdb_backup_restore_example.cc +99 -0
- package/vendor/rocksdb/examples/rocksdb_option_file_example.ini +142 -0
- package/vendor/rocksdb/examples/simple_example.cc +93 -0
- package/vendor/rocksdb/examples/transaction_example.cc +196 -0
- package/vendor/rocksdb/file/delete_scheduler.cc +409 -0
- package/vendor/rocksdb/file/delete_scheduler.h +147 -0
- package/vendor/rocksdb/file/delete_scheduler_test.cc +717 -0
- package/vendor/rocksdb/file/file_prefetch_buffer.cc +955 -0
- package/vendor/rocksdb/file/file_prefetch_buffer.h +471 -0
- package/vendor/rocksdb/file/file_util.cc +277 -0
- package/vendor/rocksdb/file/file_util.h +91 -0
- package/vendor/rocksdb/file/filename.cc +523 -0
- package/vendor/rocksdb/file/filename.h +188 -0
- package/vendor/rocksdb/file/line_file_reader.cc +73 -0
- package/vendor/rocksdb/file/line_file_reader.h +60 -0
- package/vendor/rocksdb/file/prefetch_test.cc +2374 -0
- package/vendor/rocksdb/file/random_access_file_reader.cc +599 -0
- package/vendor/rocksdb/file/random_access_file_reader.h +210 -0
- package/vendor/rocksdb/file/random_access_file_reader_test.cc +479 -0
- package/vendor/rocksdb/file/read_write_util.cc +33 -0
- package/vendor/rocksdb/file/read_write_util.h +31 -0
- package/vendor/rocksdb/file/readahead_file_info.h +33 -0
- package/vendor/rocksdb/file/readahead_raf.cc +169 -0
- package/vendor/rocksdb/file/readahead_raf.h +29 -0
- package/vendor/rocksdb/file/sequence_file_reader.cc +320 -0
- package/vendor/rocksdb/file/sequence_file_reader.h +119 -0
- package/vendor/rocksdb/file/sst_file_manager_impl.cc +507 -0
- package/vendor/rocksdb/file/sst_file_manager_impl.h +193 -0
- package/vendor/rocksdb/file/writable_file_writer.cc +989 -0
- package/vendor/rocksdb/file/writable_file_writer.h +320 -0
- package/vendor/rocksdb/fuzz/Makefile +67 -0
- package/vendor/rocksdb/fuzz/README.md +165 -0
- package/vendor/rocksdb/fuzz/db_fuzzer.cc +172 -0
- package/vendor/rocksdb/fuzz/db_map_fuzzer.cc +107 -0
- package/vendor/rocksdb/fuzz/proto/db_operation.proto +28 -0
- package/vendor/rocksdb/fuzz/sst_file_writer_fuzzer.cc +210 -0
- package/vendor/rocksdb/fuzz/util.h +29 -0
- package/vendor/rocksdb/include/rocksdb/advanced_cache.h +623 -0
- package/vendor/rocksdb/include/rocksdb/advanced_options.h +1177 -0
- package/vendor/rocksdb/include/rocksdb/block_cache_trace_writer.h +149 -0
- package/vendor/rocksdb/include/rocksdb/c.h +2864 -0
- package/vendor/rocksdb/include/rocksdb/cache.h +442 -0
- package/vendor/rocksdb/include/rocksdb/cache_bench_tool.h +14 -0
- package/vendor/rocksdb/include/rocksdb/cleanable.h +128 -0
- package/vendor/rocksdb/include/rocksdb/compaction_filter.h +363 -0
- package/vendor/rocksdb/include/rocksdb/compaction_job_stats.h +109 -0
- package/vendor/rocksdb/include/rocksdb/comparator.h +164 -0
- package/vendor/rocksdb/include/rocksdb/compression_type.h +40 -0
- package/vendor/rocksdb/include/rocksdb/concurrent_task_limiter.h +51 -0
- package/vendor/rocksdb/include/rocksdb/configurable.h +390 -0
- package/vendor/rocksdb/include/rocksdb/convenience.h +466 -0
- package/vendor/rocksdb/include/rocksdb/customizable.h +229 -0
- package/vendor/rocksdb/include/rocksdb/data_structure.h +186 -0
- package/vendor/rocksdb/include/rocksdb/db.h +1980 -0
- package/vendor/rocksdb/include/rocksdb/db_bench_tool.h +11 -0
- package/vendor/rocksdb/include/rocksdb/db_dump_tool.h +43 -0
- package/vendor/rocksdb/include/rocksdb/db_stress_tool.h +11 -0
- package/vendor/rocksdb/include/rocksdb/env.h +1882 -0
- package/vendor/rocksdb/include/rocksdb/env_encryption.h +463 -0
- package/vendor/rocksdb/include/rocksdb/experimental.h +56 -0
- package/vendor/rocksdb/include/rocksdb/file_checksum.h +146 -0
- package/vendor/rocksdb/include/rocksdb/file_system.h +1849 -0
- package/vendor/rocksdb/include/rocksdb/filter_policy.h +206 -0
- package/vendor/rocksdb/include/rocksdb/flush_block_policy.h +75 -0
- package/vendor/rocksdb/include/rocksdb/functor_wrapper.h +56 -0
- package/vendor/rocksdb/include/rocksdb/io_status.h +244 -0
- package/vendor/rocksdb/include/rocksdb/iostats_context.h +98 -0
- package/vendor/rocksdb/include/rocksdb/iterator.h +144 -0
- package/vendor/rocksdb/include/rocksdb/ldb_tool.h +42 -0
- package/vendor/rocksdb/include/rocksdb/listener.h +840 -0
- package/vendor/rocksdb/include/rocksdb/memory_allocator.h +87 -0
- package/vendor/rocksdb/include/rocksdb/memtablerep.h +421 -0
- package/vendor/rocksdb/include/rocksdb/merge_operator.h +286 -0
- package/vendor/rocksdb/include/rocksdb/metadata.h +258 -0
- package/vendor/rocksdb/include/rocksdb/options.h +2083 -0
- package/vendor/rocksdb/include/rocksdb/perf_context.h +314 -0
- package/vendor/rocksdb/include/rocksdb/perf_level.h +36 -0
- package/vendor/rocksdb/include/rocksdb/persistent_cache.h +74 -0
- package/vendor/rocksdb/include/rocksdb/port_defs.h +22 -0
- package/vendor/rocksdb/include/rocksdb/rate_limiter.h +159 -0
- package/vendor/rocksdb/include/rocksdb/rocksdb_namespace.h +16 -0
- package/vendor/rocksdb/include/rocksdb/secondary_cache.h +139 -0
- package/vendor/rocksdb/include/rocksdb/slice.h +264 -0
- package/vendor/rocksdb/include/rocksdb/slice_transform.h +135 -0
- package/vendor/rocksdb/include/rocksdb/snapshot.h +53 -0
- package/vendor/rocksdb/include/rocksdb/sst_dump_tool.h +17 -0
- package/vendor/rocksdb/include/rocksdb/sst_file_manager.h +136 -0
- package/vendor/rocksdb/include/rocksdb/sst_file_reader.h +45 -0
- package/vendor/rocksdb/include/rocksdb/sst_file_writer.h +189 -0
- package/vendor/rocksdb/include/rocksdb/sst_partitioner.h +142 -0
- package/vendor/rocksdb/include/rocksdb/statistics.h +757 -0
- package/vendor/rocksdb/include/rocksdb/stats_history.h +70 -0
- package/vendor/rocksdb/include/rocksdb/status.h +574 -0
- package/vendor/rocksdb/include/rocksdb/system_clock.h +114 -0
- package/vendor/rocksdb/include/rocksdb/table.h +927 -0
- package/vendor/rocksdb/include/rocksdb/table_properties.h +332 -0
- package/vendor/rocksdb/include/rocksdb/table_reader_caller.h +41 -0
- package/vendor/rocksdb/include/rocksdb/thread_status.h +190 -0
- package/vendor/rocksdb/include/rocksdb/threadpool.h +67 -0
- package/vendor/rocksdb/include/rocksdb/trace_reader_writer.h +52 -0
- package/vendor/rocksdb/include/rocksdb/trace_record.h +248 -0
- package/vendor/rocksdb/include/rocksdb/trace_record_result.h +187 -0
- package/vendor/rocksdb/include/rocksdb/transaction_log.h +122 -0
- package/vendor/rocksdb/include/rocksdb/types.h +94 -0
- package/vendor/rocksdb/include/rocksdb/unique_id.h +55 -0
- package/vendor/rocksdb/include/rocksdb/universal_compaction.h +96 -0
- package/vendor/rocksdb/include/rocksdb/utilities/agg_merge.h +138 -0
- package/vendor/rocksdb/include/rocksdb/utilities/backup_engine.h +689 -0
- package/vendor/rocksdb/include/rocksdb/utilities/cache_dump_load.h +140 -0
- package/vendor/rocksdb/include/rocksdb/utilities/checkpoint.h +63 -0
- package/vendor/rocksdb/include/rocksdb/utilities/convenience.h +10 -0
- package/vendor/rocksdb/include/rocksdb/utilities/customizable_util.h +322 -0
- package/vendor/rocksdb/include/rocksdb/utilities/db_ttl.h +70 -0
- package/vendor/rocksdb/include/rocksdb/utilities/debug.h +46 -0
- package/vendor/rocksdb/include/rocksdb/utilities/env_mirror.h +179 -0
- package/vendor/rocksdb/include/rocksdb/utilities/info_log_finder.h +19 -0
- package/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd.h +316 -0
- package/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd_execute_result.h +75 -0
- package/vendor/rocksdb/include/rocksdb/utilities/leveldb_options.h +145 -0
- package/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_custom_library.h +43 -0
- package/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_util.h +55 -0
- package/vendor/rocksdb/include/rocksdb/utilities/memory_util.h +48 -0
- package/vendor/rocksdb/include/rocksdb/utilities/object_registry.h +583 -0
- package/vendor/rocksdb/include/rocksdb/utilities/optimistic_transaction_db.h +98 -0
- package/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h +24 -0
- package/vendor/rocksdb/include/rocksdb/utilities/options_type.h +1221 -0
- package/vendor/rocksdb/include/rocksdb/utilities/options_util.h +105 -0
- package/vendor/rocksdb/include/rocksdb/utilities/replayer.h +85 -0
- package/vendor/rocksdb/include/rocksdb/utilities/sim_cache.h +93 -0
- package/vendor/rocksdb/include/rocksdb/utilities/stackable_db.h +587 -0
- package/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +88 -0
- package/vendor/rocksdb/include/rocksdb/utilities/transaction.h +683 -0
- package/vendor/rocksdb/include/rocksdb/utilities/transaction_db.h +506 -0
- package/vendor/rocksdb/include/rocksdb/utilities/transaction_db_mutex.h +89 -0
- package/vendor/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +307 -0
- package/vendor/rocksdb/include/rocksdb/version.h +43 -0
- package/vendor/rocksdb/include/rocksdb/wal_filter.h +111 -0
- package/vendor/rocksdb/include/rocksdb/wide_columns.h +210 -0
- package/vendor/rocksdb/include/rocksdb/write_batch.h +494 -0
- package/vendor/rocksdb/include/rocksdb/write_batch_base.h +144 -0
- package/vendor/rocksdb/include/rocksdb/write_buffer_manager.h +183 -0
- package/vendor/rocksdb/issue_template.md +7 -0
- package/vendor/rocksdb/java/CMakeLists.txt +549 -0
- package/vendor/rocksdb/java/GetBenchmarks.md +161 -0
- package/vendor/rocksdb/java/HISTORY-JAVA.md +86 -0
- package/vendor/rocksdb/java/Makefile +453 -0
- package/vendor/rocksdb/java/RELEASE.md +59 -0
- package/vendor/rocksdb/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java +1640 -0
- package/vendor/rocksdb/java/crossbuild/Vagrantfile +51 -0
- package/vendor/rocksdb/java/crossbuild/build-linux-alpine.sh +70 -0
- package/vendor/rocksdb/java/crossbuild/build-linux-centos.sh +38 -0
- package/vendor/rocksdb/java/crossbuild/build-linux.sh +15 -0
- package/vendor/rocksdb/java/crossbuild/docker-build-linux-alpine.sh +17 -0
- package/vendor/rocksdb/java/crossbuild/docker-build-linux-centos.sh +38 -0
- package/vendor/rocksdb/java/jdb_bench.sh +13 -0
- package/vendor/rocksdb/java/jmh/LICENSE-HEADER.txt +5 -0
- package/vendor/rocksdb/java/jmh/README.md +24 -0
- package/vendor/rocksdb/java/jmh/pom.xml +138 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/ComparatorBenchmarks.java +139 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/GetBenchmarks.java +215 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/MultiGetBenchmarks.java +214 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/PutBenchmarks.java +112 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/util/FileUtils.java +59 -0
- package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/util/KVUtils.java +72 -0
- package/vendor/rocksdb/java/pom.xml.template +178 -0
- package/vendor/rocksdb/java/rocksjni/backup_engine_options.cc +365 -0
- package/vendor/rocksdb/java/rocksjni/backupenginejni.cc +279 -0
- package/vendor/rocksdb/java/rocksjni/cache.cc +34 -0
- package/vendor/rocksdb/java/rocksjni/cassandra_compactionfilterjni.cc +25 -0
- package/vendor/rocksdb/java/rocksjni/cassandra_value_operator.cc +50 -0
- package/vendor/rocksdb/java/rocksjni/checkpoint.cc +71 -0
- package/vendor/rocksdb/java/rocksjni/clock_cache.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/columnfamilyhandle.cc +72 -0
- package/vendor/rocksdb/java/rocksjni/compact_range_options.cc +222 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter.cc +29 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter_factory.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter_factory_jnicallback.cc +79 -0
- package/vendor/rocksdb/java/rocksjni/compaction_filter_factory_jnicallback.h +37 -0
- package/vendor/rocksdb/java/rocksjni/compaction_job_info.cc +230 -0
- package/vendor/rocksdb/java/rocksjni/compaction_job_stats.cc +345 -0
- package/vendor/rocksdb/java/rocksjni/compaction_options.cc +112 -0
- package/vendor/rocksdb/java/rocksjni/compaction_options_fifo.cc +83 -0
- package/vendor/rocksdb/java/rocksjni/compaction_options_universal.cc +209 -0
- package/vendor/rocksdb/java/rocksjni/comparator.cc +60 -0
- package/vendor/rocksdb/java/rocksjni/comparatorjnicallback.cc +647 -0
- package/vendor/rocksdb/java/rocksjni/comparatorjnicallback.h +137 -0
- package/vendor/rocksdb/java/rocksjni/compression_options.cc +214 -0
- package/vendor/rocksdb/java/rocksjni/concurrent_task_limiter.cc +97 -0
- package/vendor/rocksdb/java/rocksjni/config_options.cc +103 -0
- package/vendor/rocksdb/java/rocksjni/cplusplus_to_java_convert.h +37 -0
- package/vendor/rocksdb/java/rocksjni/env.cc +205 -0
- package/vendor/rocksdb/java/rocksjni/env_options.cc +305 -0
- package/vendor/rocksdb/java/rocksjni/event_listener.cc +44 -0
- package/vendor/rocksdb/java/rocksjni/event_listener_jnicallback.cc +502 -0
- package/vendor/rocksdb/java/rocksjni/event_listener_jnicallback.h +122 -0
- package/vendor/rocksdb/java/rocksjni/filter.cc +46 -0
- package/vendor/rocksdb/java/rocksjni/ingest_external_file_options.cc +199 -0
- package/vendor/rocksdb/java/rocksjni/iterator.cc +340 -0
- package/vendor/rocksdb/java/rocksjni/jnicallback.cc +54 -0
- package/vendor/rocksdb/java/rocksjni/jnicallback.h +32 -0
- package/vendor/rocksdb/java/rocksjni/loggerjnicallback.cc +299 -0
- package/vendor/rocksdb/java/rocksjni/loggerjnicallback.h +51 -0
- package/vendor/rocksdb/java/rocksjni/lru_cache.cc +49 -0
- package/vendor/rocksdb/java/rocksjni/memory_util.cc +100 -0
- package/vendor/rocksdb/java/rocksjni/memtablejni.cc +94 -0
- package/vendor/rocksdb/java/rocksjni/merge_operator.cc +98 -0
- package/vendor/rocksdb/java/rocksjni/native_comparator_wrapper_test.cc +45 -0
- package/vendor/rocksdb/java/rocksjni/optimistic_transaction_db.cc +270 -0
- package/vendor/rocksdb/java/rocksjni/optimistic_transaction_options.cc +78 -0
- package/vendor/rocksdb/java/rocksjni/options.cc +8695 -0
- package/vendor/rocksdb/java/rocksjni/options_util.cc +139 -0
- package/vendor/rocksdb/java/rocksjni/persistent_cache.cc +60 -0
- package/vendor/rocksdb/java/rocksjni/portal.h +8706 -0
- package/vendor/rocksdb/java/rocksjni/ratelimiterjni.cc +128 -0
- package/vendor/rocksdb/java/rocksjni/remove_emptyvalue_compactionfilterjni.cc +24 -0
- package/vendor/rocksdb/java/rocksjni/restorejni.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/rocks_callback_object.cc +30 -0
- package/vendor/rocksdb/java/rocksjni/rocksdb_exception_test.cc +81 -0
- package/vendor/rocksdb/java/rocksjni/rocksjni.cc +3957 -0
- package/vendor/rocksdb/java/rocksjni/slice.cc +374 -0
- package/vendor/rocksdb/java/rocksjni/snapshot.cc +27 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_manager.cc +250 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_reader_iterator.cc +373 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_readerjni.cc +118 -0
- package/vendor/rocksdb/java/rocksjni/sst_file_writerjni.cc +310 -0
- package/vendor/rocksdb/java/rocksjni/sst_partitioner.cc +43 -0
- package/vendor/rocksdb/java/rocksjni/statistics.cc +268 -0
- package/vendor/rocksdb/java/rocksjni/statisticsjni.cc +31 -0
- package/vendor/rocksdb/java/rocksjni/statisticsjni.h +34 -0
- package/vendor/rocksdb/java/rocksjni/table.cc +145 -0
- package/vendor/rocksdb/java/rocksjni/table_filter.cc +27 -0
- package/vendor/rocksdb/java/rocksjni/table_filter_jnicallback.cc +66 -0
- package/vendor/rocksdb/java/rocksjni/table_filter_jnicallback.h +36 -0
- package/vendor/rocksdb/java/rocksjni/testable_event_listener.cc +219 -0
- package/vendor/rocksdb/java/rocksjni/thread_status.cc +125 -0
- package/vendor/rocksdb/java/rocksjni/trace_writer.cc +24 -0
- package/vendor/rocksdb/java/rocksjni/trace_writer_jnicallback.cc +118 -0
- package/vendor/rocksdb/java/rocksjni/trace_writer_jnicallback.h +36 -0
- package/vendor/rocksdb/java/rocksjni/transaction.cc +1655 -0
- package/vendor/rocksdb/java/rocksjni/transaction_db.cc +451 -0
- package/vendor/rocksdb/java/rocksjni/transaction_db_options.cc +169 -0
- package/vendor/rocksdb/java/rocksjni/transaction_log.cc +80 -0
- package/vendor/rocksdb/java/rocksjni/transaction_notifier.cc +44 -0
- package/vendor/rocksdb/java/rocksjni/transaction_notifier_jnicallback.cc +42 -0
- package/vendor/rocksdb/java/rocksjni/transaction_notifier_jnicallback.h +42 -0
- package/vendor/rocksdb/java/rocksjni/transaction_options.cc +191 -0
- package/vendor/rocksdb/java/rocksjni/ttl.cc +212 -0
- package/vendor/rocksdb/java/rocksjni/wal_filter.cc +24 -0
- package/vendor/rocksdb/java/rocksjni/wal_filter_jnicallback.cc +139 -0
- package/vendor/rocksdb/java/rocksjni/wal_filter_jnicallback.h +42 -0
- package/vendor/rocksdb/java/rocksjni/write_batch.cc +676 -0
- package/vendor/rocksdb/java/rocksjni/write_batch_test.cc +199 -0
- package/vendor/rocksdb/java/rocksjni/write_batch_with_index.cc +953 -0
- package/vendor/rocksdb/java/rocksjni/write_buffer_manager.cc +47 -0
- package/vendor/rocksdb/java/rocksjni/writebatchhandlerjnicallback.cc +519 -0
- package/vendor/rocksdb/java/rocksjni/writebatchhandlerjnicallback.h +92 -0
- package/vendor/rocksdb/java/samples/src/main/java/OptimisticTransactionSample.java +184 -0
- package/vendor/rocksdb/java/samples/src/main/java/RocksDBColumnFamilySample.java +78 -0
- package/vendor/rocksdb/java/samples/src/main/java/RocksDBSample.java +295 -0
- package/vendor/rocksdb/java/samples/src/main/java/TransactionSample.java +183 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractCompactionFilterFactory.java +77 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractComparator.java +124 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractComparatorJniBridge.java +119 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractEventListener.java +334 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractImmutableNativeReference.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractMutableOptions.java +368 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractNativeReference.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractRocksIterator.java +146 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractSlice.java +191 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTableFilter.java +20 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTraceWriter.java +70 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTransactionNotifier.java +54 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractWalFilter.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractWriteBatch.java +203 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AccessHint.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AdvancedColumnFamilyOptionsInterface.java +463 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/AdvancedMutableColumnFamilyOptionsInterface.java +830 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackgroundErrorReason.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupEngine.java +259 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupEngineOptions.java +458 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupInfo.java +76 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BlockBasedTableConfig.java +951 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BloomFilter.java +73 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/BuiltinComparator.java +20 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ByteBufferGetStatus.java +50 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Cache.java +40 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CassandraCompactionFilter.java +20 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CassandraValueMergeOperator.java +25 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Checkpoint.java +62 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ChecksumType.java +45 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ClockCache.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java +84 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyHandle.java +151 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyMetaData.java +70 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyOptions.java +1543 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java +536 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactRangeOptions.java +245 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionJobInfo.java +161 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionJobStats.java +295 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptions.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsFIFO.java +87 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsUniversal.java +273 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionPriority.java +81 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionReason.java +141 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionStopStyle.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionStyle.java +81 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ComparatorOptions.java +133 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ComparatorType.java +48 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompressionOptions.java +150 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompressionType.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiter.java +44 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiterImpl.java +48 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConfigOptions.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DBOptions.java +1496 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DBOptionsInterface.java +1756 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DataBlockIndexType.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DbPath.java +47 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/DirectSlice.java +136 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/EncodingType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Env.java +167 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/EnvOptions.java +366 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/EventListener.java +335 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Experimental.java +23 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ExternalFileIngestionInfo.java +103 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FileOperationInfo.java +112 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Filter.java +36 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushJobInfo.java +186 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushOptions.java +90 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushReason.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HashLinkedListMemTableConfig.java +174 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HashSkipListMemTableConfig.java +106 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HistogramData.java +75 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/HistogramType.java +214 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Holder.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/IndexShorteningMode.java +60 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/IndexType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/InfoLogLevel.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/IngestExternalFileOptions.java +227 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/KeyMayExist.java +35 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LRUCache.java +106 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LevelMetaData.java +56 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LiveFileMetaData.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/LogFile.java +75 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Logger.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemTableConfig.java +29 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemTableInfo.java +103 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemoryUsageType.java +72 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemoryUtil.java +60 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MergeOperator.java +18 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptions.java +621 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptionsInterface.java +156 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableDBOptions.java +292 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java +440 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableOptionKey.java +16 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableOptionValue.java +368 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/NativeComparatorWrapper.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/NativeLibraryLoader.java +172 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OperationStage.java +59 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OperationType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptimisticTransactionDB.java +224 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptimisticTransactionOptions.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptionString.java +261 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Options.java +2574 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptionsUtil.java +101 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/PersistentCache.java +26 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/PlainTableConfig.java +251 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/PrepopulateBlobCache.java +117 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Priority.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Range.java +19 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RateLimiter.java +227 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RateLimiterMode.java +52 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReadOptions.java +822 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReadTier.java +49 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RemoveEmptyValueCompactionFilter.java +18 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RestoreOptions.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReusedSynchronisationType.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksCallbackObject.java +73 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksDB.java +4688 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksDBException.java +44 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksEnv.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksIterator.java +140 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksIteratorInterface.java +127 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksMemEnv.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksMutableObject.java +87 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksObject.java +45 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SanityLevel.java +47 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SizeApproximationFlag.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SkipListMemTableConfig.java +51 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Slice.java +135 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Snapshot.java +41 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileManager.java +249 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileMetaData.java +162 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileReader.java +82 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileReaderIterator.java +140 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileWriter.java +237 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstPartitionerFactory.java +15 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstPartitionerFixedPrefixFactory.java +19 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StateType.java +53 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Statistics.java +153 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatisticsCollector.java +102 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatisticsCollectorCallback.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatsCollectorInput.java +35 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatsLevel.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Status.java +155 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/StringAppendOperator.java +29 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationBriefInfo.java +107 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationInfo.java +86 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationReason.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileDeletionInfo.java +86 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFilter.java +21 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFormatConfig.java +22 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableProperties.java +426 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ThreadStatus.java +224 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/ThreadType.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TickerType.java +802 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TimedEnv.java +30 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TraceOptions.java +32 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TraceWriter.java +36 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/Transaction.java +2162 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionDB.java +401 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionDBOptions.java +216 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionLogIterator.java +112 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionOptions.java +189 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionalDB.java +65 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionalOptions.java +31 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TtlDB.java +242 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/TxnDBWritePolicy.java +62 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/UInt64AddOperator.java +19 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/VectorMemTableConfig.java +46 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WALRecoveryMode.java +82 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WBWIRocksIterator.java +203 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalFileType.java +55 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalFilter.java +86 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalProcessingOption.java +54 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatch.java +394 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatchInterface.java +283 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatchWithIndex.java +358 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBufferManager.java +50 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteOptions.java +255 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteStallCondition.java +44 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteStallInfo.java +75 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/ByteUtil.java +52 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/BytewiseComparator.java +121 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/Environment.java +245 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/IntComparator.java +67 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/ReverseBytewiseComparator.java +88 -0
- package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/SizeUnit.java +16 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/AbstractTransactionTest.java +979 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BackupEngineOptionsTest.java +297 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BackupEngineTest.java +261 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BlobOptionsTest.java +353 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BlockBasedTableConfigTest.java +415 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BuiltinComparatorTest.java +145 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ByteBufferUnsupportedOperationTest.java +132 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/BytewiseComparatorRegressionTest.java +132 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java +82 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java +25 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java +712 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyTest.java +562 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactRangeOptionsTest.java +102 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionFilterFactoryTest.java +61 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionJobInfoTest.java +114 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionJobStatsTest.java +196 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsFIFOTest.java +35 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsTest.java +52 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsUniversalTest.java +80 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionPriorityTest.java +31 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionStopStyleTest.java +31 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ComparatorOptionsTest.java +58 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompressionOptionsTest.java +71 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompressionTypesTest.java +25 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ConcurrentTaskLimiterTest.java +56 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java +902 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/DefaultEnvTest.java +113 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/DirectSliceTest.java +93 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/EnvOptionsTest.java +145 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/EventListenerTest.java +725 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/FilterTest.java +39 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/FlushOptionsTest.java +31 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/FlushTest.java +49 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/InfoLogLevelTest.java +109 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/IngestExternalFileOptionsTest.java +107 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/KeyMayExistTest.java +528 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/LRUCacheTest.java +32 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/LoggerTest.java +235 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MemTableTest.java +108 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MemoryUtilTest.java +136 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MergeTest.java +465 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MixedOptionsTest.java +85 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiColumnRegressionTest.java +145 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiGetManyKeysTest.java +241 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiGetTest.java +530 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableColumnFamilyOptionsTest.java +167 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableDBOptionsTest.java +85 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableOptionsGetSetTest.java +429 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/NativeComparatorWrapperTest.java +90 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/NativeLibraryLoaderTest.java +41 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionDBTest.java +131 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionOptionsTest.java +38 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionTest.java +446 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java +1488 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptionsUtilTest.java +129 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/PlainTableConfigTest.java +89 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/PlatformRandomHelper.java +58 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/PutMultiplePartsTest.java +164 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RateLimiterTest.java +65 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ReadOnlyTest.java +222 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/ReadOptionsTest.java +374 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksDBExceptionTest.java +115 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksDBTest.java +1692 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksIteratorTest.java +289 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksMemEnvTest.java +137 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksNativeLibraryResource.java +18 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SecondaryDBTest.java +135 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SliceTest.java +80 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SnapshotTest.java +169 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileManagerTest.java +66 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileReaderTest.java +222 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileWriterTest.java +239 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstPartitionerTest.java +72 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatisticsCollectorTest.java +55 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatisticsTest.java +168 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatsCallbackMock.java +19 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TableFilterTest.java +106 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TimedEnvTest.java +40 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionDBOptionsTest.java +64 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionDBTest.java +177 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionLogIteratorTest.java +139 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionOptionsTest.java +72 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionTest.java +488 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/TtlDBTest.java +112 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/Types.java +43 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/VerifyChecksumsTest.java +213 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WALRecoveryModeTest.java +22 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WalFilterTest.java +165 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchHandlerTest.java +76 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java +528 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchThreadedTest.java +101 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchWithIndexTest.java +1068 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteOptionsTest.java +75 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/RemoveEmptyValueCompactionFilterFactory.java +21 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/RocksJunitRunner.java +174 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/TestableEventListener.java +23 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/ByteBufferAllocator.java +16 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/BytewiseComparatorIntTest.java +267 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/BytewiseComparatorTest.java +531 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/CapturingWriteBatchHandler.java +190 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/DirectByteBufferAllocator.java +18 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/EnvironmentTest.java +304 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/HeapByteBufferAllocator.java +18 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/IntComparatorTest.java +266 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/JNIComparatorTest.java +180 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/ReverseBytewiseComparatorIntTest.java +270 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/SizeUnitTest.java +27 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/TestUtil.java +72 -0
- package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/WriteBatchGetter.java +139 -0
- package/vendor/rocksdb/java/understanding_options.md +79 -0
- package/vendor/rocksdb/logging/auto_roll_logger.cc +368 -0
- package/vendor/rocksdb/logging/auto_roll_logger.h +166 -0
- package/vendor/rocksdb/logging/auto_roll_logger_test.cc +731 -0
- package/vendor/rocksdb/logging/env_logger.h +195 -0
- package/vendor/rocksdb/logging/env_logger_test.cc +163 -0
- package/vendor/rocksdb/logging/event_logger.cc +68 -0
- package/vendor/rocksdb/logging/event_logger.h +202 -0
- package/vendor/rocksdb/logging/event_logger_test.cc +45 -0
- package/vendor/rocksdb/logging/log_buffer.cc +91 -0
- package/vendor/rocksdb/logging/log_buffer.h +57 -0
- package/vendor/rocksdb/logging/logging.h +62 -0
- package/vendor/rocksdb/memory/allocator.h +58 -0
- package/vendor/rocksdb/memory/arena.cc +170 -0
- package/vendor/rocksdb/memory/arena.h +135 -0
- package/vendor/rocksdb/memory/arena_test.cc +295 -0
- package/vendor/rocksdb/memory/concurrent_arena.cc +45 -0
- package/vendor/rocksdb/memory/concurrent_arena.h +215 -0
- package/vendor/rocksdb/memory/jemalloc_nodump_allocator.cc +303 -0
- package/vendor/rocksdb/memory/jemalloc_nodump_allocator.h +99 -0
- package/vendor/rocksdb/memory/memkind_kmem_allocator.cc +44 -0
- package/vendor/rocksdb/memory/memkind_kmem_allocator.h +43 -0
- package/vendor/rocksdb/memory/memory_allocator.cc +80 -0
- package/vendor/rocksdb/memory/memory_allocator_impl.h +47 -0
- package/vendor/rocksdb/memory/memory_allocator_test.cc +236 -0
- package/vendor/rocksdb/memory/memory_usage.h +38 -0
- package/vendor/rocksdb/memtable/alloc_tracker.cc +63 -0
- package/vendor/rocksdb/memtable/hash_linklist_rep.cc +924 -0
- package/vendor/rocksdb/memtable/hash_skiplist_rep.cc +391 -0
- package/vendor/rocksdb/memtable/inlineskiplist.h +1051 -0
- package/vendor/rocksdb/memtable/inlineskiplist_test.cc +665 -0
- package/vendor/rocksdb/memtable/memtablerep_bench.cc +687 -0
- package/vendor/rocksdb/memtable/skiplist.h +498 -0
- package/vendor/rocksdb/memtable/skiplist_test.cc +388 -0
- package/vendor/rocksdb/memtable/skiplistrep.cc +368 -0
- package/vendor/rocksdb/memtable/stl_wrappers.h +33 -0
- package/vendor/rocksdb/memtable/vectorrep.cc +307 -0
- package/vendor/rocksdb/memtable/write_buffer_manager.cc +185 -0
- package/vendor/rocksdb/memtable/write_buffer_manager_test.cc +304 -0
- package/vendor/rocksdb/microbench/CMakeLists.txt +17 -0
- package/vendor/rocksdb/microbench/README.md +60 -0
- package/vendor/rocksdb/microbench/db_basic_bench.cc +1583 -0
- package/vendor/rocksdb/microbench/ribbon_bench.cc +155 -0
- package/vendor/rocksdb/monitoring/file_read_sample.h +23 -0
- package/vendor/rocksdb/monitoring/histogram.cc +270 -0
- package/vendor/rocksdb/monitoring/histogram.h +143 -0
- package/vendor/rocksdb/monitoring/histogram_test.cc +254 -0
- package/vendor/rocksdb/monitoring/histogram_windowing.cc +194 -0
- package/vendor/rocksdb/monitoring/histogram_windowing.h +84 -0
- package/vendor/rocksdb/monitoring/in_memory_stats_history.cc +50 -0
- package/vendor/rocksdb/monitoring/in_memory_stats_history.h +74 -0
- package/vendor/rocksdb/monitoring/instrumented_mutex.cc +90 -0
- package/vendor/rocksdb/monitoring/instrumented_mutex.h +126 -0
- package/vendor/rocksdb/monitoring/iostats_context.cc +78 -0
- package/vendor/rocksdb/monitoring/iostats_context_imp.h +62 -0
- package/vendor/rocksdb/monitoring/iostats_context_test.cc +31 -0
- package/vendor/rocksdb/monitoring/perf_context.cc +313 -0
- package/vendor/rocksdb/monitoring/perf_context_imp.h +96 -0
- package/vendor/rocksdb/monitoring/perf_level.cc +23 -0
- package/vendor/rocksdb/monitoring/perf_level_imp.h +14 -0
- package/vendor/rocksdb/monitoring/perf_step_timer.h +77 -0
- package/vendor/rocksdb/monitoring/persistent_stats_history.cc +170 -0
- package/vendor/rocksdb/monitoring/persistent_stats_history.h +83 -0
- package/vendor/rocksdb/monitoring/statistics.cc +534 -0
- package/vendor/rocksdb/monitoring/statistics_impl.h +144 -0
- package/vendor/rocksdb/monitoring/statistics_test.cc +88 -0
- package/vendor/rocksdb/monitoring/stats_history_test.cc +662 -0
- package/vendor/rocksdb/monitoring/thread_status_impl.cc +163 -0
- package/vendor/rocksdb/monitoring/thread_status_updater.cc +328 -0
- package/vendor/rocksdb/monitoring/thread_status_updater.h +226 -0
- package/vendor/rocksdb/monitoring/thread_status_updater_debug.cc +43 -0
- package/vendor/rocksdb/monitoring/thread_status_util.cc +208 -0
- package/vendor/rocksdb/monitoring/thread_status_util.h +139 -0
- package/vendor/rocksdb/monitoring/thread_status_util_debug.cc +46 -0
- package/vendor/rocksdb/options/cf_options.cc +1196 -0
- package/vendor/rocksdb/options/cf_options.h +347 -0
- package/vendor/rocksdb/options/configurable.cc +712 -0
- package/vendor/rocksdb/options/configurable_helper.h +185 -0
- package/vendor/rocksdb/options/configurable_test.cc +861 -0
- package/vendor/rocksdb/options/configurable_test.h +116 -0
- package/vendor/rocksdb/options/customizable.cc +133 -0
- package/vendor/rocksdb/options/customizable_test.cc +2116 -0
- package/vendor/rocksdb/options/db_options.cc +1079 -0
- package/vendor/rocksdb/options/db_options.h +152 -0
- package/vendor/rocksdb/options/options.cc +692 -0
- package/vendor/rocksdb/options/options_helper.cc +1424 -0
- package/vendor/rocksdb/options/options_helper.h +116 -0
- package/vendor/rocksdb/options/options_parser.cc +736 -0
- package/vendor/rocksdb/options/options_parser.h +149 -0
- package/vendor/rocksdb/options/options_settable_test.cc +655 -0
- package/vendor/rocksdb/options/options_test.cc +5060 -0
- package/vendor/rocksdb/plugin/README.md +43 -0
- package/vendor/rocksdb/port/README +10 -0
- package/vendor/rocksdb/port/jemalloc_helper.h +107 -0
- package/vendor/rocksdb/port/lang.h +97 -0
- package/vendor/rocksdb/port/likely.h +18 -0
- package/vendor/rocksdb/port/malloc.h +17 -0
- package/vendor/rocksdb/port/mmap.cc +98 -0
- package/vendor/rocksdb/port/mmap.h +70 -0
- package/vendor/rocksdb/port/port.h +21 -0
- package/vendor/rocksdb/port/port_dirent.h +44 -0
- package/vendor/rocksdb/port/port_example.h +101 -0
- package/vendor/rocksdb/port/port_posix.cc +300 -0
- package/vendor/rocksdb/port/port_posix.h +243 -0
- package/vendor/rocksdb/port/stack_trace.cc +336 -0
- package/vendor/rocksdb/port/stack_trace.h +31 -0
- package/vendor/rocksdb/port/sys_time.h +63 -0
- package/vendor/rocksdb/port/util_logger.h +18 -0
- package/vendor/rocksdb/port/win/env_default.cc +45 -0
- package/vendor/rocksdb/port/win/env_win.cc +1437 -0
- package/vendor/rocksdb/port/win/env_win.h +305 -0
- package/vendor/rocksdb/port/win/io_win.cc +1101 -0
- package/vendor/rocksdb/port/win/io_win.h +508 -0
- package/vendor/rocksdb/port/win/port_win.cc +303 -0
- package/vendor/rocksdb/port/win/port_win.h +379 -0
- package/vendor/rocksdb/port/win/win_jemalloc.cc +80 -0
- package/vendor/rocksdb/port/win/win_logger.cc +192 -0
- package/vendor/rocksdb/port/win/win_logger.h +64 -0
- package/vendor/rocksdb/port/win/win_thread.cc +170 -0
- package/vendor/rocksdb/port/win/win_thread.h +117 -0
- package/vendor/rocksdb/port/win/xpress_win.cc +210 -0
- package/vendor/rocksdb/port/win/xpress_win.h +26 -0
- package/vendor/rocksdb/port/xpress.h +17 -0
- package/vendor/rocksdb/rocksdb.pc.in +10 -0
- package/vendor/rocksdb/src.mk +713 -0
- package/vendor/rocksdb/table/adaptive/adaptive_table_factory.cc +125 -0
- package/vendor/rocksdb/table/adaptive/adaptive_table_factory.h +56 -0
- package/vendor/rocksdb/table/block_based/binary_search_index_reader.cc +73 -0
- package/vendor/rocksdb/table/block_based/binary_search_index_reader.h +48 -0
- package/vendor/rocksdb/table/block_based/block.cc +1291 -0
- package/vendor/rocksdb/table/block_based/block.h +921 -0
- package/vendor/rocksdb/table/block_based/block_based_table_builder.cc +2027 -0
- package/vendor/rocksdb/table/block_based/block_based_table_builder.h +209 -0
- package/vendor/rocksdb/table/block_based/block_based_table_factory.cc +962 -0
- package/vendor/rocksdb/table/block_based/block_based_table_factory.h +102 -0
- package/vendor/rocksdb/table/block_based/block_based_table_iterator.cc +500 -0
- package/vendor/rocksdb/table/block_based/block_based_table_iterator.h +310 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader.cc +3043 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader.h +745 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader_impl.h +203 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +758 -0
- package/vendor/rocksdb/table/block_based/block_based_table_reader_test.cc +567 -0
- package/vendor/rocksdb/table/block_based/block_builder.cc +234 -0
- package/vendor/rocksdb/table/block_based/block_builder.h +104 -0
- package/vendor/rocksdb/table/block_based/block_cache.cc +106 -0
- package/vendor/rocksdb/table/block_based/block_cache.h +140 -0
- package/vendor/rocksdb/table/block_based/block_prefetcher.cc +120 -0
- package/vendor/rocksdb/table/block_based/block_prefetcher.h +72 -0
- package/vendor/rocksdb/table/block_based/block_prefix_index.cc +226 -0
- package/vendor/rocksdb/table/block_based/block_prefix_index.h +70 -0
- package/vendor/rocksdb/table/block_based/block_test.cc +1543 -0
- package/vendor/rocksdb/table/block_based/block_type.h +34 -0
- package/vendor/rocksdb/table/block_based/cachable_entry.h +244 -0
- package/vendor/rocksdb/table/block_based/data_block_footer.cc +59 -0
- package/vendor/rocksdb/table/block_based/data_block_footer.h +25 -0
- package/vendor/rocksdb/table/block_based/data_block_hash_index.cc +94 -0
- package/vendor/rocksdb/table/block_based/data_block_hash_index.h +137 -0
- package/vendor/rocksdb/table/block_based/data_block_hash_index_test.cc +718 -0
- package/vendor/rocksdb/table/block_based/filter_block.h +183 -0
- package/vendor/rocksdb/table/block_based/filter_block_reader_common.cc +163 -0
- package/vendor/rocksdb/table/block_based/filter_block_reader_common.h +76 -0
- package/vendor/rocksdb/table/block_based/filter_policy.cc +1966 -0
- package/vendor/rocksdb/table/block_based/filter_policy_internal.h +340 -0
- package/vendor/rocksdb/table/block_based/flush_block_policy.cc +132 -0
- package/vendor/rocksdb/table/block_based/flush_block_policy_impl.h +40 -0
- package/vendor/rocksdb/table/block_based/full_filter_block.cc +290 -0
- package/vendor/rocksdb/table/block_based/full_filter_block.h +147 -0
- package/vendor/rocksdb/table/block_based/full_filter_block_test.cc +323 -0
- package/vendor/rocksdb/table/block_based/hash_index_reader.cc +147 -0
- package/vendor/rocksdb/table/block_based/hash_index_reader.h +49 -0
- package/vendor/rocksdb/table/block_based/index_builder.cc +282 -0
- package/vendor/rocksdb/table/block_based/index_builder.h +455 -0
- package/vendor/rocksdb/table/block_based/index_reader_common.cc +57 -0
- package/vendor/rocksdb/table/block_based/index_reader_common.h +85 -0
- package/vendor/rocksdb/table/block_based/mock_block_based_table.h +62 -0
- package/vendor/rocksdb/table/block_based/parsed_full_filter_block.cc +23 -0
- package/vendor/rocksdb/table/block_based/parsed_full_filter_block.h +47 -0
- package/vendor/rocksdb/table/block_based/partitioned_filter_block.cc +554 -0
- package/vendor/rocksdb/table/block_based/partitioned_filter_block.h +182 -0
- package/vendor/rocksdb/table/block_based/partitioned_filter_block_test.cc +436 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_iterator.cc +163 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_iterator.h +160 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_reader.cc +224 -0
- package/vendor/rocksdb/table/block_based/partitioned_index_reader.h +56 -0
- package/vendor/rocksdb/table/block_based/reader_common.cc +52 -0
- package/vendor/rocksdb/table/block_based/reader_common.h +34 -0
- package/vendor/rocksdb/table/block_based/uncompression_dict_reader.cc +126 -0
- package/vendor/rocksdb/table/block_based/uncompression_dict_reader.h +61 -0
- package/vendor/rocksdb/table/block_fetcher.cc +405 -0
- package/vendor/rocksdb/table/block_fetcher.h +142 -0
- package/vendor/rocksdb/table/block_fetcher_test.cc +520 -0
- package/vendor/rocksdb/table/cleanable_test.cc +390 -0
- package/vendor/rocksdb/table/compaction_merging_iterator.cc +370 -0
- package/vendor/rocksdb/table/compaction_merging_iterator.h +44 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.cc +551 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.h +136 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder_test.cc +631 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.cc +100 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.h +80 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.cc +412 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.h +100 -0
- package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader_test.cc +574 -0
- package/vendor/rocksdb/table/format.cc +573 -0
- package/vendor/rocksdb/table/format.h +378 -0
- package/vendor/rocksdb/table/get_context.cc +616 -0
- package/vendor/rocksdb/table/get_context.h +245 -0
- package/vendor/rocksdb/table/internal_iterator.h +224 -0
- package/vendor/rocksdb/table/iter_heap.h +44 -0
- package/vendor/rocksdb/table/iterator.cc +130 -0
- package/vendor/rocksdb/table/iterator_wrapper.h +190 -0
- package/vendor/rocksdb/table/merger_test.cc +182 -0
- package/vendor/rocksdb/table/merging_iterator.cc +1725 -0
- package/vendor/rocksdb/table/merging_iterator.h +97 -0
- package/vendor/rocksdb/table/meta_blocks.cc +564 -0
- package/vendor/rocksdb/table/meta_blocks.h +172 -0
- package/vendor/rocksdb/table/mock_table.cc +346 -0
- package/vendor/rocksdb/table/mock_table.h +94 -0
- package/vendor/rocksdb/table/multiget_context.h +405 -0
- package/vendor/rocksdb/table/persistent_cache_helper.cc +111 -0
- package/vendor/rocksdb/table/persistent_cache_helper.h +46 -0
- package/vendor/rocksdb/table/persistent_cache_options.h +34 -0
- package/vendor/rocksdb/table/plain/plain_table_bloom.cc +78 -0
- package/vendor/rocksdb/table/plain/plain_table_bloom.h +132 -0
- package/vendor/rocksdb/table/plain/plain_table_builder.cc +335 -0
- package/vendor/rocksdb/table/plain/plain_table_builder.h +152 -0
- package/vendor/rocksdb/table/plain/plain_table_factory.cc +296 -0
- package/vendor/rocksdb/table/plain/plain_table_factory.h +180 -0
- package/vendor/rocksdb/table/plain/plain_table_index.cc +211 -0
- package/vendor/rocksdb/table/plain/plain_table_index.h +246 -0
- package/vendor/rocksdb/table/plain/plain_table_key_coding.cc +507 -0
- package/vendor/rocksdb/table/plain/plain_table_key_coding.h +199 -0
- package/vendor/rocksdb/table/plain/plain_table_reader.cc +771 -0
- package/vendor/rocksdb/table/plain/plain_table_reader.h +243 -0
- package/vendor/rocksdb/table/scoped_arena_iterator.h +57 -0
- package/vendor/rocksdb/table/sst_file_dumper.cc +520 -0
- package/vendor/rocksdb/table/sst_file_dumper.h +99 -0
- package/vendor/rocksdb/table/sst_file_reader.cc +101 -0
- package/vendor/rocksdb/table/sst_file_reader_test.cc +423 -0
- package/vendor/rocksdb/table/sst_file_writer.cc +436 -0
- package/vendor/rocksdb/table/sst_file_writer_collectors.h +95 -0
- package/vendor/rocksdb/table/table_builder.h +228 -0
- package/vendor/rocksdb/table/table_factory.cc +52 -0
- package/vendor/rocksdb/table/table_properties.cc +351 -0
- package/vendor/rocksdb/table/table_properties_internal.h +14 -0
- package/vendor/rocksdb/table/table_reader.h +187 -0
- package/vendor/rocksdb/table/table_reader_bench.cc +339 -0
- package/vendor/rocksdb/table/table_test.cc +5882 -0
- package/vendor/rocksdb/table/two_level_iterator.cc +220 -0
- package/vendor/rocksdb/table/two_level_iterator.h +43 -0
- package/vendor/rocksdb/table/unique_id.cc +223 -0
- package/vendor/rocksdb/table/unique_id_impl.h +93 -0
- package/vendor/rocksdb/test_util/mock_time_env.cc +38 -0
- package/vendor/rocksdb/test_util/mock_time_env.h +78 -0
- package/vendor/rocksdb/test_util/secondary_cache_test_util.cc +96 -0
- package/vendor/rocksdb/test_util/secondary_cache_test_util.h +119 -0
- package/vendor/rocksdb/test_util/sync_point.cc +82 -0
- package/vendor/rocksdb/test_util/sync_point.h +180 -0
- package/vendor/rocksdb/test_util/sync_point_impl.cc +152 -0
- package/vendor/rocksdb/test_util/sync_point_impl.h +96 -0
- package/vendor/rocksdb/test_util/testharness.cc +107 -0
- package/vendor/rocksdb/test_util/testharness.h +124 -0
- package/vendor/rocksdb/test_util/testutil.cc +722 -0
- package/vendor/rocksdb/test_util/testutil.h +860 -0
- package/vendor/rocksdb/test_util/testutil_test.cc +43 -0
- package/vendor/rocksdb/test_util/transaction_test_util.cc +400 -0
- package/vendor/rocksdb/test_util/transaction_test_util.h +147 -0
- package/vendor/rocksdb/third-party/gcc/ppc-asm.h +390 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt +4 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc +11394 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest.h +22115 -0
- package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest_main.cc +37 -0
- package/vendor/rocksdb/thirdparty.inc +268 -0
- package/vendor/rocksdb/tools/CMakeLists.txt +30 -0
- package/vendor/rocksdb/tools/Dockerfile +5 -0
- package/vendor/rocksdb/tools/advisor/README.md +96 -0
- package/vendor/rocksdb/tools/advisor/advisor/__init__.py +0 -0
- package/vendor/rocksdb/tools/advisor/advisor/bench_runner.py +39 -0
- package/vendor/rocksdb/tools/advisor/advisor/config_optimizer_example.py +140 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_bench_runner.py +237 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_config_optimizer.py +293 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_log_parser.py +134 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_options_parser.py +348 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_stats_fetcher.py +346 -0
- package/vendor/rocksdb/tools/advisor/advisor/db_timeseries_parser.py +203 -0
- package/vendor/rocksdb/tools/advisor/advisor/ini_parser.py +76 -0
- package/vendor/rocksdb/tools/advisor/advisor/rule_parser.py +510 -0
- package/vendor/rocksdb/tools/advisor/advisor/rule_parser_example.py +98 -0
- package/vendor/rocksdb/tools/advisor/advisor/rules.ini +214 -0
- package/vendor/rocksdb/tools/advisor/test/__init__.py +0 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/LOG-0 +30 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/LOG-1 +25 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/OPTIONS-000005 +49 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/log_stats_parser_keys_ts +3 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err1.ini +56 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err2.ini +15 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err3.ini +15 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/rules_err4.ini +15 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/test_rules.ini +47 -0
- package/vendor/rocksdb/tools/advisor/test/input_files/triggered_rules.ini +83 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_bench_runner.py +141 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_log_parser.py +96 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_options_parser.py +214 -0
- package/vendor/rocksdb/tools/advisor/test/test_db_stats_fetcher.py +121 -0
- package/vendor/rocksdb/tools/advisor/test/test_rule_parser.py +226 -0
- package/vendor/rocksdb/tools/analyze_txn_stress_test.sh +77 -0
- package/vendor/rocksdb/tools/auto_sanity_test.sh +93 -0
- package/vendor/rocksdb/tools/backup_db.sh +15 -0
- package/vendor/rocksdb/tools/benchmark.sh +1173 -0
- package/vendor/rocksdb/tools/benchmark_ci.py +182 -0
- package/vendor/rocksdb/tools/benchmark_compare.sh +342 -0
- package/vendor/rocksdb/tools/benchmark_leveldb.sh +187 -0
- package/vendor/rocksdb/tools/blob_dump.cc +103 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/__init__.py +2 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py +2000 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim.sh +156 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim_test.py +734 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +2314 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.h +397 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_plot.py +729 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +791 -0
- package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc +17 -0
- package/vendor/rocksdb/tools/check_all_python.py +22 -0
- package/vendor/rocksdb/tools/check_format_compatible.sh +379 -0
- package/vendor/rocksdb/tools/db_bench.cc +21 -0
- package/vendor/rocksdb/tools/db_bench_tool.cc +8604 -0
- package/vendor/rocksdb/tools/db_bench_tool_test.cc +342 -0
- package/vendor/rocksdb/tools/db_crashtest.py +1018 -0
- package/vendor/rocksdb/tools/db_repl_stress.cc +132 -0
- package/vendor/rocksdb/tools/db_sanity_test.cc +296 -0
- package/vendor/rocksdb/tools/dbench_monitor +102 -0
- package/vendor/rocksdb/tools/dump/db_dump_tool.cc +258 -0
- package/vendor/rocksdb/tools/dump/rocksdb_dump.cc +60 -0
- package/vendor/rocksdb/tools/dump/rocksdb_undump.cc +59 -0
- package/vendor/rocksdb/tools/generate_random_db.sh +31 -0
- package/vendor/rocksdb/tools/ingest_external_sst.sh +18 -0
- package/vendor/rocksdb/tools/io_tracer_parser.cc +17 -0
- package/vendor/rocksdb/tools/io_tracer_parser_test.cc +182 -0
- package/vendor/rocksdb/tools/io_tracer_parser_tool.cc +142 -0
- package/vendor/rocksdb/tools/io_tracer_parser_tool.h +38 -0
- package/vendor/rocksdb/tools/ldb.cc +13 -0
- package/vendor/rocksdb/tools/ldb_cmd.cc +4263 -0
- package/vendor/rocksdb/tools/ldb_cmd_impl.h +744 -0
- package/vendor/rocksdb/tools/ldb_cmd_test.cc +1216 -0
- package/vendor/rocksdb/tools/ldb_test.py +955 -0
- package/vendor/rocksdb/tools/ldb_tool.cc +182 -0
- package/vendor/rocksdb/tools/pflag +217 -0
- package/vendor/rocksdb/tools/reduce_levels_test.cc +212 -0
- package/vendor/rocksdb/tools/regression_test.sh +525 -0
- package/vendor/rocksdb/tools/restore_db.sh +15 -0
- package/vendor/rocksdb/tools/rocksdb_dump_test.sh +9 -0
- package/vendor/rocksdb/tools/run_blob_bench.sh +223 -0
- package/vendor/rocksdb/tools/run_flash_bench.sh +359 -0
- package/vendor/rocksdb/tools/run_leveldb.sh +175 -0
- package/vendor/rocksdb/tools/sample-dump.dmp +0 -0
- package/vendor/rocksdb/tools/simulated_hybrid_file_system.cc +243 -0
- package/vendor/rocksdb/tools/simulated_hybrid_file_system.h +124 -0
- package/vendor/rocksdb/tools/sst_dump.cc +12 -0
- package/vendor/rocksdb/tools/sst_dump_test.cc +471 -0
- package/vendor/rocksdb/tools/sst_dump_tool.cc +582 -0
- package/vendor/rocksdb/tools/trace_analyzer.cc +17 -0
- package/vendor/rocksdb/tools/trace_analyzer_test.cc +880 -0
- package/vendor/rocksdb/tools/trace_analyzer_tool.cc +1929 -0
- package/vendor/rocksdb/tools/trace_analyzer_tool.h +329 -0
- package/vendor/rocksdb/tools/verify_random_db.sh +41 -0
- package/vendor/rocksdb/tools/write_external_sst.sh +26 -0
- package/vendor/rocksdb/tools/write_stress.cc +305 -0
- package/vendor/rocksdb/tools/write_stress_runner.py +83 -0
- package/vendor/rocksdb/trace_replay/block_cache_tracer.cc +509 -0
- package/vendor/rocksdb/trace_replay/block_cache_tracer.h +239 -0
- package/vendor/rocksdb/trace_replay/block_cache_tracer_test.cc +421 -0
- package/vendor/rocksdb/trace_replay/io_tracer.cc +303 -0
- package/vendor/rocksdb/trace_replay/io_tracer.h +185 -0
- package/vendor/rocksdb/trace_replay/io_tracer_test.cc +353 -0
- package/vendor/rocksdb/trace_replay/trace_record.cc +206 -0
- package/vendor/rocksdb/trace_replay/trace_record_handler.cc +190 -0
- package/vendor/rocksdb/trace_replay/trace_record_handler.h +46 -0
- package/vendor/rocksdb/trace_replay/trace_record_result.cc +146 -0
- package/vendor/rocksdb/trace_replay/trace_replay.cc +622 -0
- package/vendor/rocksdb/trace_replay/trace_replay.h +183 -0
- package/vendor/rocksdb/util/aligned_buffer.h +235 -0
- package/vendor/rocksdb/util/async_file_reader.cc +81 -0
- package/vendor/rocksdb/util/async_file_reader.h +144 -0
- package/vendor/rocksdb/util/autovector.h +393 -0
- package/vendor/rocksdb/util/autovector_test.cc +324 -0
- package/vendor/rocksdb/util/bloom_impl.h +489 -0
- package/vendor/rocksdb/util/bloom_test.cc +1175 -0
- package/vendor/rocksdb/util/build_version.cc.in +79 -0
- package/vendor/rocksdb/util/cast_util.h +42 -0
- package/vendor/rocksdb/util/channel.h +69 -0
- package/vendor/rocksdb/util/cleanable.cc +181 -0
- package/vendor/rocksdb/util/coding.cc +90 -0
- package/vendor/rocksdb/util/coding.h +389 -0
- package/vendor/rocksdb/util/coding_lean.h +101 -0
- package/vendor/rocksdb/util/coding_test.cc +217 -0
- package/vendor/rocksdb/util/compaction_job_stats_impl.cc +92 -0
- package/vendor/rocksdb/util/comparator.cc +383 -0
- package/vendor/rocksdb/util/compression.cc +122 -0
- package/vendor/rocksdb/util/compression.h +1795 -0
- package/vendor/rocksdb/util/compression_context_cache.cc +106 -0
- package/vendor/rocksdb/util/compression_context_cache.h +47 -0
- package/vendor/rocksdb/util/concurrent_task_limiter_impl.cc +64 -0
- package/vendor/rocksdb/util/concurrent_task_limiter_impl.h +67 -0
- package/vendor/rocksdb/util/core_local.h +84 -0
- package/vendor/rocksdb/util/coro_utils.h +112 -0
- package/vendor/rocksdb/util/crc32c.cc +1292 -0
- package/vendor/rocksdb/util/crc32c.h +56 -0
- package/vendor/rocksdb/util/crc32c_arm64.cc +213 -0
- package/vendor/rocksdb/util/crc32c_arm64.h +52 -0
- package/vendor/rocksdb/util/crc32c_ppc.c +94 -0
- package/vendor/rocksdb/util/crc32c_ppc.h +22 -0
- package/vendor/rocksdb/util/crc32c_ppc_asm.S +756 -0
- package/vendor/rocksdb/util/crc32c_ppc_constants.h +900 -0
- package/vendor/rocksdb/util/crc32c_test.cc +213 -0
- package/vendor/rocksdb/util/data_structure.cc +18 -0
- package/vendor/rocksdb/util/defer.h +82 -0
- package/vendor/rocksdb/util/defer_test.cc +51 -0
- package/vendor/rocksdb/util/distributed_mutex.h +50 -0
- package/vendor/rocksdb/util/duplicate_detector.h +69 -0
- package/vendor/rocksdb/util/dynamic_bloom.cc +70 -0
- package/vendor/rocksdb/util/dynamic_bloom.h +214 -0
- package/vendor/rocksdb/util/dynamic_bloom_test.cc +325 -0
- package/vendor/rocksdb/util/fastrange.h +114 -0
- package/vendor/rocksdb/util/file_checksum_helper.cc +170 -0
- package/vendor/rocksdb/util/file_checksum_helper.h +101 -0
- package/vendor/rocksdb/util/file_reader_writer_test.cc +1058 -0
- package/vendor/rocksdb/util/filelock_test.cc +148 -0
- package/vendor/rocksdb/util/filter_bench.cc +840 -0
- package/vendor/rocksdb/util/gflags_compat.h +29 -0
- package/vendor/rocksdb/util/hash.cc +201 -0
- package/vendor/rocksdb/util/hash.h +137 -0
- package/vendor/rocksdb/util/hash128.h +26 -0
- package/vendor/rocksdb/util/hash_containers.h +51 -0
- package/vendor/rocksdb/util/hash_map.h +67 -0
- package/vendor/rocksdb/util/hash_test.cc +853 -0
- package/vendor/rocksdb/util/heap.h +174 -0
- package/vendor/rocksdb/util/heap_test.cc +131 -0
- package/vendor/rocksdb/util/kv_map.h +33 -0
- package/vendor/rocksdb/util/log_write_bench.cc +88 -0
- package/vendor/rocksdb/util/math.h +299 -0
- package/vendor/rocksdb/util/math128.h +316 -0
- package/vendor/rocksdb/util/murmurhash.cc +196 -0
- package/vendor/rocksdb/util/murmurhash.h +43 -0
- package/vendor/rocksdb/util/mutexlock.h +181 -0
- package/vendor/rocksdb/util/ppc-opcode.h +27 -0
- package/vendor/rocksdb/util/random.cc +63 -0
- package/vendor/rocksdb/util/random.h +190 -0
- package/vendor/rocksdb/util/random_test.cc +107 -0
- package/vendor/rocksdb/util/rate_limiter.cc +376 -0
- package/vendor/rocksdb/util/rate_limiter_impl.h +146 -0
- package/vendor/rocksdb/util/rate_limiter_test.cc +520 -0
- package/vendor/rocksdb/util/repeatable_thread.h +149 -0
- package/vendor/rocksdb/util/repeatable_thread_test.cc +111 -0
- package/vendor/rocksdb/util/ribbon_alg.h +1225 -0
- package/vendor/rocksdb/util/ribbon_config.cc +506 -0
- package/vendor/rocksdb/util/ribbon_config.h +182 -0
- package/vendor/rocksdb/util/ribbon_impl.h +1137 -0
- package/vendor/rocksdb/util/ribbon_test.cc +1308 -0
- package/vendor/rocksdb/util/set_comparator.h +24 -0
- package/vendor/rocksdb/util/single_thread_executor.h +56 -0
- package/vendor/rocksdb/util/slice.cc +367 -0
- package/vendor/rocksdb/util/slice_test.cc +252 -0
- package/vendor/rocksdb/util/slice_transform_test.cc +159 -0
- package/vendor/rocksdb/util/status.cc +162 -0
- package/vendor/rocksdb/util/stderr_logger.cc +30 -0
- package/vendor/rocksdb/util/stderr_logger.h +31 -0
- package/vendor/rocksdb/util/stop_watch.h +136 -0
- package/vendor/rocksdb/util/string_util.cc +502 -0
- package/vendor/rocksdb/util/string_util.h +175 -0
- package/vendor/rocksdb/util/thread_guard.h +41 -0
- package/vendor/rocksdb/util/thread_list_test.cc +362 -0
- package/vendor/rocksdb/util/thread_local.cc +521 -0
- package/vendor/rocksdb/util/thread_local.h +100 -0
- package/vendor/rocksdb/util/thread_local_test.cc +578 -0
- package/vendor/rocksdb/util/thread_operation.h +113 -0
- package/vendor/rocksdb/util/threadpool_imp.cc +551 -0
- package/vendor/rocksdb/util/threadpool_imp.h +120 -0
- package/vendor/rocksdb/util/timer.h +340 -0
- package/vendor/rocksdb/util/timer_queue.h +231 -0
- package/vendor/rocksdb/util/timer_queue_test.cc +73 -0
- package/vendor/rocksdb/util/timer_test.cc +402 -0
- package/vendor/rocksdb/util/udt_util.h +77 -0
- package/vendor/rocksdb/util/user_comparator_wrapper.h +64 -0
- package/vendor/rocksdb/util/vector_iterator.h +118 -0
- package/vendor/rocksdb/util/work_queue.h +150 -0
- package/vendor/rocksdb/util/work_queue_test.cc +272 -0
- package/vendor/rocksdb/util/xxhash.cc +48 -0
- package/vendor/rocksdb/util/xxhash.h +6360 -0
- package/vendor/rocksdb/util/xxph3.h +1764 -0
- package/vendor/rocksdb/utilities/agg_merge/agg_merge.cc +238 -0
- package/vendor/rocksdb/utilities/agg_merge/agg_merge_impl.h +49 -0
- package/vendor/rocksdb/utilities/agg_merge/agg_merge_test.cc +135 -0
- package/vendor/rocksdb/utilities/agg_merge/test_agg_merge.cc +104 -0
- package/vendor/rocksdb/utilities/agg_merge/test_agg_merge.h +47 -0
- package/vendor/rocksdb/utilities/backup/backup_engine.cc +3355 -0
- package/vendor/rocksdb/utilities/backup/backup_engine_impl.h +34 -0
- package/vendor/rocksdb/utilities/backup/backup_engine_test.cc +4414 -0
- package/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.cc +488 -0
- package/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.h +202 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db.cc +112 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db.h +264 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_gc_stats.h +54 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_impl.cc +2185 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_impl.h +501 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +111 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_iterator.h +148 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_listener.h +69 -0
- package/vendor/rocksdb/utilities/blob_db/blob_db_test.cc +2430 -0
- package/vendor/rocksdb/utilities/blob_db/blob_dump_tool.cc +280 -0
- package/vendor/rocksdb/utilities/blob_db/blob_dump_tool.h +56 -0
- package/vendor/rocksdb/utilities/blob_db/blob_file.cc +316 -0
- package/vendor/rocksdb/utilities/blob_db/blob_file.h +244 -0
- package/vendor/rocksdb/utilities/cache_dump_load.cc +67 -0
- package/vendor/rocksdb/utilities/cache_dump_load_impl.cc +369 -0
- package/vendor/rocksdb/utilities/cache_dump_load_impl.h +356 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.cc +106 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.h +57 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_format_test.cc +377 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_functional_test.cc +444 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_options.h +41 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_row_merge_test.cc +98 -0
- package/vendor/rocksdb/utilities/cassandra/cassandra_serialize_test.cc +164 -0
- package/vendor/rocksdb/utilities/cassandra/format.cc +367 -0
- package/vendor/rocksdb/utilities/cassandra/format.h +183 -0
- package/vendor/rocksdb/utilities/cassandra/merge_operator.cc +80 -0
- package/vendor/rocksdb/utilities/cassandra/merge_operator.h +44 -0
- package/vendor/rocksdb/utilities/cassandra/serialize.h +81 -0
- package/vendor/rocksdb/utilities/cassandra/test_utils.cc +69 -0
- package/vendor/rocksdb/utilities/cassandra/test_utils.h +42 -0
- package/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.cc +470 -0
- package/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.h +64 -0
- package/vendor/rocksdb/utilities/checkpoint/checkpoint_test.cc +988 -0
- package/vendor/rocksdb/utilities/compaction_filters/layered_compaction_filter_base.h +41 -0
- package/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc +24 -0
- package/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h +26 -0
- package/vendor/rocksdb/utilities/compaction_filters.cc +52 -0
- package/vendor/rocksdb/utilities/convenience/info_log_finder.cc +26 -0
- package/vendor/rocksdb/utilities/counted_fs.cc +379 -0
- package/vendor/rocksdb/utilities/counted_fs.h +158 -0
- package/vendor/rocksdb/utilities/debug.cc +118 -0
- package/vendor/rocksdb/utilities/env_mirror.cc +273 -0
- package/vendor/rocksdb/utilities/env_mirror_test.cc +216 -0
- package/vendor/rocksdb/utilities/env_timed.cc +181 -0
- package/vendor/rocksdb/utilities/env_timed.h +95 -0
- package/vendor/rocksdb/utilities/env_timed_test.cc +34 -0
- package/vendor/rocksdb/utilities/fault_injection_env.cc +555 -0
- package/vendor/rocksdb/utilities/fault_injection_env.h +258 -0
- package/vendor/rocksdb/utilities/fault_injection_fs.cc +1071 -0
- package/vendor/rocksdb/utilities/fault_injection_fs.h +593 -0
- package/vendor/rocksdb/utilities/fault_injection_secondary_cache.cc +136 -0
- package/vendor/rocksdb/utilities/fault_injection_secondary_cache.h +109 -0
- package/vendor/rocksdb/utilities/leveldb_options/leveldb_options.cc +57 -0
- package/vendor/rocksdb/utilities/memory/memory_test.cc +269 -0
- package/vendor/rocksdb/utilities/memory/memory_util.cc +50 -0
- package/vendor/rocksdb/utilities/memory_allocators.h +103 -0
- package/vendor/rocksdb/utilities/merge_operators/bytesxor.cc +57 -0
- package/vendor/rocksdb/utilities/merge_operators/bytesxor.h +40 -0
- package/vendor/rocksdb/utilities/merge_operators/max.cc +64 -0
- package/vendor/rocksdb/utilities/merge_operators/max_operator.h +35 -0
- package/vendor/rocksdb/utilities/merge_operators/put.cc +74 -0
- package/vendor/rocksdb/utilities/merge_operators/put_operator.h +56 -0
- package/vendor/rocksdb/utilities/merge_operators/sortlist.cc +95 -0
- package/vendor/rocksdb/utilities/merge_operators/sortlist.h +42 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.cc +76 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.h +32 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.cc +130 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.h +52 -0
- package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend_test.cc +636 -0
- package/vendor/rocksdb/utilities/merge_operators/uint64add.cc +56 -0
- package/vendor/rocksdb/utilities/merge_operators/uint64add.h +35 -0
- package/vendor/rocksdb/utilities/merge_operators.cc +115 -0
- package/vendor/rocksdb/utilities/merge_operators.h +36 -0
- package/vendor/rocksdb/utilities/object_registry.cc +381 -0
- package/vendor/rocksdb/utilities/object_registry_test.cc +862 -0
- package/vendor/rocksdb/utilities/option_change_migration/option_change_migration.cc +176 -0
- package/vendor/rocksdb/utilities/option_change_migration/option_change_migration_test.cc +548 -0
- package/vendor/rocksdb/utilities/options/options_util.cc +117 -0
- package/vendor/rocksdb/utilities/options/options_util_test.cc +782 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.cc +420 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.h +154 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc +608 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.h +291 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file_buffer.h +127 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc +84 -0
- package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.h +122 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table.h +237 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table_bench.cc +310 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table_evictable.h +166 -0
- package/vendor/rocksdb/utilities/persistent_cache/hash_table_test.cc +161 -0
- package/vendor/rocksdb/utilities/persistent_cache/lrulist.h +172 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_bench.cc +355 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.cc +413 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.h +284 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.cc +165 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.h +340 -0
- package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_util.h +67 -0
- package/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc +138 -0
- package/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.h +139 -0
- package/vendor/rocksdb/utilities/simulator_cache/cache_simulator.cc +287 -0
- package/vendor/rocksdb/utilities/simulator_cache/cache_simulator.h +231 -0
- package/vendor/rocksdb/utilities/simulator_cache/cache_simulator_test.cc +497 -0
- package/vendor/rocksdb/utilities/simulator_cache/sim_cache.cc +372 -0
- package/vendor/rocksdb/utilities/simulator_cache/sim_cache_test.cc +226 -0
- package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +221 -0
- package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.h +68 -0
- package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc +238 -0
- package/vendor/rocksdb/utilities/trace/file_trace_reader_writer.cc +133 -0
- package/vendor/rocksdb/utilities/trace/file_trace_reader_writer.h +48 -0
- package/vendor/rocksdb/utilities/trace/replayer_impl.cc +314 -0
- package/vendor/rocksdb/utilities/trace/replayer_impl.h +84 -0
- package/vendor/rocksdb/utilities/transactions/lock/lock_manager.cc +27 -0
- package/vendor/rocksdb/utilities/transactions/lock/lock_manager.h +80 -0
- package/vendor/rocksdb/utilities/transactions/lock/lock_tracker.h +207 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.cc +719 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.h +222 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.cc +170 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.h +324 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.cc +255 -0
- package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.h +97 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_lock_manager.h +34 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_locking_test.cc +448 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.AGPLv3 +661 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.APACHEv2 +174 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.GPLv2 +339 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +13 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/db.h +76 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/comparator.h +138 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/ft-status.h +102 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc +137 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.h +174 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc +220 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.h +141 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +525 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h +255 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc +1021 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h +580 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc +525 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc +263 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.h +178 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc +518 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.h +302 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc +118 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.h +92 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc +211 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.h +124 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/memory.h +215 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_assert_subst.h +39 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h +130 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_external_pthread.h +83 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_instrumentation.h +286 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_portability.h +87 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h +520 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_race_tools.h +179 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +197 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/txn_subst.h +27 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc +130 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc +151 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.h +98 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +144 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc +199 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.h +141 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt.h +794 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt_impl.h +1295 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/partitioned_counter.h +165 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/status.h +76 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +501 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h +135 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc +154 -0
- package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.h +146 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction.cc +194 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction.h +99 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.cc +109 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.h +86 -0
- package/vendor/rocksdb/utilities/transactions/optimistic_transaction_test.cc +1479 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction.cc +1177 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction.h +311 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +780 -0
- package/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.h +316 -0
- package/vendor/rocksdb/utilities/transactions/snapshot_checker.cc +37 -0
- package/vendor/rocksdb/utilities/transactions/timestamped_snapshot_test.cc +457 -0
- package/vendor/rocksdb/utilities/transactions/transaction_base.cc +757 -0
- package/vendor/rocksdb/utilities/transactions/transaction_base.h +382 -0
- package/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.cc +133 -0
- package/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.h +24 -0
- package/vendor/rocksdb/utilities/transactions/transaction_test.cc +6751 -0
- package/vendor/rocksdb/utilities/transactions/transaction_test.h +578 -0
- package/vendor/rocksdb/utilities/transactions/transaction_util.cc +204 -0
- package/vendor/rocksdb/utilities/transactions/transaction_util.h +83 -0
- package/vendor/rocksdb/utilities/transactions/write_committed_transaction_ts_test.cc +578 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_transaction_test.cc +4066 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn.cc +515 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn.h +117 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.cc +1038 -0
- package/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.h +1123 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_transaction_test.cc +779 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn.cc +1056 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn.h +339 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +476 -0
- package/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.h +106 -0
- package/vendor/rocksdb/utilities/ttl/db_ttl_impl.cc +617 -0
- package/vendor/rocksdb/utilities/ttl/db_ttl_impl.h +243 -0
- package/vendor/rocksdb/utilities/ttl/ttl_test.cc +913 -0
- package/vendor/rocksdb/utilities/util_merge_operators_test.cc +100 -0
- package/vendor/rocksdb/utilities/wal_filter.cc +22 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +694 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +742 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +342 -0
- package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_test.cc +2409 -0
|
@@ -0,0 +1,4688 @@
|
|
|
1
|
+
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
|
2
|
+
// This source code is licensed under both the GPLv2 (found in the
|
|
3
|
+
// COPYING file in the root directory) and Apache 2.0 License
|
|
4
|
+
// (found in the LICENSE.Apache file in the root directory).
|
|
5
|
+
|
|
6
|
+
package org.rocksdb;
|
|
7
|
+
|
|
8
|
+
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
9
|
+
|
|
10
|
+
import java.io.IOException;
|
|
11
|
+
import java.nio.ByteBuffer;
|
|
12
|
+
import java.util.*;
|
|
13
|
+
import java.util.concurrent.atomic.AtomicReference;
|
|
14
|
+
import org.rocksdb.util.Environment;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A RocksDB is a persistent ordered map from keys to values. It is safe for
|
|
18
|
+
* concurrent access from multiple threads without any external synchronization.
|
|
19
|
+
* All methods of this class could potentially throw RocksDBException, which
|
|
20
|
+
* indicates sth wrong at the RocksDB library side and the call failed.
|
|
21
|
+
*/
|
|
22
|
+
public class RocksDB extends RocksObject {
|
|
23
|
+
public static final byte[] DEFAULT_COLUMN_FAMILY = "default".getBytes(UTF_8);
|
|
24
|
+
public static final int NOT_FOUND = -1;
|
|
25
|
+
|
|
26
|
+
private enum LibraryState {
|
|
27
|
+
NOT_LOADED,
|
|
28
|
+
LOADING,
|
|
29
|
+
LOADED
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private static final AtomicReference<LibraryState> libraryLoaded =
|
|
33
|
+
new AtomicReference<>(LibraryState.NOT_LOADED);
|
|
34
|
+
|
|
35
|
+
static {
|
|
36
|
+
RocksDB.loadLibrary();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
private final List<ColumnFamilyHandle> ownedColumnFamilyHandles = new ArrayList<>();
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Loads the necessary library files.
|
|
43
|
+
* Calling this method twice will have no effect.
|
|
44
|
+
* By default the method extracts the shared library for loading at
|
|
45
|
+
* java.io.tmpdir, however, you can override this temporary location by
|
|
46
|
+
* setting the environment variable ROCKSDB_SHAREDLIB_DIR.
|
|
47
|
+
*/
|
|
48
|
+
public static void loadLibrary() {
|
|
49
|
+
if (libraryLoaded.get() == LibraryState.LOADED) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (libraryLoaded.compareAndSet(LibraryState.NOT_LOADED,
|
|
54
|
+
LibraryState.LOADING)) {
|
|
55
|
+
final String tmpDir = System.getenv("ROCKSDB_SHAREDLIB_DIR");
|
|
56
|
+
// loading possibly necessary libraries.
|
|
57
|
+
for (final CompressionType compressionType : CompressionType.values()) {
|
|
58
|
+
try {
|
|
59
|
+
if (compressionType.getLibraryName() != null) {
|
|
60
|
+
System.loadLibrary(compressionType.getLibraryName());
|
|
61
|
+
}
|
|
62
|
+
} catch (final UnsatisfiedLinkError e) {
|
|
63
|
+
// since it may be optional, we ignore its loading failure here.
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
NativeLibraryLoader.getInstance().loadLibrary(tmpDir);
|
|
68
|
+
} catch (final IOException e) {
|
|
69
|
+
libraryLoaded.set(LibraryState.NOT_LOADED);
|
|
70
|
+
throw new RuntimeException("Unable to load the RocksDB shared library",
|
|
71
|
+
e);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
final int encodedVersion = version();
|
|
75
|
+
version = Version.fromEncodedVersion(encodedVersion);
|
|
76
|
+
|
|
77
|
+
libraryLoaded.set(LibraryState.LOADED);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
while (libraryLoaded.get() == LibraryState.LOADING) {
|
|
82
|
+
try {
|
|
83
|
+
Thread.sleep(10);
|
|
84
|
+
} catch(final InterruptedException e) {
|
|
85
|
+
//ignore
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Tries to load the necessary library files from the given list of
|
|
92
|
+
* directories.
|
|
93
|
+
*
|
|
94
|
+
* @param paths a list of strings where each describes a directory
|
|
95
|
+
* of a library.
|
|
96
|
+
*/
|
|
97
|
+
public static void loadLibrary(final List<String> paths) {
|
|
98
|
+
if (libraryLoaded.get() == LibraryState.LOADED) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (libraryLoaded.compareAndSet(LibraryState.NOT_LOADED,
|
|
103
|
+
LibraryState.LOADING)) {
|
|
104
|
+
for (final CompressionType compressionType : CompressionType.values()) {
|
|
105
|
+
if (compressionType.equals(CompressionType.NO_COMPRESSION)) {
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
for (final String path : paths) {
|
|
109
|
+
try {
|
|
110
|
+
System.load(path + "/" + Environment.getSharedLibraryFileName(
|
|
111
|
+
compressionType.getLibraryName()));
|
|
112
|
+
break;
|
|
113
|
+
} catch (final UnsatisfiedLinkError e) {
|
|
114
|
+
// since they are optional, we ignore loading fails.
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
boolean success = false;
|
|
119
|
+
UnsatisfiedLinkError err = null;
|
|
120
|
+
for (final String path : paths) {
|
|
121
|
+
try {
|
|
122
|
+
System.load(path + "/" +
|
|
123
|
+
Environment.getJniLibraryFileName("rocksdbjni"));
|
|
124
|
+
success = true;
|
|
125
|
+
break;
|
|
126
|
+
} catch (final UnsatisfiedLinkError e) {
|
|
127
|
+
err = e;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (!success) {
|
|
131
|
+
libraryLoaded.set(LibraryState.NOT_LOADED);
|
|
132
|
+
throw err;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
final int encodedVersion = version();
|
|
136
|
+
version = Version.fromEncodedVersion(encodedVersion);
|
|
137
|
+
|
|
138
|
+
libraryLoaded.set(LibraryState.LOADED);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
while (libraryLoaded.get() == LibraryState.LOADING) {
|
|
143
|
+
try {
|
|
144
|
+
Thread.sleep(10);
|
|
145
|
+
} catch(final InterruptedException e) {
|
|
146
|
+
//ignore
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
public static Version rocksdbVersion() {
|
|
152
|
+
return version;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Private constructor.
|
|
157
|
+
*
|
|
158
|
+
* @param nativeHandle The native handle of the C++ RocksDB object
|
|
159
|
+
*/
|
|
160
|
+
protected RocksDB(final long nativeHandle) {
|
|
161
|
+
super(nativeHandle);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* The factory constructor of RocksDB that opens a RocksDB instance given
|
|
166
|
+
* the path to the database using the default options w/ createIfMissing
|
|
167
|
+
* set to true.
|
|
168
|
+
*
|
|
169
|
+
* @param path the path to the rocksdb.
|
|
170
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
171
|
+
* {@link RocksDB} can not be opened.
|
|
172
|
+
*
|
|
173
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
174
|
+
* native library.
|
|
175
|
+
* @see Options#setCreateIfMissing(boolean)
|
|
176
|
+
*/
|
|
177
|
+
public static RocksDB open(final String path) throws RocksDBException {
|
|
178
|
+
final Options options = new Options();
|
|
179
|
+
options.setCreateIfMissing(true);
|
|
180
|
+
return open(options, path);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The factory constructor of RocksDB that opens a RocksDB instance given
|
|
185
|
+
* the path to the database using the specified options and db path and a list
|
|
186
|
+
* of column family names.
|
|
187
|
+
* <p>
|
|
188
|
+
* If opened in read write mode every existing column family name must be
|
|
189
|
+
* passed within the list to this method.</p>
|
|
190
|
+
* <p>
|
|
191
|
+
* If opened in read-only mode only a subset of existing column families must
|
|
192
|
+
* be passed to this method.</p>
|
|
193
|
+
* <p>
|
|
194
|
+
* Options instance *should* not be disposed before all DBs using this options
|
|
195
|
+
* instance have been closed. If user doesn't call options dispose explicitly,
|
|
196
|
+
* then this options instance will be GC'd automatically</p>
|
|
197
|
+
* <p>
|
|
198
|
+
* ColumnFamily handles are disposed when the RocksDB instance is disposed.
|
|
199
|
+
* </p>
|
|
200
|
+
*
|
|
201
|
+
* @param path the path to the rocksdb.
|
|
202
|
+
* @param columnFamilyDescriptors list of column family descriptors
|
|
203
|
+
* @param columnFamilyHandles will be filled with ColumnFamilyHandle instances
|
|
204
|
+
* on open.
|
|
205
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
206
|
+
* {@link RocksDB} can not be opened.
|
|
207
|
+
*
|
|
208
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
209
|
+
* native library.
|
|
210
|
+
* @see DBOptions#setCreateIfMissing(boolean)
|
|
211
|
+
*/
|
|
212
|
+
public static RocksDB open(final String path,
|
|
213
|
+
final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
|
214
|
+
final List<ColumnFamilyHandle> columnFamilyHandles)
|
|
215
|
+
throws RocksDBException {
|
|
216
|
+
final DBOptions options = new DBOptions();
|
|
217
|
+
return open(options, path, columnFamilyDescriptors, columnFamilyHandles);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The factory constructor of RocksDB that opens a RocksDB instance given
|
|
222
|
+
* the path to the database using the specified options and db path.
|
|
223
|
+
*
|
|
224
|
+
* <p>
|
|
225
|
+
* Options instance *should* not be disposed before all DBs using this options
|
|
226
|
+
* instance have been closed. If user doesn't call options dispose explicitly,
|
|
227
|
+
* then this options instance will be GC'd automatically.</p>
|
|
228
|
+
* <p>
|
|
229
|
+
* Options instance can be re-used to open multiple DBs if DB statistics is
|
|
230
|
+
* not used. If DB statistics are required, then its recommended to open DB
|
|
231
|
+
* with new Options instance as underlying native statistics instance does not
|
|
232
|
+
* use any locks to prevent concurrent updates.</p>
|
|
233
|
+
*
|
|
234
|
+
* @param options {@link org.rocksdb.Options} instance.
|
|
235
|
+
* @param path the path to the rocksdb.
|
|
236
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
237
|
+
* {@link RocksDB} can not be opened.
|
|
238
|
+
*
|
|
239
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
240
|
+
* native library.
|
|
241
|
+
*
|
|
242
|
+
* @see Options#setCreateIfMissing(boolean)
|
|
243
|
+
*/
|
|
244
|
+
public static RocksDB open(final Options options, final String path)
|
|
245
|
+
throws RocksDBException {
|
|
246
|
+
// when non-default Options is used, keeping an Options reference
|
|
247
|
+
// in RocksDB can prevent Java to GC during the life-time of
|
|
248
|
+
// the currently-created RocksDB.
|
|
249
|
+
final RocksDB db = new RocksDB(open(options.nativeHandle_, path));
|
|
250
|
+
db.storeOptionsInstance(options);
|
|
251
|
+
return db;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* The factory constructor of RocksDB that opens a RocksDB instance given
|
|
256
|
+
* the path to the database using the specified options and db path and a list
|
|
257
|
+
* of column family names.
|
|
258
|
+
* <p>
|
|
259
|
+
* If opened in read write mode every existing column family name must be
|
|
260
|
+
* passed within the list to this method.</p>
|
|
261
|
+
* <p>
|
|
262
|
+
* If opened in read-only mode only a subset of existing column families must
|
|
263
|
+
* be passed to this method.</p>
|
|
264
|
+
* <p>
|
|
265
|
+
* Options instance *should* not be disposed before all DBs using this options
|
|
266
|
+
* instance have been closed. If user doesn't call options dispose explicitly,
|
|
267
|
+
* then this options instance will be GC'd automatically.</p>
|
|
268
|
+
* <p>
|
|
269
|
+
* Options instance can be re-used to open multiple DBs if DB statistics is
|
|
270
|
+
* not used. If DB statistics are required, then its recommended to open DB
|
|
271
|
+
* with new Options instance as underlying native statistics instance does not
|
|
272
|
+
* use any locks to prevent concurrent updates.</p>
|
|
273
|
+
* <p>
|
|
274
|
+
* ColumnFamily handles are disposed when the RocksDB instance is disposed.
|
|
275
|
+
* </p>
|
|
276
|
+
*
|
|
277
|
+
* @param options {@link org.rocksdb.DBOptions} instance.
|
|
278
|
+
* @param path the path to the rocksdb.
|
|
279
|
+
* @param columnFamilyDescriptors list of column family descriptors
|
|
280
|
+
* @param columnFamilyHandles will be filled with ColumnFamilyHandle instances
|
|
281
|
+
* on open.
|
|
282
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
283
|
+
* {@link RocksDB} can not be opened.
|
|
284
|
+
*
|
|
285
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
286
|
+
* native library.
|
|
287
|
+
*
|
|
288
|
+
* @see DBOptions#setCreateIfMissing(boolean)
|
|
289
|
+
*/
|
|
290
|
+
public static RocksDB open(final DBOptions options, final String path,
|
|
291
|
+
final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
|
292
|
+
final List<ColumnFamilyHandle> columnFamilyHandles)
|
|
293
|
+
throws RocksDBException {
|
|
294
|
+
|
|
295
|
+
final byte[][] cfNames = new byte[columnFamilyDescriptors.size()][];
|
|
296
|
+
final long[] cfOptionHandles = new long[columnFamilyDescriptors.size()];
|
|
297
|
+
for (int i = 0; i < columnFamilyDescriptors.size(); i++) {
|
|
298
|
+
final ColumnFamilyDescriptor cfDescriptor = columnFamilyDescriptors
|
|
299
|
+
.get(i);
|
|
300
|
+
cfNames[i] = cfDescriptor.getName();
|
|
301
|
+
cfOptionHandles[i] = cfDescriptor.getOptions().nativeHandle_;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
final long[] handles = open(options.nativeHandle_, path, cfNames,
|
|
305
|
+
cfOptionHandles);
|
|
306
|
+
final RocksDB db = new RocksDB(handles[0]);
|
|
307
|
+
db.storeOptionsInstance(options);
|
|
308
|
+
|
|
309
|
+
for (int i = 1; i < handles.length; i++) {
|
|
310
|
+
final ColumnFamilyHandle columnFamilyHandle = new ColumnFamilyHandle(db, handles[i]);
|
|
311
|
+
columnFamilyHandles.add(columnFamilyHandle);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
db.ownedColumnFamilyHandles.addAll(columnFamilyHandles);
|
|
315
|
+
|
|
316
|
+
return db;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* The factory constructor of RocksDB that opens a RocksDB instance in
|
|
321
|
+
* Read-Only mode given the path to the database using the default
|
|
322
|
+
* options.
|
|
323
|
+
*
|
|
324
|
+
* @param path the path to the RocksDB.
|
|
325
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
326
|
+
* {@link RocksDB} can not be opened.
|
|
327
|
+
*
|
|
328
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
329
|
+
* native library.
|
|
330
|
+
*/
|
|
331
|
+
public static RocksDB openReadOnly(final String path)
|
|
332
|
+
throws RocksDBException {
|
|
333
|
+
// This allows to use the rocksjni default Options instead of
|
|
334
|
+
// the c++ one.
|
|
335
|
+
final Options options = new Options();
|
|
336
|
+
return openReadOnly(options, path);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* The factory constructor of RocksDB that opens a RocksDB instance in
|
|
341
|
+
* Read-Only mode given the path to the database using the specified
|
|
342
|
+
* options and db path.
|
|
343
|
+
* <p>
|
|
344
|
+
* Options instance *should* not be disposed before all DBs using this options
|
|
345
|
+
* instance have been closed. If user doesn't call options dispose explicitly,
|
|
346
|
+
* then this options instance will be GC'd automatically.
|
|
347
|
+
*
|
|
348
|
+
* @param options {@link Options} instance.
|
|
349
|
+
* @param path the path to the RocksDB.
|
|
350
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
351
|
+
* {@link RocksDB} can not be opened.
|
|
352
|
+
*
|
|
353
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
354
|
+
* native library.
|
|
355
|
+
*/
|
|
356
|
+
public static RocksDB openReadOnly(final Options options, final String path)
|
|
357
|
+
throws RocksDBException {
|
|
358
|
+
return openReadOnly(options, path, false);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The factory constructor of RocksDB that opens a RocksDB instance in
|
|
363
|
+
* Read-Only mode given the path to the database using the specified
|
|
364
|
+
* options and db path.
|
|
365
|
+
* <p>
|
|
366
|
+
* Options instance *should* not be disposed before all DBs using this options
|
|
367
|
+
* instance have been closed. If user doesn't call options dispose explicitly,
|
|
368
|
+
* then this options instance will be GC'd automatically.
|
|
369
|
+
*
|
|
370
|
+
* @param options {@link Options} instance.
|
|
371
|
+
* @param path the path to the RocksDB.
|
|
372
|
+
* @param errorIfWalFileExists true to raise an error when opening the db
|
|
373
|
+
* if a Write Ahead Log file exists, false otherwise.
|
|
374
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
375
|
+
* {@link RocksDB} can not be opened.
|
|
376
|
+
*
|
|
377
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
378
|
+
* native library.
|
|
379
|
+
*/
|
|
380
|
+
public static RocksDB openReadOnly(final Options options, final String path,
|
|
381
|
+
final boolean errorIfWalFileExists) throws RocksDBException {
|
|
382
|
+
// when non-default Options is used, keeping an Options reference
|
|
383
|
+
// in RocksDB can prevent Java to GC during the life-time of
|
|
384
|
+
// the currently-created RocksDB.
|
|
385
|
+
final RocksDB db = new RocksDB(openROnly(options.nativeHandle_, path, errorIfWalFileExists));
|
|
386
|
+
db.storeOptionsInstance(options);
|
|
387
|
+
return db;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The factory constructor of RocksDB that opens a RocksDB instance in
|
|
392
|
+
* Read-Only mode given the path to the database using the default
|
|
393
|
+
* options.
|
|
394
|
+
*
|
|
395
|
+
* @param path the path to the RocksDB.
|
|
396
|
+
* @param columnFamilyDescriptors list of column family descriptors
|
|
397
|
+
* @param columnFamilyHandles will be filled with ColumnFamilyHandle instances
|
|
398
|
+
* on open.
|
|
399
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
400
|
+
* {@link RocksDB} can not be opened.
|
|
401
|
+
*
|
|
402
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
403
|
+
* native library.
|
|
404
|
+
*/
|
|
405
|
+
public static RocksDB openReadOnly(final String path,
|
|
406
|
+
final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
|
407
|
+
final List<ColumnFamilyHandle> columnFamilyHandles)
|
|
408
|
+
throws RocksDBException {
|
|
409
|
+
// This allows to use the rocksjni default Options instead of
|
|
410
|
+
// the c++ one.
|
|
411
|
+
final DBOptions options = new DBOptions();
|
|
412
|
+
return openReadOnly(options, path, columnFamilyDescriptors, columnFamilyHandles, false);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* The factory constructor of RocksDB that opens a RocksDB instance in
|
|
417
|
+
* Read-Only mode given the path to the database using the specified
|
|
418
|
+
* options and db path.
|
|
419
|
+
*
|
|
420
|
+
* <p>This open method allows to open RocksDB using a subset of available
|
|
421
|
+
* column families</p>
|
|
422
|
+
* <p>Options instance *should* not be disposed before all DBs using this
|
|
423
|
+
* options instance have been closed. If user doesn't call options dispose
|
|
424
|
+
* explicitly,then this options instance will be GC'd automatically.</p>
|
|
425
|
+
*
|
|
426
|
+
* @param options {@link DBOptions} instance.
|
|
427
|
+
* @param path the path to the RocksDB.
|
|
428
|
+
* @param columnFamilyDescriptors list of column family descriptors
|
|
429
|
+
* @param columnFamilyHandles will be filled with ColumnFamilyHandle instances
|
|
430
|
+
* on open.
|
|
431
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
432
|
+
* {@link RocksDB} can not be opened.
|
|
433
|
+
*
|
|
434
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
435
|
+
* native library.
|
|
436
|
+
*/
|
|
437
|
+
public static RocksDB openReadOnly(final DBOptions options, final String path,
|
|
438
|
+
final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
|
439
|
+
final List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException {
|
|
440
|
+
return openReadOnly(options, path, columnFamilyDescriptors, columnFamilyHandles, false);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* The factory constructor of RocksDB that opens a RocksDB instance in
|
|
445
|
+
* Read-Only mode given the path to the database using the specified
|
|
446
|
+
* options and db path.
|
|
447
|
+
*
|
|
448
|
+
* <p>This open method allows to open RocksDB using a subset of available
|
|
449
|
+
* column families</p>
|
|
450
|
+
* <p>Options instance *should* not be disposed before all DBs using this
|
|
451
|
+
* options instance have been closed. If user doesn't call options dispose
|
|
452
|
+
* explicitly,then this options instance will be GC'd automatically.</p>
|
|
453
|
+
*
|
|
454
|
+
* @param options {@link DBOptions} instance.
|
|
455
|
+
* @param path the path to the RocksDB.
|
|
456
|
+
* @param columnFamilyDescriptors list of column family descriptors
|
|
457
|
+
* @param columnFamilyHandles will be filled with ColumnFamilyHandle instances
|
|
458
|
+
* on open.
|
|
459
|
+
* @param errorIfWalFileExists true to raise an error when opening the db
|
|
460
|
+
* if a Write Ahead Log file exists, false otherwise.
|
|
461
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
462
|
+
* {@link RocksDB} can not be opened.
|
|
463
|
+
*
|
|
464
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
465
|
+
* native library.
|
|
466
|
+
*/
|
|
467
|
+
public static RocksDB openReadOnly(final DBOptions options, final String path,
|
|
468
|
+
final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
|
469
|
+
final List<ColumnFamilyHandle> columnFamilyHandles, final boolean errorIfWalFileExists)
|
|
470
|
+
throws RocksDBException {
|
|
471
|
+
// when non-default Options is used, keeping an Options reference
|
|
472
|
+
// in RocksDB can prevent Java to GC during the life-time of
|
|
473
|
+
// the currently-created RocksDB.
|
|
474
|
+
|
|
475
|
+
final byte[][] cfNames = new byte[columnFamilyDescriptors.size()][];
|
|
476
|
+
final long[] cfOptionHandles = new long[columnFamilyDescriptors.size()];
|
|
477
|
+
for (int i = 0; i < columnFamilyDescriptors.size(); i++) {
|
|
478
|
+
final ColumnFamilyDescriptor cfDescriptor = columnFamilyDescriptors
|
|
479
|
+
.get(i);
|
|
480
|
+
cfNames[i] = cfDescriptor.getName();
|
|
481
|
+
cfOptionHandles[i] = cfDescriptor.getOptions().nativeHandle_;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
final long[] handles =
|
|
485
|
+
openROnly(options.nativeHandle_, path, cfNames, cfOptionHandles, errorIfWalFileExists);
|
|
486
|
+
final RocksDB db = new RocksDB(handles[0]);
|
|
487
|
+
db.storeOptionsInstance(options);
|
|
488
|
+
|
|
489
|
+
for (int i = 1; i < handles.length; i++) {
|
|
490
|
+
final ColumnFamilyHandle columnFamilyHandle = new ColumnFamilyHandle(db, handles[i]);
|
|
491
|
+
columnFamilyHandles.add(columnFamilyHandle);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
db.ownedColumnFamilyHandles.addAll(columnFamilyHandles);
|
|
495
|
+
|
|
496
|
+
return db;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Open DB as secondary instance with only the default column family.
|
|
501
|
+
* <p>
|
|
502
|
+
* The secondary instance can dynamically tail the MANIFEST of
|
|
503
|
+
* a primary that must have already been created. User can call
|
|
504
|
+
* {@link #tryCatchUpWithPrimary()} to make the secondary instance catch up
|
|
505
|
+
* with primary (WAL tailing is NOT supported now) whenever the user feels
|
|
506
|
+
* necessary. Column families created by the primary after the secondary
|
|
507
|
+
* instance starts are currently ignored by the secondary instance.
|
|
508
|
+
* Column families opened by secondary and dropped by the primary will be
|
|
509
|
+
* dropped by secondary as well. However the user of the secondary instance
|
|
510
|
+
* can still access the data of such dropped column family as long as they
|
|
511
|
+
* do not destroy the corresponding column family handle.
|
|
512
|
+
* WAL tailing is not supported at present, but will arrive soon.
|
|
513
|
+
*
|
|
514
|
+
* @param options the options to open the secondary instance.
|
|
515
|
+
* @param path the path to the primary RocksDB instance.
|
|
516
|
+
* @param secondaryPath points to a directory where the secondary instance
|
|
517
|
+
* stores its info log
|
|
518
|
+
*
|
|
519
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
520
|
+
* {@link RocksDB} can not be opened.
|
|
521
|
+
*
|
|
522
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
523
|
+
* native library.
|
|
524
|
+
*/
|
|
525
|
+
public static RocksDB openAsSecondary(final Options options, final String path,
|
|
526
|
+
final String secondaryPath) throws RocksDBException {
|
|
527
|
+
// when non-default Options is used, keeping an Options reference
|
|
528
|
+
// in RocksDB can prevent Java to GC during the life-time of
|
|
529
|
+
// the currently-created RocksDB.
|
|
530
|
+
final RocksDB db = new RocksDB(openAsSecondary(options.nativeHandle_, path, secondaryPath));
|
|
531
|
+
db.storeOptionsInstance(options);
|
|
532
|
+
return db;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Open DB as secondary instance with column families.
|
|
537
|
+
* You can open a subset of column families in secondary mode.
|
|
538
|
+
* <p>
|
|
539
|
+
* The secondary instance can dynamically tail the MANIFEST of
|
|
540
|
+
* a primary that must have already been created. User can call
|
|
541
|
+
* {@link #tryCatchUpWithPrimary()} to make the secondary instance catch up
|
|
542
|
+
* with primary (WAL tailing is NOT supported now) whenever the user feels
|
|
543
|
+
* necessary. Column families created by the primary after the secondary
|
|
544
|
+
* instance starts are currently ignored by the secondary instance.
|
|
545
|
+
* Column families opened by secondary and dropped by the primary will be
|
|
546
|
+
* dropped by secondary as well. However the user of the secondary instance
|
|
547
|
+
* can still access the data of such dropped column family as long as they
|
|
548
|
+
* do not destroy the corresponding column family handle.
|
|
549
|
+
* WAL tailing is not supported at present, but will arrive soon.
|
|
550
|
+
*
|
|
551
|
+
* @param options the options to open the secondary instance.
|
|
552
|
+
* @param path the path to the primary RocksDB instance.
|
|
553
|
+
* @param secondaryPath points to a directory where the secondary instance
|
|
554
|
+
* stores its info log.
|
|
555
|
+
* @param columnFamilyDescriptors list of column family descriptors
|
|
556
|
+
* @param columnFamilyHandles will be filled with ColumnFamilyHandle instances
|
|
557
|
+
* on open.
|
|
558
|
+
*
|
|
559
|
+
* @return a {@link RocksDB} instance on success, null if the specified
|
|
560
|
+
* {@link RocksDB} can not be opened.
|
|
561
|
+
*
|
|
562
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
563
|
+
* native library.
|
|
564
|
+
*/
|
|
565
|
+
public static RocksDB openAsSecondary(final DBOptions options, final String path,
|
|
566
|
+
final String secondaryPath, final List<ColumnFamilyDescriptor> columnFamilyDescriptors,
|
|
567
|
+
final List<ColumnFamilyHandle> columnFamilyHandles) throws RocksDBException {
|
|
568
|
+
// when non-default Options is used, keeping an Options reference
|
|
569
|
+
// in RocksDB can prevent Java to GC during the life-time of
|
|
570
|
+
// the currently-created RocksDB.
|
|
571
|
+
|
|
572
|
+
final byte[][] cfNames = new byte[columnFamilyDescriptors.size()][];
|
|
573
|
+
final long[] cfOptionHandles = new long[columnFamilyDescriptors.size()];
|
|
574
|
+
for (int i = 0; i < columnFamilyDescriptors.size(); i++) {
|
|
575
|
+
final ColumnFamilyDescriptor cfDescriptor = columnFamilyDescriptors.get(i);
|
|
576
|
+
cfNames[i] = cfDescriptor.getName();
|
|
577
|
+
cfOptionHandles[i] = cfDescriptor.getOptions().nativeHandle_;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
final long[] handles =
|
|
581
|
+
openAsSecondary(options.nativeHandle_, path, secondaryPath, cfNames, cfOptionHandles);
|
|
582
|
+
final RocksDB db = new RocksDB(handles[0]);
|
|
583
|
+
db.storeOptionsInstance(options);
|
|
584
|
+
|
|
585
|
+
for (int i = 1; i < handles.length; i++) {
|
|
586
|
+
final ColumnFamilyHandle columnFamilyHandle = new ColumnFamilyHandle(db, handles[i]);
|
|
587
|
+
columnFamilyHandles.add(columnFamilyHandle);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
db.ownedColumnFamilyHandles.addAll(columnFamilyHandles);
|
|
591
|
+
|
|
592
|
+
return db;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* This is similar to {@link #close()} except that it
|
|
597
|
+
* throws an exception if any error occurs.
|
|
598
|
+
* <p>
|
|
599
|
+
* This will not fsync the WAL files.
|
|
600
|
+
* If syncing is required, the caller must first call {@link #syncWal()}
|
|
601
|
+
* or {@link #write(WriteOptions, WriteBatch)} using an empty write batch
|
|
602
|
+
* with {@link WriteOptions#setSync(boolean)} set to true.
|
|
603
|
+
* <p>
|
|
604
|
+
* See also {@link #close()}.
|
|
605
|
+
*
|
|
606
|
+
* @throws RocksDBException if an error occurs whilst closing.
|
|
607
|
+
*/
|
|
608
|
+
public void closeE() throws RocksDBException {
|
|
609
|
+
for (final ColumnFamilyHandle columnFamilyHandle : ownedColumnFamilyHandles) {
|
|
610
|
+
columnFamilyHandle.close();
|
|
611
|
+
}
|
|
612
|
+
ownedColumnFamilyHandles.clear();
|
|
613
|
+
|
|
614
|
+
if (owningHandle_.compareAndSet(true, false)) {
|
|
615
|
+
try {
|
|
616
|
+
closeDatabase(nativeHandle_);
|
|
617
|
+
} finally {
|
|
618
|
+
disposeInternal();
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* This is similar to {@link #closeE()} except that it
|
|
625
|
+
* silently ignores any errors.
|
|
626
|
+
* <p>
|
|
627
|
+
* This will not fsync the WAL files.
|
|
628
|
+
* If syncing is required, the caller must first call {@link #syncWal()}
|
|
629
|
+
* or {@link #write(WriteOptions, WriteBatch)} using an empty write batch
|
|
630
|
+
* with {@link WriteOptions#setSync(boolean)} set to true.
|
|
631
|
+
* <p>
|
|
632
|
+
* See also {@link #close()}.
|
|
633
|
+
*/
|
|
634
|
+
@Override
|
|
635
|
+
public void close() {
|
|
636
|
+
for (final ColumnFamilyHandle columnFamilyHandle : ownedColumnFamilyHandles) {
|
|
637
|
+
columnFamilyHandle.close();
|
|
638
|
+
}
|
|
639
|
+
ownedColumnFamilyHandles.clear();
|
|
640
|
+
|
|
641
|
+
if (owningHandle_.compareAndSet(true, false)) {
|
|
642
|
+
try {
|
|
643
|
+
closeDatabase(nativeHandle_);
|
|
644
|
+
} catch (final RocksDBException e) {
|
|
645
|
+
// silently ignore the error report
|
|
646
|
+
} finally {
|
|
647
|
+
disposeInternal();
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Static method to determine all available column families for a
|
|
654
|
+
* rocksdb database identified by path
|
|
655
|
+
*
|
|
656
|
+
* @param options Options for opening the database
|
|
657
|
+
* @param path Absolute path to rocksdb database
|
|
658
|
+
* @return List<byte[]> List containing the column family names
|
|
659
|
+
*
|
|
660
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
661
|
+
* native library.
|
|
662
|
+
*/
|
|
663
|
+
public static List<byte[]> listColumnFamilies(final Options options,
|
|
664
|
+
final String path) throws RocksDBException {
|
|
665
|
+
return Arrays.asList(RocksDB.listColumnFamilies(options.nativeHandle_,
|
|
666
|
+
path));
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Creates a new column family with the name columnFamilyName and
|
|
671
|
+
* allocates a ColumnFamilyHandle within an internal structure.
|
|
672
|
+
* The ColumnFamilyHandle is automatically disposed with DB disposal.
|
|
673
|
+
*
|
|
674
|
+
* @param columnFamilyDescriptor column family to be created.
|
|
675
|
+
* @return {@link org.rocksdb.ColumnFamilyHandle} instance.
|
|
676
|
+
*
|
|
677
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
678
|
+
* native library.
|
|
679
|
+
*/
|
|
680
|
+
public ColumnFamilyHandle createColumnFamily(
|
|
681
|
+
final ColumnFamilyDescriptor columnFamilyDescriptor)
|
|
682
|
+
throws RocksDBException {
|
|
683
|
+
final ColumnFamilyHandle columnFamilyHandle = new ColumnFamilyHandle(this,
|
|
684
|
+
createColumnFamily(nativeHandle_, columnFamilyDescriptor.getName(),
|
|
685
|
+
columnFamilyDescriptor.getName().length,
|
|
686
|
+
columnFamilyDescriptor.getOptions().nativeHandle_));
|
|
687
|
+
ownedColumnFamilyHandles.add(columnFamilyHandle);
|
|
688
|
+
return columnFamilyHandle;
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Bulk create column families with the same column family options.
|
|
693
|
+
*
|
|
694
|
+
* @param columnFamilyOptions the options for the column families.
|
|
695
|
+
* @param columnFamilyNames the names of the column families.
|
|
696
|
+
*
|
|
697
|
+
* @return the handles to the newly created column families.
|
|
698
|
+
*
|
|
699
|
+
* @throws RocksDBException if an error occurs whilst creating
|
|
700
|
+
* the column families
|
|
701
|
+
*/
|
|
702
|
+
public List<ColumnFamilyHandle> createColumnFamilies(
|
|
703
|
+
final ColumnFamilyOptions columnFamilyOptions,
|
|
704
|
+
final List<byte[]> columnFamilyNames) throws RocksDBException {
|
|
705
|
+
final byte[][] cfNames = columnFamilyNames.toArray(
|
|
706
|
+
new byte[0][]);
|
|
707
|
+
final long[] cfHandles = createColumnFamilies(nativeHandle_,
|
|
708
|
+
columnFamilyOptions.nativeHandle_, cfNames);
|
|
709
|
+
final List<ColumnFamilyHandle> columnFamilyHandles =
|
|
710
|
+
new ArrayList<>(cfHandles.length);
|
|
711
|
+
for (final long cfHandle : cfHandles) {
|
|
712
|
+
final ColumnFamilyHandle columnFamilyHandle = new ColumnFamilyHandle(this, cfHandle);
|
|
713
|
+
columnFamilyHandles.add(columnFamilyHandle);
|
|
714
|
+
}
|
|
715
|
+
ownedColumnFamilyHandles.addAll(columnFamilyHandles);
|
|
716
|
+
return columnFamilyHandles;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Bulk create column families with the same column family options.
|
|
721
|
+
*
|
|
722
|
+
* @param columnFamilyDescriptors the descriptions of the column families.
|
|
723
|
+
*
|
|
724
|
+
* @return the handles to the newly created column families.
|
|
725
|
+
*
|
|
726
|
+
* @throws RocksDBException if an error occurs whilst creating
|
|
727
|
+
* the column families
|
|
728
|
+
*/
|
|
729
|
+
public List<ColumnFamilyHandle> createColumnFamilies(
|
|
730
|
+
final List<ColumnFamilyDescriptor> columnFamilyDescriptors)
|
|
731
|
+
throws RocksDBException {
|
|
732
|
+
final long[] cfOptsHandles = new long[columnFamilyDescriptors.size()];
|
|
733
|
+
final byte[][] cfNames = new byte[columnFamilyDescriptors.size()][];
|
|
734
|
+
for (int i = 0; i < columnFamilyDescriptors.size(); i++) {
|
|
735
|
+
final ColumnFamilyDescriptor columnFamilyDescriptor
|
|
736
|
+
= columnFamilyDescriptors.get(i);
|
|
737
|
+
cfOptsHandles[i] = columnFamilyDescriptor.getOptions().nativeHandle_;
|
|
738
|
+
cfNames[i] = columnFamilyDescriptor.getName();
|
|
739
|
+
}
|
|
740
|
+
final long[] cfHandles = createColumnFamilies(nativeHandle_,
|
|
741
|
+
cfOptsHandles, cfNames);
|
|
742
|
+
final List<ColumnFamilyHandle> columnFamilyHandles =
|
|
743
|
+
new ArrayList<>(cfHandles.length);
|
|
744
|
+
for (final long cfHandle : cfHandles) {
|
|
745
|
+
final ColumnFamilyHandle columnFamilyHandle = new ColumnFamilyHandle(this, cfHandle);
|
|
746
|
+
columnFamilyHandles.add(columnFamilyHandle);
|
|
747
|
+
}
|
|
748
|
+
ownedColumnFamilyHandles.addAll(columnFamilyHandles);
|
|
749
|
+
return columnFamilyHandles;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Drops the column family specified by {@code columnFamilyHandle}. This call
|
|
754
|
+
* only records a drop record in the manifest and prevents the column
|
|
755
|
+
* family from flushing and compacting.
|
|
756
|
+
*
|
|
757
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
758
|
+
* instance
|
|
759
|
+
*
|
|
760
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
761
|
+
* native library.
|
|
762
|
+
*/
|
|
763
|
+
public void dropColumnFamily(final ColumnFamilyHandle columnFamilyHandle)
|
|
764
|
+
throws RocksDBException {
|
|
765
|
+
dropColumnFamily(nativeHandle_, columnFamilyHandle.nativeHandle_);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// Bulk drop column families. This call only records drop records in the
|
|
769
|
+
// manifest and prevents the column families from flushing and compacting.
|
|
770
|
+
// In case of error, the request may succeed partially. User may call
|
|
771
|
+
// ListColumnFamilies to check the result.
|
|
772
|
+
public void dropColumnFamilies(
|
|
773
|
+
final List<ColumnFamilyHandle> columnFamilies) throws RocksDBException {
|
|
774
|
+
final long[] cfHandles = new long[columnFamilies.size()];
|
|
775
|
+
for (int i = 0; i < columnFamilies.size(); i++) {
|
|
776
|
+
cfHandles[i] = columnFamilies.get(i).nativeHandle_;
|
|
777
|
+
}
|
|
778
|
+
dropColumnFamilies(nativeHandle_, cfHandles);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Deletes native column family handle of given {@link ColumnFamilyHandle} Java object
|
|
783
|
+
* and removes reference from {@link RocksDB#ownedColumnFamilyHandles}.
|
|
784
|
+
*
|
|
785
|
+
* @param columnFamilyHandle column family handle object.
|
|
786
|
+
*/
|
|
787
|
+
public void destroyColumnFamilyHandle(final ColumnFamilyHandle columnFamilyHandle) {
|
|
788
|
+
for (int i = 0; i < ownedColumnFamilyHandles.size(); ++i) {
|
|
789
|
+
final ColumnFamilyHandle ownedHandle = ownedColumnFamilyHandles.get(i);
|
|
790
|
+
if (ownedHandle.equals(columnFamilyHandle)) {
|
|
791
|
+
columnFamilyHandle.close();
|
|
792
|
+
ownedColumnFamilyHandles.remove(i);
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
/**
|
|
799
|
+
* Set the database entry for "key" to "value".
|
|
800
|
+
*
|
|
801
|
+
* @param key the specified key to be inserted.
|
|
802
|
+
* @param value the value associated with the specified key.
|
|
803
|
+
*
|
|
804
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
805
|
+
* native library.
|
|
806
|
+
*/
|
|
807
|
+
public void put(final byte[] key, final byte[] value)
|
|
808
|
+
throws RocksDBException {
|
|
809
|
+
put(nativeHandle_, key, 0, key.length, value, 0, value.length);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Set the database entry for "key" to "value".
|
|
814
|
+
*
|
|
815
|
+
* @param key The specified key to be inserted
|
|
816
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
817
|
+
* non-negative and no larger than "key".length
|
|
818
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
819
|
+
* and no larger than ("key".length - offset)
|
|
820
|
+
* @param value the value associated with the specified key
|
|
821
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
822
|
+
* non-negative and no longer than "key".length
|
|
823
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
824
|
+
* non-negative and no larger than ("value".length - offset)
|
|
825
|
+
*
|
|
826
|
+
* @throws RocksDBException thrown if errors happens in underlying native
|
|
827
|
+
* library.
|
|
828
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
829
|
+
*/
|
|
830
|
+
public void put(final byte[] key, final int offset, final int len,
|
|
831
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
832
|
+
throws RocksDBException {
|
|
833
|
+
checkBounds(offset, len, key.length);
|
|
834
|
+
checkBounds(vOffset, vLen, value.length);
|
|
835
|
+
put(nativeHandle_, key, offset, len, value, vOffset, vLen);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Set the database entry for "key" to "value" in the specified
|
|
840
|
+
* column family.
|
|
841
|
+
*
|
|
842
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
843
|
+
* instance
|
|
844
|
+
* @param key the specified key to be inserted.
|
|
845
|
+
* @param value the value associated with the specified key.
|
|
846
|
+
* <p>
|
|
847
|
+
* throws IllegalArgumentException if column family is not present
|
|
848
|
+
*
|
|
849
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
850
|
+
* native library.
|
|
851
|
+
*/
|
|
852
|
+
public void put(final ColumnFamilyHandle columnFamilyHandle,
|
|
853
|
+
final byte[] key, final byte[] value) throws RocksDBException {
|
|
854
|
+
put(nativeHandle_, key, 0, key.length, value, 0, value.length,
|
|
855
|
+
columnFamilyHandle.nativeHandle_);
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/**
|
|
859
|
+
* Set the database entry for "key" to "value" in the specified
|
|
860
|
+
* column family.
|
|
861
|
+
*
|
|
862
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
863
|
+
* instance
|
|
864
|
+
* @param key The specified key to be inserted
|
|
865
|
+
* @param offset the offset of the "key" array to be used, must
|
|
866
|
+
* be non-negative and no larger than "key".length
|
|
867
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
868
|
+
* and no larger than ("key".length - offset)
|
|
869
|
+
* @param value the value associated with the specified key
|
|
870
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
871
|
+
* non-negative and no longer than "key".length
|
|
872
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
873
|
+
* non-negative and no larger than ("value".length - offset)
|
|
874
|
+
*
|
|
875
|
+
* @throws RocksDBException thrown if errors happens in underlying native
|
|
876
|
+
* library.
|
|
877
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
878
|
+
*/
|
|
879
|
+
public void put(final ColumnFamilyHandle columnFamilyHandle,
|
|
880
|
+
final byte[] key, final int offset, final int len,
|
|
881
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
882
|
+
throws RocksDBException {
|
|
883
|
+
checkBounds(offset, len, key.length);
|
|
884
|
+
checkBounds(vOffset, vLen, value.length);
|
|
885
|
+
put(nativeHandle_, key, offset, len, value, vOffset, vLen,
|
|
886
|
+
columnFamilyHandle.nativeHandle_);
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Set the database entry for "key" to "value".
|
|
891
|
+
*
|
|
892
|
+
* @param writeOpts {@link org.rocksdb.WriteOptions} instance.
|
|
893
|
+
* @param key the specified key to be inserted.
|
|
894
|
+
* @param value the value associated with the specified key.
|
|
895
|
+
*
|
|
896
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
897
|
+
* native library.
|
|
898
|
+
*/
|
|
899
|
+
public void put(final WriteOptions writeOpts, final byte[] key,
|
|
900
|
+
final byte[] value) throws RocksDBException {
|
|
901
|
+
put(nativeHandle_, writeOpts.nativeHandle_,
|
|
902
|
+
key, 0, key.length, value, 0, value.length);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Set the database entry for "key" to "value".
|
|
907
|
+
*
|
|
908
|
+
* @param writeOpts {@link org.rocksdb.WriteOptions} instance.
|
|
909
|
+
* @param key The specified key to be inserted
|
|
910
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
911
|
+
* non-negative and no larger than "key".length
|
|
912
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
913
|
+
* and no larger than ("key".length - offset)
|
|
914
|
+
* @param value the value associated with the specified key
|
|
915
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
916
|
+
* non-negative and no longer than "key".length
|
|
917
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
918
|
+
* non-negative and no larger than ("value".length - offset)
|
|
919
|
+
*
|
|
920
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
921
|
+
* native library.
|
|
922
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
923
|
+
*/
|
|
924
|
+
public void put(final WriteOptions writeOpts,
|
|
925
|
+
final byte[] key, final int offset, final int len,
|
|
926
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
927
|
+
throws RocksDBException {
|
|
928
|
+
checkBounds(offset, len, key.length);
|
|
929
|
+
checkBounds(vOffset, vLen, value.length);
|
|
930
|
+
put(nativeHandle_, writeOpts.nativeHandle_,
|
|
931
|
+
key, offset, len, value, vOffset, vLen);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Set the database entry for "key" to "value" for the specified
|
|
936
|
+
* column family.
|
|
937
|
+
*
|
|
938
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
939
|
+
* instance
|
|
940
|
+
* @param writeOpts {@link org.rocksdb.WriteOptions} instance.
|
|
941
|
+
* @param key the specified key to be inserted.
|
|
942
|
+
* @param value the value associated with the specified key.
|
|
943
|
+
* <p>
|
|
944
|
+
* throws IllegalArgumentException if column family is not present
|
|
945
|
+
*
|
|
946
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
947
|
+
* native library.
|
|
948
|
+
* @see IllegalArgumentException
|
|
949
|
+
*/
|
|
950
|
+
public void put(final ColumnFamilyHandle columnFamilyHandle,
|
|
951
|
+
final WriteOptions writeOpts, final byte[] key,
|
|
952
|
+
final byte[] value) throws RocksDBException {
|
|
953
|
+
put(nativeHandle_, writeOpts.nativeHandle_, key, 0, key.length, value,
|
|
954
|
+
0, value.length, columnFamilyHandle.nativeHandle_);
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Set the database entry for "key" to "value" for the specified
|
|
959
|
+
* column family.
|
|
960
|
+
*
|
|
961
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
962
|
+
* instance
|
|
963
|
+
* @param writeOpts {@link org.rocksdb.WriteOptions} instance.
|
|
964
|
+
* @param key the specified key to be inserted. Position and limit is used.
|
|
965
|
+
* Supports direct buffer only.
|
|
966
|
+
* @param value the value associated with the specified key. Position and limit is used.
|
|
967
|
+
* Supports direct buffer only.
|
|
968
|
+
* <p>
|
|
969
|
+
* throws IllegalArgumentException if column family is not present
|
|
970
|
+
*
|
|
971
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
972
|
+
* native library.
|
|
973
|
+
* @see IllegalArgumentException
|
|
974
|
+
*/
|
|
975
|
+
public void put(final ColumnFamilyHandle columnFamilyHandle, final WriteOptions writeOpts,
|
|
976
|
+
final ByteBuffer key, final ByteBuffer value) throws RocksDBException {
|
|
977
|
+
assert key.isDirect() && value.isDirect();
|
|
978
|
+
putDirect(nativeHandle_, writeOpts.nativeHandle_, key, key.position(), key.remaining(), value,
|
|
979
|
+
value.position(), value.remaining(), columnFamilyHandle.nativeHandle_);
|
|
980
|
+
key.position(key.limit());
|
|
981
|
+
value.position(value.limit());
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
/**
|
|
985
|
+
* Set the database entry for "key" to "value".
|
|
986
|
+
*
|
|
987
|
+
* @param writeOpts {@link org.rocksdb.WriteOptions} instance.
|
|
988
|
+
* @param key the specified key to be inserted. Position and limit is used.
|
|
989
|
+
* Supports direct buffer only.
|
|
990
|
+
* @param value the value associated with the specified key. Position and limit is used.
|
|
991
|
+
* Supports direct buffer only.
|
|
992
|
+
* <p>
|
|
993
|
+
* throws IllegalArgumentException if column family is not present
|
|
994
|
+
*
|
|
995
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
996
|
+
* native library.
|
|
997
|
+
* @see IllegalArgumentException
|
|
998
|
+
*/
|
|
999
|
+
public void put(final WriteOptions writeOpts, final ByteBuffer key, final ByteBuffer value)
|
|
1000
|
+
throws RocksDBException {
|
|
1001
|
+
assert key.isDirect() && value.isDirect();
|
|
1002
|
+
putDirect(nativeHandle_, writeOpts.nativeHandle_, key, key.position(), key.remaining(), value,
|
|
1003
|
+
value.position(), value.remaining(), 0);
|
|
1004
|
+
key.position(key.limit());
|
|
1005
|
+
value.position(value.limit());
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* Set the database entry for "key" to "value" for the specified
|
|
1010
|
+
* column family.
|
|
1011
|
+
*
|
|
1012
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1013
|
+
* instance
|
|
1014
|
+
* @param writeOpts {@link org.rocksdb.WriteOptions} instance.
|
|
1015
|
+
* @param key The specified key to be inserted
|
|
1016
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1017
|
+
* non-negative and no larger than "key".length
|
|
1018
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1019
|
+
* and no larger than ("key".length - offset)
|
|
1020
|
+
* @param value the value associated with the specified key
|
|
1021
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1022
|
+
* non-negative and no longer than "key".length
|
|
1023
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1024
|
+
* non-negative and no larger than ("value".length - offset)
|
|
1025
|
+
*
|
|
1026
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1027
|
+
* native library.
|
|
1028
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
1029
|
+
*/
|
|
1030
|
+
public void put(final ColumnFamilyHandle columnFamilyHandle,
|
|
1031
|
+
final WriteOptions writeOpts,
|
|
1032
|
+
final byte[] key, final int offset, final int len,
|
|
1033
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
1034
|
+
throws RocksDBException {
|
|
1035
|
+
checkBounds(offset, len, key.length);
|
|
1036
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1037
|
+
put(nativeHandle_, writeOpts.nativeHandle_, key, offset, len, value,
|
|
1038
|
+
vOffset, vLen, columnFamilyHandle.nativeHandle_);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1043
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1044
|
+
* did not exist in the database.
|
|
1045
|
+
*
|
|
1046
|
+
* @param key Key to delete within database
|
|
1047
|
+
*
|
|
1048
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1049
|
+
* native library.
|
|
1050
|
+
*/
|
|
1051
|
+
public void delete(final byte[] key) throws RocksDBException {
|
|
1052
|
+
delete(nativeHandle_, key, 0, key.length);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1057
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1058
|
+
* did not exist in the database.
|
|
1059
|
+
*
|
|
1060
|
+
* @param key Key to delete within database
|
|
1061
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1062
|
+
* non-negative and no larger than "key".length
|
|
1063
|
+
* @param len the length of the "key" array to be used, must be
|
|
1064
|
+
* non-negative and no larger than ("key".length - offset)
|
|
1065
|
+
*
|
|
1066
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1067
|
+
* native library.
|
|
1068
|
+
*/
|
|
1069
|
+
public void delete(final byte[] key, final int offset, final int len)
|
|
1070
|
+
throws RocksDBException {
|
|
1071
|
+
delete(nativeHandle_, key, offset, len);
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1076
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1077
|
+
* did not exist in the database.
|
|
1078
|
+
*
|
|
1079
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1080
|
+
* instance
|
|
1081
|
+
* @param key Key to delete within database
|
|
1082
|
+
*
|
|
1083
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1084
|
+
* native library.
|
|
1085
|
+
*/
|
|
1086
|
+
public void delete(final ColumnFamilyHandle columnFamilyHandle,
|
|
1087
|
+
final byte[] key) throws RocksDBException {
|
|
1088
|
+
delete(nativeHandle_, key, 0, key.length, columnFamilyHandle.nativeHandle_);
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
/**
|
|
1092
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1093
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1094
|
+
* did not exist in the database.
|
|
1095
|
+
*
|
|
1096
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1097
|
+
* instance
|
|
1098
|
+
* @param key Key to delete within database
|
|
1099
|
+
* @param offset the offset of the "key" array to be used,
|
|
1100
|
+
* must be non-negative and no larger than "key".length
|
|
1101
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1102
|
+
* and no larger than ("value".length - offset)
|
|
1103
|
+
*
|
|
1104
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1105
|
+
* native library.
|
|
1106
|
+
*/
|
|
1107
|
+
public void delete(final ColumnFamilyHandle columnFamilyHandle,
|
|
1108
|
+
final byte[] key, final int offset, final int len)
|
|
1109
|
+
throws RocksDBException {
|
|
1110
|
+
delete(nativeHandle_, key, offset, len, columnFamilyHandle.nativeHandle_);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1115
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1116
|
+
* did not exist in the database.
|
|
1117
|
+
*
|
|
1118
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1119
|
+
* @param key Key to delete within database
|
|
1120
|
+
*
|
|
1121
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1122
|
+
* native library.
|
|
1123
|
+
*/
|
|
1124
|
+
public void delete(final WriteOptions writeOpt, final byte[] key)
|
|
1125
|
+
throws RocksDBException {
|
|
1126
|
+
delete(nativeHandle_, writeOpt.nativeHandle_, key, 0, key.length);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1131
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1132
|
+
* did not exist in the database.
|
|
1133
|
+
*
|
|
1134
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1135
|
+
* @param key Key to delete within database
|
|
1136
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1137
|
+
* non-negative and no larger than "key".length
|
|
1138
|
+
* @param len the length of the "key" array to be used, must be
|
|
1139
|
+
* non-negative and no larger than ("key".length - offset)
|
|
1140
|
+
*
|
|
1141
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1142
|
+
* native library.
|
|
1143
|
+
*/
|
|
1144
|
+
public void delete(final WriteOptions writeOpt, final byte[] key,
|
|
1145
|
+
final int offset, final int len) throws RocksDBException {
|
|
1146
|
+
delete(nativeHandle_, writeOpt.nativeHandle_, key, offset, len);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1151
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1152
|
+
* did not exist in the database.
|
|
1153
|
+
*
|
|
1154
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1155
|
+
* instance
|
|
1156
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1157
|
+
* @param key Key to delete within database
|
|
1158
|
+
*
|
|
1159
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1160
|
+
* native library.
|
|
1161
|
+
*/
|
|
1162
|
+
public void delete(final ColumnFamilyHandle columnFamilyHandle,
|
|
1163
|
+
final WriteOptions writeOpt, final byte[] key)
|
|
1164
|
+
throws RocksDBException {
|
|
1165
|
+
delete(nativeHandle_, writeOpt.nativeHandle_, key, 0, key.length,
|
|
1166
|
+
columnFamilyHandle.nativeHandle_);
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1171
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1172
|
+
* did not exist in the database.
|
|
1173
|
+
*
|
|
1174
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1175
|
+
* instance
|
|
1176
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1177
|
+
* @param key Key to delete within database
|
|
1178
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1179
|
+
* non-negative and no larger than "key".length
|
|
1180
|
+
* @param len the length of the "key" array to be used, must be
|
|
1181
|
+
* non-negative and no larger than ("key".length - offset)
|
|
1182
|
+
*
|
|
1183
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1184
|
+
* native library.
|
|
1185
|
+
*/
|
|
1186
|
+
public void delete(final ColumnFamilyHandle columnFamilyHandle,
|
|
1187
|
+
final WriteOptions writeOpt, final byte[] key, final int offset,
|
|
1188
|
+
final int len) throws RocksDBException {
|
|
1189
|
+
delete(nativeHandle_, writeOpt.nativeHandle_, key, offset, len,
|
|
1190
|
+
columnFamilyHandle.nativeHandle_);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Get the value associated with the specified key within column family.
|
|
1195
|
+
*
|
|
1196
|
+
* @param opt {@link org.rocksdb.ReadOptions} instance.
|
|
1197
|
+
* @param key the key to retrieve the value. It is using position and limit.
|
|
1198
|
+
* Supports direct buffer only.
|
|
1199
|
+
* @param value the out-value to receive the retrieved value.
|
|
1200
|
+
* It is using position and limit. Limit is set according to value size.
|
|
1201
|
+
* Supports direct buffer only.
|
|
1202
|
+
* @return The size of the actual value that matches the specified
|
|
1203
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1204
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1205
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1206
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1207
|
+
* found.
|
|
1208
|
+
*
|
|
1209
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1210
|
+
* native library.
|
|
1211
|
+
*/
|
|
1212
|
+
public int get(final ReadOptions opt, final ByteBuffer key, final ByteBuffer value)
|
|
1213
|
+
throws RocksDBException {
|
|
1214
|
+
assert key.isDirect() && value.isDirect();
|
|
1215
|
+
final int result = getDirect(nativeHandle_, opt.nativeHandle_, key, key.position(),
|
|
1216
|
+
key.remaining(), value, value.position(), value.remaining(), 0);
|
|
1217
|
+
if (result != NOT_FOUND) {
|
|
1218
|
+
value.limit(Math.min(value.limit(), value.position() + result));
|
|
1219
|
+
}
|
|
1220
|
+
key.position(key.limit());
|
|
1221
|
+
return result;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/**
|
|
1225
|
+
* Get the value associated with the specified key within column family.
|
|
1226
|
+
*
|
|
1227
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1228
|
+
* instance
|
|
1229
|
+
* @param opt {@link org.rocksdb.ReadOptions} instance.
|
|
1230
|
+
* @param key the key to retrieve the value. It is using position and limit.
|
|
1231
|
+
* Supports direct buffer only.
|
|
1232
|
+
* @param value the out-value to receive the retrieved value.
|
|
1233
|
+
* It is using position and limit. Limit is set according to value size.
|
|
1234
|
+
* Supports direct buffer only.
|
|
1235
|
+
* @return The size of the actual value that matches the specified
|
|
1236
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1237
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1238
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1239
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1240
|
+
* found.
|
|
1241
|
+
*
|
|
1242
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1243
|
+
* native library.
|
|
1244
|
+
*/
|
|
1245
|
+
public int get(final ColumnFamilyHandle columnFamilyHandle, final ReadOptions opt,
|
|
1246
|
+
final ByteBuffer key, final ByteBuffer value) throws RocksDBException {
|
|
1247
|
+
assert key.isDirect() && value.isDirect();
|
|
1248
|
+
final int result =
|
|
1249
|
+
getDirect(nativeHandle_, opt.nativeHandle_, key, key.position(), key.remaining(), value,
|
|
1250
|
+
value.position(), value.remaining(), columnFamilyHandle.nativeHandle_);
|
|
1251
|
+
if (result != NOT_FOUND) {
|
|
1252
|
+
value.limit(Math.min(value.limit(), value.position() + result));
|
|
1253
|
+
}
|
|
1254
|
+
key.position(key.limit());
|
|
1255
|
+
return result;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Remove the database entry for {@code key}. Requires that the key exists
|
|
1260
|
+
* and was not overwritten. It is not an error if the key did not exist
|
|
1261
|
+
* in the database.
|
|
1262
|
+
* <p>
|
|
1263
|
+
* If a key is overwritten (by calling {@link #put(byte[], byte[])} multiple
|
|
1264
|
+
* times), then the result of calling SingleDelete() on this key is undefined.
|
|
1265
|
+
* SingleDelete() only behaves correctly if there has been only one Put()
|
|
1266
|
+
* for this key since the previous call to SingleDelete() for this key.
|
|
1267
|
+
* <p>
|
|
1268
|
+
* This feature is currently an experimental performance optimization
|
|
1269
|
+
* for a very specific workload. It is up to the caller to ensure that
|
|
1270
|
+
* SingleDelete is only used for a key that is not deleted using Delete() or
|
|
1271
|
+
* written using Merge(). Mixing SingleDelete operations with Deletes and
|
|
1272
|
+
* Merges can result in undefined behavior.
|
|
1273
|
+
*
|
|
1274
|
+
* @param key Key to delete within database
|
|
1275
|
+
*
|
|
1276
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1277
|
+
* native library.
|
|
1278
|
+
*/
|
|
1279
|
+
@Experimental("Performance optimization for a very specific workload")
|
|
1280
|
+
public void singleDelete(final byte[] key) throws RocksDBException {
|
|
1281
|
+
singleDelete(nativeHandle_, key, key.length);
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
/**
|
|
1285
|
+
* Remove the database entry for {@code key}. Requires that the key exists
|
|
1286
|
+
* and was not overwritten. It is not an error if the key did not exist
|
|
1287
|
+
* in the database.
|
|
1288
|
+
* <p>
|
|
1289
|
+
* If a key is overwritten (by calling {@link #put(byte[], byte[])} multiple
|
|
1290
|
+
* times), then the result of calling SingleDelete() on this key is undefined.
|
|
1291
|
+
* SingleDelete() only behaves correctly if there has been only one Put()
|
|
1292
|
+
* for this key since the previous call to SingleDelete() for this key.
|
|
1293
|
+
* <p>
|
|
1294
|
+
* This feature is currently an experimental performance optimization
|
|
1295
|
+
* for a very specific workload. It is up to the caller to ensure that
|
|
1296
|
+
* SingleDelete is only used for a key that is not deleted using Delete() or
|
|
1297
|
+
* written using Merge(). Mixing SingleDelete operations with Deletes and
|
|
1298
|
+
* Merges can result in undefined behavior.
|
|
1299
|
+
*
|
|
1300
|
+
* @param columnFamilyHandle The column family to delete the key from
|
|
1301
|
+
* @param key Key to delete within database
|
|
1302
|
+
*
|
|
1303
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1304
|
+
* native library.
|
|
1305
|
+
*/
|
|
1306
|
+
@Experimental("Performance optimization for a very specific workload")
|
|
1307
|
+
public void singleDelete(final ColumnFamilyHandle columnFamilyHandle,
|
|
1308
|
+
final byte[] key) throws RocksDBException {
|
|
1309
|
+
singleDelete(nativeHandle_, key, key.length,
|
|
1310
|
+
columnFamilyHandle.nativeHandle_);
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* Remove the database entry for {@code key}. Requires that the key exists
|
|
1315
|
+
* and was not overwritten. It is not an error if the key did not exist
|
|
1316
|
+
* in the database.
|
|
1317
|
+
* <p>
|
|
1318
|
+
* If a key is overwritten (by calling {@link #put(byte[], byte[])} multiple
|
|
1319
|
+
* times), then the result of calling SingleDelete() on this key is undefined.
|
|
1320
|
+
* SingleDelete() only behaves correctly if there has been only one Put()
|
|
1321
|
+
* for this key since the previous call to SingleDelete() for this key.
|
|
1322
|
+
* <p>
|
|
1323
|
+
* This feature is currently an experimental performance optimization
|
|
1324
|
+
* for a very specific workload. It is up to the caller to ensure that
|
|
1325
|
+
* SingleDelete is only used for a key that is not deleted using Delete() or
|
|
1326
|
+
* written using Merge(). Mixing SingleDelete operations with Deletes and
|
|
1327
|
+
* Merges can result in undefined behavior.
|
|
1328
|
+
* <p>
|
|
1329
|
+
* Note: consider setting {@link WriteOptions#setSync(boolean)} true.
|
|
1330
|
+
*
|
|
1331
|
+
* @param writeOpt Write options for the delete
|
|
1332
|
+
* @param key Key to delete within database
|
|
1333
|
+
*
|
|
1334
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1335
|
+
* native library.
|
|
1336
|
+
*/
|
|
1337
|
+
@Experimental("Performance optimization for a very specific workload")
|
|
1338
|
+
public void singleDelete(final WriteOptions writeOpt, final byte[] key)
|
|
1339
|
+
throws RocksDBException {
|
|
1340
|
+
singleDelete(nativeHandle_, writeOpt.nativeHandle_, key, key.length);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/**
|
|
1344
|
+
* Remove the database entry for {@code key}. Requires that the key exists
|
|
1345
|
+
* and was not overwritten. It is not an error if the key did not exist
|
|
1346
|
+
* in the database.
|
|
1347
|
+
* <p>
|
|
1348
|
+
* If a key is overwritten (by calling {@link #put(byte[], byte[])} multiple
|
|
1349
|
+
* times), then the result of calling SingleDelete() on this key is undefined.
|
|
1350
|
+
* SingleDelete() only behaves correctly if there has been only one Put()
|
|
1351
|
+
* for this key since the previous call to SingleDelete() for this key.
|
|
1352
|
+
* <p>
|
|
1353
|
+
* This feature is currently an experimental performance optimization
|
|
1354
|
+
* for a very specific workload. It is up to the caller to ensure that
|
|
1355
|
+
* SingleDelete is only used for a key that is not deleted using Delete() or
|
|
1356
|
+
* written using Merge(). Mixing SingleDelete operations with Deletes and
|
|
1357
|
+
* Merges can result in undefined behavior.
|
|
1358
|
+
* <p>
|
|
1359
|
+
* Note: consider setting {@link WriteOptions#setSync(boolean)} true.
|
|
1360
|
+
*
|
|
1361
|
+
* @param columnFamilyHandle The column family to delete the key from
|
|
1362
|
+
* @param writeOpt Write options for the delete
|
|
1363
|
+
* @param key Key to delete within database
|
|
1364
|
+
*
|
|
1365
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1366
|
+
* native library.
|
|
1367
|
+
*/
|
|
1368
|
+
@Experimental("Performance optimization for a very specific workload")
|
|
1369
|
+
public void singleDelete(final ColumnFamilyHandle columnFamilyHandle,
|
|
1370
|
+
final WriteOptions writeOpt, final byte[] key) throws RocksDBException {
|
|
1371
|
+
singleDelete(nativeHandle_, writeOpt.nativeHandle_, key, key.length,
|
|
1372
|
+
columnFamilyHandle.nativeHandle_);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* Removes the database entries in the range ["beginKey", "endKey"), i.e.,
|
|
1377
|
+
* including "beginKey" and excluding "endKey". a non-OK status on error. It
|
|
1378
|
+
* is not an error if no keys exist in the range ["beginKey", "endKey").
|
|
1379
|
+
* <p>
|
|
1380
|
+
* Delete the database entry (if any) for "key". Returns OK on success, and a
|
|
1381
|
+
* non-OK status on error. It is not an error if "key" did not exist in the
|
|
1382
|
+
* database.
|
|
1383
|
+
*
|
|
1384
|
+
* @param beginKey First key to delete within database (inclusive)
|
|
1385
|
+
* @param endKey Last key to delete within database (exclusive)
|
|
1386
|
+
*
|
|
1387
|
+
* @throws RocksDBException thrown if error happens in underlying native
|
|
1388
|
+
* library.
|
|
1389
|
+
*/
|
|
1390
|
+
public void deleteRange(final byte[] beginKey, final byte[] endKey)
|
|
1391
|
+
throws RocksDBException {
|
|
1392
|
+
deleteRange(nativeHandle_, beginKey, 0, beginKey.length, endKey, 0,
|
|
1393
|
+
endKey.length);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* Removes the database entries in the range ["beginKey", "endKey"), i.e.,
|
|
1398
|
+
* including "beginKey" and excluding "endKey". a non-OK status on error. It
|
|
1399
|
+
* is not an error if no keys exist in the range ["beginKey", "endKey").
|
|
1400
|
+
* <p>
|
|
1401
|
+
* Delete the database entry (if any) for "key". Returns OK on success, and a
|
|
1402
|
+
* non-OK status on error. It is not an error if "key" did not exist in the
|
|
1403
|
+
* database.
|
|
1404
|
+
*
|
|
1405
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle} instance
|
|
1406
|
+
* @param beginKey First key to delete within database (inclusive)
|
|
1407
|
+
* @param endKey Last key to delete within database (exclusive)
|
|
1408
|
+
*
|
|
1409
|
+
* @throws RocksDBException thrown if error happens in underlying native
|
|
1410
|
+
* library.
|
|
1411
|
+
*/
|
|
1412
|
+
public void deleteRange(final ColumnFamilyHandle columnFamilyHandle,
|
|
1413
|
+
final byte[] beginKey, final byte[] endKey) throws RocksDBException {
|
|
1414
|
+
deleteRange(nativeHandle_, beginKey, 0, beginKey.length, endKey, 0,
|
|
1415
|
+
endKey.length, columnFamilyHandle.nativeHandle_);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* Removes the database entries in the range ["beginKey", "endKey"), i.e.,
|
|
1420
|
+
* including "beginKey" and excluding "endKey". a non-OK status on error. It
|
|
1421
|
+
* is not an error if no keys exist in the range ["beginKey", "endKey").
|
|
1422
|
+
* <p>
|
|
1423
|
+
* Delete the database entry (if any) for "key". Returns OK on success, and a
|
|
1424
|
+
* non-OK status on error. It is not an error if "key" did not exist in the
|
|
1425
|
+
* database.
|
|
1426
|
+
*
|
|
1427
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1428
|
+
* @param beginKey First key to delete within database (inclusive)
|
|
1429
|
+
* @param endKey Last key to delete within database (exclusive)
|
|
1430
|
+
*
|
|
1431
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1432
|
+
* native library.
|
|
1433
|
+
*/
|
|
1434
|
+
public void deleteRange(final WriteOptions writeOpt, final byte[] beginKey,
|
|
1435
|
+
final byte[] endKey) throws RocksDBException {
|
|
1436
|
+
deleteRange(nativeHandle_, writeOpt.nativeHandle_, beginKey, 0,
|
|
1437
|
+
beginKey.length, endKey, 0, endKey.length);
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/**
|
|
1441
|
+
* Removes the database entries in the range ["beginKey", "endKey"), i.e.,
|
|
1442
|
+
* including "beginKey" and excluding "endKey". a non-OK status on error. It
|
|
1443
|
+
* is not an error if no keys exist in the range ["beginKey", "endKey").
|
|
1444
|
+
* <p>
|
|
1445
|
+
* Delete the database entry (if any) for "key". Returns OK on success, and a
|
|
1446
|
+
* non-OK status on error. It is not an error if "key" did not exist in the
|
|
1447
|
+
* database.
|
|
1448
|
+
*
|
|
1449
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle} instance
|
|
1450
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1451
|
+
* @param beginKey First key to delete within database (included)
|
|
1452
|
+
* @param endKey Last key to delete within database (excluded)
|
|
1453
|
+
*
|
|
1454
|
+
* @throws RocksDBException thrown if error happens in underlying native
|
|
1455
|
+
* library.
|
|
1456
|
+
*/
|
|
1457
|
+
public void deleteRange(final ColumnFamilyHandle columnFamilyHandle,
|
|
1458
|
+
final WriteOptions writeOpt, final byte[] beginKey, final byte[] endKey)
|
|
1459
|
+
throws RocksDBException {
|
|
1460
|
+
deleteRange(nativeHandle_, writeOpt.nativeHandle_, beginKey, 0,
|
|
1461
|
+
beginKey.length, endKey, 0, endKey.length,
|
|
1462
|
+
columnFamilyHandle.nativeHandle_);
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
/**
|
|
1467
|
+
* Add merge operand for key/value pair.
|
|
1468
|
+
*
|
|
1469
|
+
* @param key the specified key to be merged.
|
|
1470
|
+
* @param value the value to be merged with the current value for the
|
|
1471
|
+
* specified key.
|
|
1472
|
+
*
|
|
1473
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1474
|
+
* native library.
|
|
1475
|
+
*/
|
|
1476
|
+
public void merge(final byte[] key, final byte[] value)
|
|
1477
|
+
throws RocksDBException {
|
|
1478
|
+
merge(nativeHandle_, key, 0, key.length, value, 0, value.length);
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Add merge operand for key/value pair.
|
|
1483
|
+
*
|
|
1484
|
+
* @param key the specified key to be merged.
|
|
1485
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1486
|
+
* non-negative and no larger than "key".length
|
|
1487
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1488
|
+
* and no larger than ("key".length - offset)
|
|
1489
|
+
* @param value the value to be merged with the current value for the
|
|
1490
|
+
* specified key.
|
|
1491
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1492
|
+
* non-negative and no longer than "key".length
|
|
1493
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1494
|
+
* non-negative and must be non-negative and no larger than
|
|
1495
|
+
* ("value".length - offset)
|
|
1496
|
+
*
|
|
1497
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1498
|
+
* native library.
|
|
1499
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
1500
|
+
*/
|
|
1501
|
+
public void merge(final byte[] key, final int offset, final int len, final byte[] value,
|
|
1502
|
+
final int vOffset, final int vLen) throws RocksDBException {
|
|
1503
|
+
checkBounds(offset, len, key.length);
|
|
1504
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1505
|
+
merge(nativeHandle_, key, offset, len, value, vOffset, vLen);
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
/**
|
|
1509
|
+
* Add merge operand for key/value pair in a ColumnFamily.
|
|
1510
|
+
*
|
|
1511
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
1512
|
+
* @param key the specified key to be merged.
|
|
1513
|
+
* @param value the value to be merged with the current value for
|
|
1514
|
+
* the specified key.
|
|
1515
|
+
*
|
|
1516
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1517
|
+
* native library.
|
|
1518
|
+
*/
|
|
1519
|
+
public void merge(final ColumnFamilyHandle columnFamilyHandle,
|
|
1520
|
+
final byte[] key, final byte[] value) throws RocksDBException {
|
|
1521
|
+
merge(nativeHandle_, key, 0, key.length, value, 0, value.length,
|
|
1522
|
+
columnFamilyHandle.nativeHandle_);
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Add merge operand for key/value pair in a ColumnFamily.
|
|
1527
|
+
*
|
|
1528
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
1529
|
+
* @param key the specified key to be merged.
|
|
1530
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1531
|
+
* non-negative and no larger than "key".length
|
|
1532
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1533
|
+
* and no larger than ("key".length - offset)
|
|
1534
|
+
* @param value the value to be merged with the current value for
|
|
1535
|
+
* the specified key.
|
|
1536
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1537
|
+
* non-negative and no longer than "key".length
|
|
1538
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1539
|
+
* must be non-negative and no larger than ("value".length - offset)
|
|
1540
|
+
*
|
|
1541
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1542
|
+
* native library.
|
|
1543
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
1544
|
+
*/
|
|
1545
|
+
public void merge(final ColumnFamilyHandle columnFamilyHandle,
|
|
1546
|
+
final byte[] key, final int offset, final int len, final byte[] value,
|
|
1547
|
+
final int vOffset, final int vLen) throws RocksDBException {
|
|
1548
|
+
checkBounds(offset, len, key.length);
|
|
1549
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1550
|
+
merge(nativeHandle_, key, offset, len, value, vOffset, vLen,
|
|
1551
|
+
columnFamilyHandle.nativeHandle_);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
/**
|
|
1555
|
+
* Add merge operand for key/value pair.
|
|
1556
|
+
*
|
|
1557
|
+
* @param writeOpts {@link WriteOptions} for this write.
|
|
1558
|
+
* @param key the specified key to be merged.
|
|
1559
|
+
* @param value the value to be merged with the current value for
|
|
1560
|
+
* the specified key.
|
|
1561
|
+
*
|
|
1562
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1563
|
+
* native library.
|
|
1564
|
+
*/
|
|
1565
|
+
public void merge(final WriteOptions writeOpts, final byte[] key,
|
|
1566
|
+
final byte[] value) throws RocksDBException {
|
|
1567
|
+
merge(nativeHandle_, writeOpts.nativeHandle_,
|
|
1568
|
+
key, 0, key.length, value, 0, value.length);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* Add merge operand for key/value pair.
|
|
1573
|
+
*
|
|
1574
|
+
* @param writeOpts {@link WriteOptions} for this write.
|
|
1575
|
+
* @param key the specified key to be merged.
|
|
1576
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1577
|
+
* non-negative and no larger than "key".length
|
|
1578
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1579
|
+
* and no larger than ("value".length - offset)
|
|
1580
|
+
* @param value the value to be merged with the current value for
|
|
1581
|
+
* the specified key.
|
|
1582
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1583
|
+
* non-negative and no longer than "key".length
|
|
1584
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1585
|
+
* non-negative and no larger than ("value".length - offset)
|
|
1586
|
+
*
|
|
1587
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1588
|
+
* native library.
|
|
1589
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
1590
|
+
*/
|
|
1591
|
+
public void merge(final WriteOptions writeOpts,
|
|
1592
|
+
final byte[] key, final int offset, final int len,
|
|
1593
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
1594
|
+
throws RocksDBException {
|
|
1595
|
+
checkBounds(offset, len, key.length);
|
|
1596
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1597
|
+
merge(nativeHandle_, writeOpts.nativeHandle_,
|
|
1598
|
+
key, offset, len, value, vOffset, vLen);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1603
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1604
|
+
* did not exist in the database.
|
|
1605
|
+
*
|
|
1606
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1607
|
+
* @param key Key to delete within database. It is using position and limit.
|
|
1608
|
+
* Supports direct buffer only.
|
|
1609
|
+
*
|
|
1610
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1611
|
+
* native library.
|
|
1612
|
+
*/
|
|
1613
|
+
public void delete(final WriteOptions writeOpt, final ByteBuffer key) throws RocksDBException {
|
|
1614
|
+
assert key.isDirect();
|
|
1615
|
+
deleteDirect(nativeHandle_, writeOpt.nativeHandle_, key, key.position(), key.remaining(), 0);
|
|
1616
|
+
key.position(key.limit());
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* Delete the database entry (if any) for "key". Returns OK on
|
|
1621
|
+
* success, and a non-OK status on error. It is not an error if "key"
|
|
1622
|
+
* did not exist in the database.
|
|
1623
|
+
*
|
|
1624
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1625
|
+
* instance
|
|
1626
|
+
* @param writeOpt WriteOptions to be used with delete operation
|
|
1627
|
+
* @param key Key to delete within database. It is using position and limit.
|
|
1628
|
+
* Supports direct buffer only.
|
|
1629
|
+
*
|
|
1630
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1631
|
+
* native library.
|
|
1632
|
+
*/
|
|
1633
|
+
public void delete(final ColumnFamilyHandle columnFamilyHandle, final WriteOptions writeOpt,
|
|
1634
|
+
final ByteBuffer key) throws RocksDBException {
|
|
1635
|
+
assert key.isDirect();
|
|
1636
|
+
deleteDirect(nativeHandle_, writeOpt.nativeHandle_, key, key.position(), key.remaining(),
|
|
1637
|
+
columnFamilyHandle.nativeHandle_);
|
|
1638
|
+
key.position(key.limit());
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Add merge operand for key/value pair.
|
|
1643
|
+
*
|
|
1644
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
1645
|
+
* @param writeOpts {@link WriteOptions} for this write.
|
|
1646
|
+
* @param key the specified key to be merged.
|
|
1647
|
+
* @param value the value to be merged with the current value for the
|
|
1648
|
+
* specified key.
|
|
1649
|
+
*
|
|
1650
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1651
|
+
* native library.
|
|
1652
|
+
*/
|
|
1653
|
+
public void merge(final ColumnFamilyHandle columnFamilyHandle,
|
|
1654
|
+
final WriteOptions writeOpts, final byte[] key, final byte[] value)
|
|
1655
|
+
throws RocksDBException {
|
|
1656
|
+
merge(nativeHandle_, writeOpts.nativeHandle_,
|
|
1657
|
+
key, 0, key.length, value, 0, value.length,
|
|
1658
|
+
columnFamilyHandle.nativeHandle_);
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* Add merge operand for key/value pair.
|
|
1663
|
+
*
|
|
1664
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
1665
|
+
* @param writeOpts {@link WriteOptions} for this write.
|
|
1666
|
+
* @param key the specified key to be merged.
|
|
1667
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1668
|
+
* non-negative and no larger than "key".length
|
|
1669
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1670
|
+
* and no larger than ("key".length - offset)
|
|
1671
|
+
* @param value the value to be merged with the current value for
|
|
1672
|
+
* the specified key.
|
|
1673
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1674
|
+
* non-negative and no longer than "key".length
|
|
1675
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1676
|
+
* non-negative and no larger than ("value".length - offset)
|
|
1677
|
+
*
|
|
1678
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1679
|
+
* native library.
|
|
1680
|
+
* @throws IndexOutOfBoundsException if an offset or length is out of bounds
|
|
1681
|
+
*/
|
|
1682
|
+
public void merge(
|
|
1683
|
+
final ColumnFamilyHandle columnFamilyHandle, final WriteOptions writeOpts,
|
|
1684
|
+
final byte[] key, final int offset, final int len,
|
|
1685
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
1686
|
+
throws RocksDBException {
|
|
1687
|
+
checkBounds(offset, len, key.length);
|
|
1688
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1689
|
+
merge(nativeHandle_, writeOpts.nativeHandle_,
|
|
1690
|
+
key, offset, len, value, vOffset, vLen,
|
|
1691
|
+
columnFamilyHandle.nativeHandle_);
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Apply the specified updates to the database.
|
|
1696
|
+
*
|
|
1697
|
+
* @param writeOpts WriteOptions instance
|
|
1698
|
+
* @param updates WriteBatch instance
|
|
1699
|
+
*
|
|
1700
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1701
|
+
* native library.
|
|
1702
|
+
*/
|
|
1703
|
+
public void write(final WriteOptions writeOpts, final WriteBatch updates)
|
|
1704
|
+
throws RocksDBException {
|
|
1705
|
+
write0(nativeHandle_, writeOpts.nativeHandle_, updates.nativeHandle_);
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Apply the specified updates to the database.
|
|
1710
|
+
*
|
|
1711
|
+
* @param writeOpts WriteOptions instance
|
|
1712
|
+
* @param updates WriteBatchWithIndex instance
|
|
1713
|
+
*
|
|
1714
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1715
|
+
* native library.
|
|
1716
|
+
*/
|
|
1717
|
+
public void write(final WriteOptions writeOpts,
|
|
1718
|
+
final WriteBatchWithIndex updates) throws RocksDBException {
|
|
1719
|
+
write1(nativeHandle_, writeOpts.nativeHandle_, updates.nativeHandle_);
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
// TODO(AR) we should improve the #get() API, returning -1 (RocksDB.NOT_FOUND) is not very nice
|
|
1723
|
+
// when we could communicate better status into, also the C++ code show that -2 could be returned
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* Get the value associated with the specified key within column family*
|
|
1727
|
+
*
|
|
1728
|
+
* @param key the key to retrieve the value.
|
|
1729
|
+
* @param value the out-value to receive the retrieved value.
|
|
1730
|
+
*
|
|
1731
|
+
* @return The size of the actual value that matches the specified
|
|
1732
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1733
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1734
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1735
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1736
|
+
* found.
|
|
1737
|
+
*
|
|
1738
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1739
|
+
* native library.
|
|
1740
|
+
*/
|
|
1741
|
+
public int get(final byte[] key, final byte[] value) throws RocksDBException {
|
|
1742
|
+
return get(nativeHandle_, key, 0, key.length, value, 0, value.length);
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1745
|
+
/**
|
|
1746
|
+
* Get the value associated with the specified key within column family*
|
|
1747
|
+
*
|
|
1748
|
+
* @param key the key to retrieve the value.
|
|
1749
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1750
|
+
* non-negative and no larger than "key".length
|
|
1751
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1752
|
+
* and no larger than ("key".length - offset)
|
|
1753
|
+
* @param value the out-value to receive the retrieved value.
|
|
1754
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1755
|
+
* non-negative and no longer than "value".length
|
|
1756
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1757
|
+
* non-negative and and no larger than ("value".length - offset)
|
|
1758
|
+
*
|
|
1759
|
+
* @return The size of the actual value that matches the specified
|
|
1760
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1761
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1762
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1763
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1764
|
+
* found.
|
|
1765
|
+
*
|
|
1766
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1767
|
+
* native library.
|
|
1768
|
+
*/
|
|
1769
|
+
public int get(final byte[] key, final int offset, final int len,
|
|
1770
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
1771
|
+
throws RocksDBException {
|
|
1772
|
+
checkBounds(offset, len, key.length);
|
|
1773
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1774
|
+
return get(nativeHandle_, key, offset, len, value, vOffset, vLen);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Get the value associated with the specified key within column family.
|
|
1779
|
+
*
|
|
1780
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1781
|
+
* instance
|
|
1782
|
+
* @param key the key to retrieve the value.
|
|
1783
|
+
* @param value the out-value to receive the retrieved value.
|
|
1784
|
+
* @return The size of the actual value that matches the specified
|
|
1785
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1786
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1787
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1788
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1789
|
+
* found.
|
|
1790
|
+
*
|
|
1791
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1792
|
+
* native library.
|
|
1793
|
+
*/
|
|
1794
|
+
public int get(final ColumnFamilyHandle columnFamilyHandle, final byte[] key,
|
|
1795
|
+
final byte[] value) throws RocksDBException, IllegalArgumentException {
|
|
1796
|
+
return get(nativeHandle_, key, 0, key.length, value, 0, value.length,
|
|
1797
|
+
columnFamilyHandle.nativeHandle_);
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
/**
|
|
1801
|
+
* Get the value associated with the specified key within column family.
|
|
1802
|
+
*
|
|
1803
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1804
|
+
* instance
|
|
1805
|
+
* @param key the key to retrieve the value.
|
|
1806
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1807
|
+
* non-negative and no larger than "key".length
|
|
1808
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1809
|
+
* an no larger than ("key".length - offset)
|
|
1810
|
+
* @param value the out-value to receive the retrieved value.
|
|
1811
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1812
|
+
* non-negative and no longer than "key".length
|
|
1813
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1814
|
+
* non-negative and no larger than ("value".length - offset)
|
|
1815
|
+
*
|
|
1816
|
+
* @return The size of the actual value that matches the specified
|
|
1817
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1818
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1819
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1820
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1821
|
+
* found.
|
|
1822
|
+
*
|
|
1823
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1824
|
+
* native library.
|
|
1825
|
+
*/
|
|
1826
|
+
public int get(final ColumnFamilyHandle columnFamilyHandle, final byte[] key,
|
|
1827
|
+
final int offset, final int len, final byte[] value, final int vOffset,
|
|
1828
|
+
final int vLen) throws RocksDBException, IllegalArgumentException {
|
|
1829
|
+
checkBounds(offset, len, key.length);
|
|
1830
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1831
|
+
return get(nativeHandle_, key, offset, len, value, vOffset, vLen,
|
|
1832
|
+
columnFamilyHandle.nativeHandle_);
|
|
1833
|
+
}
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* Get the value associated with the specified key.
|
|
1837
|
+
*
|
|
1838
|
+
* @param opt {@link org.rocksdb.ReadOptions} instance.
|
|
1839
|
+
* @param key the key to retrieve the value.
|
|
1840
|
+
* @param value the out-value to receive the retrieved value.
|
|
1841
|
+
* @return The size of the actual value that matches the specified
|
|
1842
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1843
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1844
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1845
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1846
|
+
* found.
|
|
1847
|
+
*
|
|
1848
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1849
|
+
* native library.
|
|
1850
|
+
*/
|
|
1851
|
+
public int get(final ReadOptions opt, final byte[] key,
|
|
1852
|
+
final byte[] value) throws RocksDBException {
|
|
1853
|
+
return get(nativeHandle_, opt.nativeHandle_,
|
|
1854
|
+
key, 0, key.length, value, 0, value.length);
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
/**
|
|
1858
|
+
* Get the value associated with the specified key.
|
|
1859
|
+
*
|
|
1860
|
+
* @param opt {@link org.rocksdb.ReadOptions} instance.
|
|
1861
|
+
* @param key the key to retrieve the value.
|
|
1862
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1863
|
+
* non-negative and no larger than "key".length
|
|
1864
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1865
|
+
* and no larger than ("key".length - offset)
|
|
1866
|
+
* @param value the out-value to receive the retrieved value.
|
|
1867
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1868
|
+
* non-negative and no longer than "key".length
|
|
1869
|
+
* @param vLen the length of the "value" array to be used, must be
|
|
1870
|
+
* non-negative and no larger than ("value".length - offset)
|
|
1871
|
+
* @return The size of the actual value that matches the specified
|
|
1872
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1873
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1874
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1875
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1876
|
+
* found.
|
|
1877
|
+
*
|
|
1878
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1879
|
+
* native library.
|
|
1880
|
+
*/
|
|
1881
|
+
public int get(final ReadOptions opt, final byte[] key, final int offset,
|
|
1882
|
+
final int len, final byte[] value, final int vOffset, final int vLen)
|
|
1883
|
+
throws RocksDBException {
|
|
1884
|
+
checkBounds(offset, len, key.length);
|
|
1885
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1886
|
+
return get(nativeHandle_, opt.nativeHandle_,
|
|
1887
|
+
key, offset, len, value, vOffset, vLen);
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* Get the value associated with the specified key within column family.
|
|
1892
|
+
*
|
|
1893
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1894
|
+
* instance
|
|
1895
|
+
* @param opt {@link org.rocksdb.ReadOptions} instance.
|
|
1896
|
+
* @param key the key to retrieve the value.
|
|
1897
|
+
* @param value the out-value to receive the retrieved value.
|
|
1898
|
+
* @return The size of the actual value that matches the specified
|
|
1899
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1900
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1901
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1902
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1903
|
+
* found.
|
|
1904
|
+
*
|
|
1905
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1906
|
+
* native library.
|
|
1907
|
+
*/
|
|
1908
|
+
public int get(final ColumnFamilyHandle columnFamilyHandle,
|
|
1909
|
+
final ReadOptions opt, final byte[] key, final byte[] value)
|
|
1910
|
+
throws RocksDBException {
|
|
1911
|
+
return get(nativeHandle_, opt.nativeHandle_, key, 0, key.length, value,
|
|
1912
|
+
0, value.length, columnFamilyHandle.nativeHandle_);
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
/**
|
|
1916
|
+
* Get the value associated with the specified key within column family.
|
|
1917
|
+
*
|
|
1918
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1919
|
+
* instance
|
|
1920
|
+
* @param opt {@link org.rocksdb.ReadOptions} instance.
|
|
1921
|
+
* @param key the key to retrieve the value.
|
|
1922
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1923
|
+
* non-negative and no larger than "key".length
|
|
1924
|
+
* @param len the length of the "key" array to be used, must be
|
|
1925
|
+
* non-negative and and no larger than ("key".length - offset)
|
|
1926
|
+
* @param value the out-value to receive the retrieved value.
|
|
1927
|
+
* @param vOffset the offset of the "value" array to be used, must be
|
|
1928
|
+
* non-negative and no longer than "key".length
|
|
1929
|
+
* @param vLen the length of the "value" array to be used, and must be
|
|
1930
|
+
* non-negative and no larger than ("value".length - offset)
|
|
1931
|
+
* @return The size of the actual value that matches the specified
|
|
1932
|
+
* {@code key} in byte. If the return value is greater than the
|
|
1933
|
+
* length of {@code value}, then it indicates that the size of the
|
|
1934
|
+
* input buffer {@code value} is insufficient and partial result will
|
|
1935
|
+
* be returned. RocksDB.NOT_FOUND will be returned if the value not
|
|
1936
|
+
* found.
|
|
1937
|
+
*
|
|
1938
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1939
|
+
* native library.
|
|
1940
|
+
*/
|
|
1941
|
+
public int get(final ColumnFamilyHandle columnFamilyHandle,
|
|
1942
|
+
final ReadOptions opt, final byte[] key, final int offset, final int len,
|
|
1943
|
+
final byte[] value, final int vOffset, final int vLen)
|
|
1944
|
+
throws RocksDBException {
|
|
1945
|
+
checkBounds(offset, len, key.length);
|
|
1946
|
+
checkBounds(vOffset, vLen, value.length);
|
|
1947
|
+
return get(nativeHandle_, opt.nativeHandle_, key, offset, len, value,
|
|
1948
|
+
vOffset, vLen, columnFamilyHandle.nativeHandle_);
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
/**
|
|
1952
|
+
* The simplified version of get which returns a new byte array storing
|
|
1953
|
+
* the value associated with the specified input key if any. null will be
|
|
1954
|
+
* returned if the specified key is not found.
|
|
1955
|
+
*
|
|
1956
|
+
* @param key the key retrieve the value.
|
|
1957
|
+
* @return a byte array storing the value associated with the input key if
|
|
1958
|
+
* any. null if it does not find the specified key.
|
|
1959
|
+
*
|
|
1960
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1961
|
+
* native library.
|
|
1962
|
+
*/
|
|
1963
|
+
public byte[] get(final byte[] key) throws RocksDBException {
|
|
1964
|
+
return get(nativeHandle_, key, 0, key.length);
|
|
1965
|
+
}
|
|
1966
|
+
|
|
1967
|
+
/**
|
|
1968
|
+
* The simplified version of get which returns a new byte array storing
|
|
1969
|
+
* the value associated with the specified input key if any. null will be
|
|
1970
|
+
* returned if the specified key is not found.
|
|
1971
|
+
*
|
|
1972
|
+
* @param key the key retrieve the value.
|
|
1973
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
1974
|
+
* non-negative and no larger than "key".length
|
|
1975
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
1976
|
+
* and no larger than ("key".length - offset)
|
|
1977
|
+
* @return a byte array storing the value associated with the input key if
|
|
1978
|
+
* any. null if it does not find the specified key.
|
|
1979
|
+
*
|
|
1980
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
1981
|
+
* native library.
|
|
1982
|
+
*/
|
|
1983
|
+
public byte[] get(final byte[] key, final int offset,
|
|
1984
|
+
final int len) throws RocksDBException {
|
|
1985
|
+
checkBounds(offset, len, key.length);
|
|
1986
|
+
return get(nativeHandle_, key, offset, len);
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
/**
|
|
1990
|
+
* The simplified version of get which returns a new byte array storing
|
|
1991
|
+
* the value associated with the specified input key if any. null will be
|
|
1992
|
+
* returned if the specified key is not found.
|
|
1993
|
+
*
|
|
1994
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
1995
|
+
* instance
|
|
1996
|
+
* @param key the key retrieve the value.
|
|
1997
|
+
* @return a byte array storing the value associated with the input key if
|
|
1998
|
+
* any. null if it does not find the specified key.
|
|
1999
|
+
*
|
|
2000
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2001
|
+
* native library.
|
|
2002
|
+
*/
|
|
2003
|
+
public byte[] get(final ColumnFamilyHandle columnFamilyHandle,
|
|
2004
|
+
final byte[] key) throws RocksDBException {
|
|
2005
|
+
return get(nativeHandle_, key, 0, key.length,
|
|
2006
|
+
columnFamilyHandle.nativeHandle_);
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* The simplified version of get which returns a new byte array storing
|
|
2011
|
+
* the value associated with the specified input key if any. null will be
|
|
2012
|
+
* returned if the specified key is not found.
|
|
2013
|
+
*
|
|
2014
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
2015
|
+
* instance
|
|
2016
|
+
* @param key the key retrieve the value.
|
|
2017
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2018
|
+
* non-negative and no larger than "key".length
|
|
2019
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2020
|
+
* and no larger than ("key".length - offset)
|
|
2021
|
+
* @return a byte array storing the value associated with the input key if
|
|
2022
|
+
* any. null if it does not find the specified key.
|
|
2023
|
+
*
|
|
2024
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2025
|
+
* native library.
|
|
2026
|
+
*/
|
|
2027
|
+
public byte[] get(final ColumnFamilyHandle columnFamilyHandle,
|
|
2028
|
+
final byte[] key, final int offset, final int len)
|
|
2029
|
+
throws RocksDBException {
|
|
2030
|
+
checkBounds(offset, len, key.length);
|
|
2031
|
+
return get(nativeHandle_, key, offset, len,
|
|
2032
|
+
columnFamilyHandle.nativeHandle_);
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
/**
|
|
2036
|
+
* The simplified version of get which returns a new byte array storing
|
|
2037
|
+
* the value associated with the specified input key if any. null will be
|
|
2038
|
+
* returned if the specified key is not found.
|
|
2039
|
+
*
|
|
2040
|
+
* @param key the key retrieve the value.
|
|
2041
|
+
* @param opt Read options.
|
|
2042
|
+
* @return a byte array storing the value associated with the input key if
|
|
2043
|
+
* any. null if it does not find the specified key.
|
|
2044
|
+
*
|
|
2045
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2046
|
+
* native library.
|
|
2047
|
+
*/
|
|
2048
|
+
public byte[] get(final ReadOptions opt, final byte[] key)
|
|
2049
|
+
throws RocksDBException {
|
|
2050
|
+
return get(nativeHandle_, opt.nativeHandle_, key, 0, key.length);
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
/**
|
|
2054
|
+
* The simplified version of get which returns a new byte array storing
|
|
2055
|
+
* the value associated with the specified input key if any. null will be
|
|
2056
|
+
* returned if the specified key is not found.
|
|
2057
|
+
*
|
|
2058
|
+
* @param key the key retrieve the value.
|
|
2059
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2060
|
+
* non-negative and no larger than "key".length
|
|
2061
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2062
|
+
* and no larger than ("key".length - offset)
|
|
2063
|
+
* @param opt Read options.
|
|
2064
|
+
* @return a byte array storing the value associated with the input key if
|
|
2065
|
+
* any. null if it does not find the specified key.
|
|
2066
|
+
*
|
|
2067
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2068
|
+
* native library.
|
|
2069
|
+
*/
|
|
2070
|
+
public byte[] get(final ReadOptions opt, final byte[] key, final int offset,
|
|
2071
|
+
final int len) throws RocksDBException {
|
|
2072
|
+
checkBounds(offset, len, key.length);
|
|
2073
|
+
return get(nativeHandle_, opt.nativeHandle_, key, offset, len);
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
/**
|
|
2077
|
+
* The simplified version of get which returns a new byte array storing
|
|
2078
|
+
* the value associated with the specified input key if any. null will be
|
|
2079
|
+
* returned if the specified key is not found.
|
|
2080
|
+
*
|
|
2081
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
2082
|
+
* instance
|
|
2083
|
+
* @param key the key retrieve the value.
|
|
2084
|
+
* @param opt Read options.
|
|
2085
|
+
* @return a byte array storing the value associated with the input key if
|
|
2086
|
+
* any. null if it does not find the specified key.
|
|
2087
|
+
*
|
|
2088
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2089
|
+
* native library.
|
|
2090
|
+
*/
|
|
2091
|
+
public byte[] get(final ColumnFamilyHandle columnFamilyHandle,
|
|
2092
|
+
final ReadOptions opt, final byte[] key) throws RocksDBException {
|
|
2093
|
+
return get(nativeHandle_, opt.nativeHandle_, key, 0, key.length,
|
|
2094
|
+
columnFamilyHandle.nativeHandle_);
|
|
2095
|
+
}
|
|
2096
|
+
|
|
2097
|
+
/**
|
|
2098
|
+
* The simplified version of get which returns a new byte array storing
|
|
2099
|
+
* the value associated with the specified input key if any. null will be
|
|
2100
|
+
* returned if the specified key is not found.
|
|
2101
|
+
*
|
|
2102
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
2103
|
+
* instance
|
|
2104
|
+
* @param key the key retrieve the value.
|
|
2105
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2106
|
+
* non-negative and no larger than "key".length
|
|
2107
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2108
|
+
* and no larger than ("key".length - offset)
|
|
2109
|
+
* @param opt Read options.
|
|
2110
|
+
* @return a byte array storing the value associated with the input key if
|
|
2111
|
+
* any. null if it does not find the specified key.
|
|
2112
|
+
*
|
|
2113
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2114
|
+
* native library.
|
|
2115
|
+
*/
|
|
2116
|
+
public byte[] get(final ColumnFamilyHandle columnFamilyHandle,
|
|
2117
|
+
final ReadOptions opt, final byte[] key, final int offset, final int len)
|
|
2118
|
+
throws RocksDBException {
|
|
2119
|
+
checkBounds(offset, len, key.length);
|
|
2120
|
+
return get(nativeHandle_, opt.nativeHandle_, key, offset, len,
|
|
2121
|
+
columnFamilyHandle.nativeHandle_);
|
|
2122
|
+
}
|
|
2123
|
+
|
|
2124
|
+
/**
|
|
2125
|
+
* Takes a list of keys, and returns a list of values for the given list of
|
|
2126
|
+
* keys. List will contain null for keys which could not be found.
|
|
2127
|
+
*
|
|
2128
|
+
* @param keys List of keys for which values need to be retrieved.
|
|
2129
|
+
* @return List of values for the given list of keys. List will contain
|
|
2130
|
+
* null for keys which could not be found.
|
|
2131
|
+
*
|
|
2132
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2133
|
+
* native library.
|
|
2134
|
+
*/
|
|
2135
|
+
public List<byte[]> multiGetAsList(final List<byte[]> keys)
|
|
2136
|
+
throws RocksDBException {
|
|
2137
|
+
assert(keys.size() != 0);
|
|
2138
|
+
|
|
2139
|
+
final byte[][] keysArray = keys.toArray(new byte[keys.size()][]);
|
|
2140
|
+
final int[] keyOffsets = new int[keysArray.length];
|
|
2141
|
+
final int[] keyLengths = new int[keysArray.length];
|
|
2142
|
+
for(int i = 0; i < keyLengths.length; i++) {
|
|
2143
|
+
keyLengths[i] = keysArray[i].length;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
return Arrays.asList(multiGet(nativeHandle_, keysArray, keyOffsets,
|
|
2147
|
+
keyLengths));
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* Returns a list of values for the given list of keys. List will contain
|
|
2152
|
+
* null for keys which could not be found.
|
|
2153
|
+
* <p>
|
|
2154
|
+
* Note: Every key needs to have a related column family name in
|
|
2155
|
+
* {@code columnFamilyHandleList}.
|
|
2156
|
+
* </p>
|
|
2157
|
+
*
|
|
2158
|
+
* @param columnFamilyHandleList {@link java.util.List} containing
|
|
2159
|
+
* {@link org.rocksdb.ColumnFamilyHandle} instances.
|
|
2160
|
+
* @param keys List of keys for which values need to be retrieved.
|
|
2161
|
+
* @return List of values for the given list of keys. List will contain
|
|
2162
|
+
* null for keys which could not be found.
|
|
2163
|
+
*
|
|
2164
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2165
|
+
* native library.
|
|
2166
|
+
* @throws IllegalArgumentException thrown if the size of passed keys is not
|
|
2167
|
+
* equal to the amount of passed column family handles.
|
|
2168
|
+
*/
|
|
2169
|
+
public List<byte[]> multiGetAsList(
|
|
2170
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList,
|
|
2171
|
+
final List<byte[]> keys) throws RocksDBException,
|
|
2172
|
+
IllegalArgumentException {
|
|
2173
|
+
assert(keys.size() != 0);
|
|
2174
|
+
// Check if key size equals cfList size. If not a exception must be
|
|
2175
|
+
// thrown. If not a Segmentation fault happens.
|
|
2176
|
+
if (keys.size() != columnFamilyHandleList.size()) {
|
|
2177
|
+
throw new IllegalArgumentException(
|
|
2178
|
+
"For each key there must be a ColumnFamilyHandle.");
|
|
2179
|
+
}
|
|
2180
|
+
final long[] cfHandles = new long[columnFamilyHandleList.size()];
|
|
2181
|
+
for (int i = 0; i < columnFamilyHandleList.size(); i++) {
|
|
2182
|
+
cfHandles[i] = columnFamilyHandleList.get(i).nativeHandle_;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
final byte[][] keysArray = keys.toArray(new byte[keys.size()][]);
|
|
2186
|
+
final int[] keyOffsets = new int[keysArray.length];
|
|
2187
|
+
final int[] keyLengths = new int[keysArray.length];
|
|
2188
|
+
for(int i = 0; i < keyLengths.length; i++) {
|
|
2189
|
+
keyLengths[i] = keysArray[i].length;
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
return Arrays.asList(multiGet(nativeHandle_, keysArray, keyOffsets,
|
|
2193
|
+
keyLengths, cfHandles));
|
|
2194
|
+
}
|
|
2195
|
+
|
|
2196
|
+
/**
|
|
2197
|
+
* Returns a list of values for the given list of keys. List will contain
|
|
2198
|
+
* null for keys which could not be found.
|
|
2199
|
+
*
|
|
2200
|
+
* @param opt Read options.
|
|
2201
|
+
* @param keys of keys for which values need to be retrieved.
|
|
2202
|
+
* @return List of values for the given list of keys. List will contain
|
|
2203
|
+
* null for keys which could not be found.
|
|
2204
|
+
*
|
|
2205
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2206
|
+
* native library.
|
|
2207
|
+
*/
|
|
2208
|
+
public List<byte[]> multiGetAsList(final ReadOptions opt,
|
|
2209
|
+
final List<byte[]> keys) throws RocksDBException {
|
|
2210
|
+
assert(keys.size() != 0);
|
|
2211
|
+
|
|
2212
|
+
final byte[][] keysArray = keys.toArray(new byte[keys.size()][]);
|
|
2213
|
+
final int[] keyOffsets = new int[keysArray.length];
|
|
2214
|
+
final int[] keyLengths = new int[keysArray.length];
|
|
2215
|
+
for(int i = 0; i < keyLengths.length; i++) {
|
|
2216
|
+
keyLengths[i] = keysArray[i].length;
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
return Arrays.asList(multiGet(nativeHandle_, opt.nativeHandle_,
|
|
2220
|
+
keysArray, keyOffsets, keyLengths));
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
/**
|
|
2224
|
+
* Returns a list of values for the given list of keys. List will contain
|
|
2225
|
+
* null for keys which could not be found.
|
|
2226
|
+
* <p>
|
|
2227
|
+
* Note: Every key needs to have a related column family name in
|
|
2228
|
+
* {@code columnFamilyHandleList}.
|
|
2229
|
+
* </p>
|
|
2230
|
+
*
|
|
2231
|
+
* @param opt Read options.
|
|
2232
|
+
* @param columnFamilyHandleList {@link java.util.List} containing
|
|
2233
|
+
* {@link org.rocksdb.ColumnFamilyHandle} instances.
|
|
2234
|
+
* @param keys of keys for which values need to be retrieved.
|
|
2235
|
+
* @return List of values for the given list of keys. List will contain
|
|
2236
|
+
* null for keys which could not be found.
|
|
2237
|
+
*
|
|
2238
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2239
|
+
* native library.
|
|
2240
|
+
* @throws IllegalArgumentException thrown if the size of passed keys is not
|
|
2241
|
+
* equal to the amount of passed column family handles.
|
|
2242
|
+
*/
|
|
2243
|
+
public List<byte[]> multiGetAsList(final ReadOptions opt,
|
|
2244
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList,
|
|
2245
|
+
final List<byte[]> keys) throws RocksDBException {
|
|
2246
|
+
assert(keys.size() != 0);
|
|
2247
|
+
// Check if key size equals cfList size. If not a exception must be
|
|
2248
|
+
// thrown. If not a Segmentation fault happens.
|
|
2249
|
+
if (keys.size()!=columnFamilyHandleList.size()){
|
|
2250
|
+
throw new IllegalArgumentException(
|
|
2251
|
+
"For each key there must be a ColumnFamilyHandle.");
|
|
2252
|
+
}
|
|
2253
|
+
final long[] cfHandles = new long[columnFamilyHandleList.size()];
|
|
2254
|
+
for (int i = 0; i < columnFamilyHandleList.size(); i++) {
|
|
2255
|
+
cfHandles[i] = columnFamilyHandleList.get(i).nativeHandle_;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
final byte[][] keysArray = keys.toArray(new byte[keys.size()][]);
|
|
2259
|
+
final int[] keyOffsets = new int[keysArray.length];
|
|
2260
|
+
final int[] keyLengths = new int[keysArray.length];
|
|
2261
|
+
for(int i = 0; i < keyLengths.length; i++) {
|
|
2262
|
+
keyLengths[i] = keysArray[i].length;
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
return Arrays.asList(multiGet(nativeHandle_, opt.nativeHandle_,
|
|
2266
|
+
keysArray, keyOffsets, keyLengths, cfHandles));
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
/**
|
|
2270
|
+
* Fetches a list of values for the given list of keys, all from the default column family.
|
|
2271
|
+
*
|
|
2272
|
+
* @param keys list of keys for which values need to be retrieved.
|
|
2273
|
+
* @param values list of buffers to return retrieved values in
|
|
2274
|
+
* @return list of number of bytes in DB for each requested key
|
|
2275
|
+
* this can be more than the size of the corresponding buffer; then the buffer will be filled
|
|
2276
|
+
* with the appropriate truncation of the database value.
|
|
2277
|
+
* @throws RocksDBException if error happens in underlying native library.
|
|
2278
|
+
* @throws IllegalArgumentException thrown if the number of passed keys and passed values
|
|
2279
|
+
* do not match.
|
|
2280
|
+
*/
|
|
2281
|
+
public List<ByteBufferGetStatus> multiGetByteBuffers(
|
|
2282
|
+
final List<ByteBuffer> keys, final List<ByteBuffer> values) throws RocksDBException {
|
|
2283
|
+
final ReadOptions readOptions = new ReadOptions();
|
|
2284
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList = new ArrayList<>(1);
|
|
2285
|
+
columnFamilyHandleList.add(getDefaultColumnFamily());
|
|
2286
|
+
return multiGetByteBuffers(readOptions, columnFamilyHandleList, keys, values);
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
/**
|
|
2290
|
+
* Fetches a list of values for the given list of keys, all from the default column family.
|
|
2291
|
+
*
|
|
2292
|
+
* @param readOptions Read options
|
|
2293
|
+
* @param keys list of keys for which values need to be retrieved.
|
|
2294
|
+
* @param values list of buffers to return retrieved values in
|
|
2295
|
+
* @throws RocksDBException if error happens in underlying native library.
|
|
2296
|
+
* @throws IllegalArgumentException thrown if the number of passed keys and passed values
|
|
2297
|
+
* do not match.
|
|
2298
|
+
* @return the list of values for the given list of keys
|
|
2299
|
+
*/
|
|
2300
|
+
public List<ByteBufferGetStatus> multiGetByteBuffers(final ReadOptions readOptions,
|
|
2301
|
+
final List<ByteBuffer> keys, final List<ByteBuffer> values) throws RocksDBException {
|
|
2302
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList = new ArrayList<>(1);
|
|
2303
|
+
columnFamilyHandleList.add(getDefaultColumnFamily());
|
|
2304
|
+
return multiGetByteBuffers(readOptions, columnFamilyHandleList, keys, values);
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* Fetches a list of values for the given list of keys.
|
|
2309
|
+
* <p>
|
|
2310
|
+
* Note: Every key needs to have a related column family name in
|
|
2311
|
+
* {@code columnFamilyHandleList}.
|
|
2312
|
+
* </p>
|
|
2313
|
+
*
|
|
2314
|
+
* @param columnFamilyHandleList {@link java.util.List} containing
|
|
2315
|
+
* {@link org.rocksdb.ColumnFamilyHandle} instances.
|
|
2316
|
+
* @param keys list of keys for which values need to be retrieved.
|
|
2317
|
+
* @param values list of buffers to return retrieved values in
|
|
2318
|
+
* @throws RocksDBException if error happens in underlying native library.
|
|
2319
|
+
* @throws IllegalArgumentException thrown if the number of passed keys, passed values and
|
|
2320
|
+
* passed column family handles do not match.
|
|
2321
|
+
* @return the list of values for the given list of keys
|
|
2322
|
+
*/
|
|
2323
|
+
public List<ByteBufferGetStatus> multiGetByteBuffers(
|
|
2324
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList, final List<ByteBuffer> keys,
|
|
2325
|
+
final List<ByteBuffer> values) throws RocksDBException {
|
|
2326
|
+
final ReadOptions readOptions = new ReadOptions();
|
|
2327
|
+
return multiGetByteBuffers(readOptions, columnFamilyHandleList, keys, values);
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
/**
|
|
2331
|
+
* Fetches a list of values for the given list of keys.
|
|
2332
|
+
* <p>
|
|
2333
|
+
* Note: Every key needs to have a related column family name in
|
|
2334
|
+
* {@code columnFamilyHandleList}.
|
|
2335
|
+
* </p>
|
|
2336
|
+
*
|
|
2337
|
+
* @param readOptions Read options
|
|
2338
|
+
* @param columnFamilyHandleList {@link java.util.List} containing
|
|
2339
|
+
* {@link org.rocksdb.ColumnFamilyHandle} instances.
|
|
2340
|
+
* @param keys list of keys for which values need to be retrieved.
|
|
2341
|
+
* @param values list of buffers to return retrieved values in
|
|
2342
|
+
* @throws RocksDBException if error happens in underlying native library.
|
|
2343
|
+
* @throws IllegalArgumentException thrown if the number of passed keys, passed values and
|
|
2344
|
+
* passed column family handles do not match.
|
|
2345
|
+
* @return the list of values for the given list of keys
|
|
2346
|
+
*/
|
|
2347
|
+
public List<ByteBufferGetStatus> multiGetByteBuffers(final ReadOptions readOptions,
|
|
2348
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList, final List<ByteBuffer> keys,
|
|
2349
|
+
final List<ByteBuffer> values) throws RocksDBException {
|
|
2350
|
+
assert (keys.size() != 0);
|
|
2351
|
+
|
|
2352
|
+
// Check if key size equals cfList size. If not a exception must be
|
|
2353
|
+
// thrown. If not a Segmentation fault happens.
|
|
2354
|
+
if (keys.size() != columnFamilyHandleList.size() && columnFamilyHandleList.size() > 1) {
|
|
2355
|
+
throw new IllegalArgumentException(
|
|
2356
|
+
"Wrong number of ColumnFamilyHandle(s) supplied. Provide 0, 1, or as many as there are key/value(s)");
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
// Check if key size equals cfList size. If not a exception must be
|
|
2360
|
+
// thrown. If not a Segmentation fault happens.
|
|
2361
|
+
if (values.size() != keys.size()) {
|
|
2362
|
+
throw new IllegalArgumentException("For each key there must be a corresponding value.");
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
// TODO (AP) support indirect buffers
|
|
2366
|
+
for (final ByteBuffer key : keys) {
|
|
2367
|
+
if (!key.isDirect()) {
|
|
2368
|
+
throw new IllegalArgumentException("All key buffers must be direct byte buffers");
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
// TODO (AP) support indirect buffers, though probably via a less efficient code path
|
|
2373
|
+
for (final ByteBuffer value : values) {
|
|
2374
|
+
if (!value.isDirect()) {
|
|
2375
|
+
throw new IllegalArgumentException("All value buffers must be direct byte buffers");
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
final int numCFHandles = columnFamilyHandleList.size();
|
|
2380
|
+
final long[] cfHandles = new long[numCFHandles];
|
|
2381
|
+
for (int i = 0; i < numCFHandles; i++) {
|
|
2382
|
+
cfHandles[i] = columnFamilyHandleList.get(i).nativeHandle_;
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
final int numValues = keys.size();
|
|
2386
|
+
|
|
2387
|
+
final ByteBuffer[] keysArray = keys.toArray(new ByteBuffer[0]);
|
|
2388
|
+
final int[] keyOffsets = new int[numValues];
|
|
2389
|
+
final int[] keyLengths = new int[numValues];
|
|
2390
|
+
for (int i = 0; i < numValues; i++) {
|
|
2391
|
+
// TODO (AP) add keysArray[i].arrayOffset() if the buffer is indirect
|
|
2392
|
+
// TODO (AP) because in that case we have to pass the array directly,
|
|
2393
|
+
// so that the JNI C++ code will not know to compensate for the array offset
|
|
2394
|
+
keyOffsets[i] = keysArray[i].position();
|
|
2395
|
+
keyLengths[i] = keysArray[i].limit();
|
|
2396
|
+
}
|
|
2397
|
+
final ByteBuffer[] valuesArray = values.toArray(new ByteBuffer[0]);
|
|
2398
|
+
final int[] valuesSizeArray = new int[numValues];
|
|
2399
|
+
final Status[] statusArray = new Status[numValues];
|
|
2400
|
+
|
|
2401
|
+
multiGet(nativeHandle_, readOptions.nativeHandle_, cfHandles, keysArray, keyOffsets, keyLengths,
|
|
2402
|
+
valuesArray, valuesSizeArray, statusArray);
|
|
2403
|
+
|
|
2404
|
+
final List<ByteBufferGetStatus> results = new ArrayList<>();
|
|
2405
|
+
for (int i = 0; i < numValues; i++) {
|
|
2406
|
+
final Status status = statusArray[i];
|
|
2407
|
+
if (status.getCode() == Status.Code.Ok) {
|
|
2408
|
+
final ByteBuffer value = valuesArray[i];
|
|
2409
|
+
value.position(Math.min(valuesSizeArray[i], value.capacity()));
|
|
2410
|
+
value.flip(); // prepare for read out
|
|
2411
|
+
results.add(new ByteBufferGetStatus(status, valuesSizeArray[i], value));
|
|
2412
|
+
} else {
|
|
2413
|
+
results.add(new ByteBufferGetStatus(status));
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
return results;
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2420
|
+
/**
|
|
2421
|
+
* If the key definitely does not exist in the database, then this method
|
|
2422
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2423
|
+
* That is to say that this method is probabilistic and may return false
|
|
2424
|
+
* positives, but never a false negative.
|
|
2425
|
+
* <p>
|
|
2426
|
+
* If the caller wants to obtain value when the key
|
|
2427
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2428
|
+
* <p>
|
|
2429
|
+
* This check is potentially lighter-weight than invoking
|
|
2430
|
+
* {@link #get(byte[])}. One way to make this lighter weight is to avoid
|
|
2431
|
+
* doing any IOs.
|
|
2432
|
+
*
|
|
2433
|
+
* @param key byte array of a key to search for
|
|
2434
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2435
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2436
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2437
|
+
*
|
|
2438
|
+
* @return false if the key definitely does not exist in the database,
|
|
2439
|
+
* otherwise true.
|
|
2440
|
+
*/
|
|
2441
|
+
public boolean keyMayExist(final byte[] key,
|
|
2442
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2443
|
+
return keyMayExist(key, 0, key.length, valueHolder);
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
/**
|
|
2447
|
+
* If the key definitely does not exist in the database, then this method
|
|
2448
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2449
|
+
* That is to say that this method is probabilistic and may return false
|
|
2450
|
+
* positives, but never a false negative.
|
|
2451
|
+
* <p>
|
|
2452
|
+
* If the caller wants to obtain value when the key
|
|
2453
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2454
|
+
* <p>
|
|
2455
|
+
* This check is potentially lighter-weight than invoking
|
|
2456
|
+
* {@link #get(byte[], int, int)}. One way to make this lighter weight is to
|
|
2457
|
+
* avoid doing any IOs.
|
|
2458
|
+
*
|
|
2459
|
+
* @param key byte array of a key to search for
|
|
2460
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2461
|
+
* non-negative and no larger than "key".length
|
|
2462
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2463
|
+
* and no larger than "key".length
|
|
2464
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2465
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2466
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2467
|
+
*
|
|
2468
|
+
* @return false if the key definitely does not exist in the database,
|
|
2469
|
+
* otherwise true.
|
|
2470
|
+
*/
|
|
2471
|
+
public boolean keyMayExist(final byte[] key,
|
|
2472
|
+
final int offset, final int len,
|
|
2473
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2474
|
+
return keyMayExist((ColumnFamilyHandle)null, key, offset, len, valueHolder);
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
/**
|
|
2478
|
+
* If the key definitely does not exist in the database, then this method
|
|
2479
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2480
|
+
* That is to say that this method is probabilistic and may return false
|
|
2481
|
+
* positives, but never a false negative.
|
|
2482
|
+
* <p>
|
|
2483
|
+
* If the caller wants to obtain value when the key
|
|
2484
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2485
|
+
* <p>
|
|
2486
|
+
* This check is potentially lighter-weight than invoking
|
|
2487
|
+
* {@link #get(ColumnFamilyHandle,byte[])}. One way to make this lighter
|
|
2488
|
+
* weight is to avoid doing any IOs.
|
|
2489
|
+
*
|
|
2490
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
2491
|
+
* @param key byte array of a key to search for
|
|
2492
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2493
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2494
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2495
|
+
*
|
|
2496
|
+
* @return false if the key definitely does not exist in the database,
|
|
2497
|
+
* otherwise true.
|
|
2498
|
+
*/
|
|
2499
|
+
public boolean keyMayExist(
|
|
2500
|
+
final ColumnFamilyHandle columnFamilyHandle, final byte[] key,
|
|
2501
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2502
|
+
return keyMayExist(columnFamilyHandle, key, 0, key.length,
|
|
2503
|
+
valueHolder);
|
|
2504
|
+
}
|
|
2505
|
+
|
|
2506
|
+
/**
|
|
2507
|
+
* If the key definitely does not exist in the database, then this method
|
|
2508
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2509
|
+
* That is to say that this method is probabilistic and may return false
|
|
2510
|
+
* positives, but never a false negative.
|
|
2511
|
+
* <p>
|
|
2512
|
+
* If the caller wants to obtain value when the key
|
|
2513
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2514
|
+
* <p>
|
|
2515
|
+
* This check is potentially lighter-weight than invoking
|
|
2516
|
+
* {@link #get(ColumnFamilyHandle, byte[], int, int)}. One way to make this
|
|
2517
|
+
* lighter weight is to avoid doing any IOs.
|
|
2518
|
+
*
|
|
2519
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
2520
|
+
* @param key byte array of a key to search for
|
|
2521
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2522
|
+
* non-negative and no larger than "key".length
|
|
2523
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2524
|
+
* and no larger than "key".length
|
|
2525
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2526
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2527
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2528
|
+
*
|
|
2529
|
+
* @return false if the key definitely does not exist in the database,
|
|
2530
|
+
* otherwise true.
|
|
2531
|
+
*/
|
|
2532
|
+
public boolean keyMayExist(final ColumnFamilyHandle columnFamilyHandle, final byte[] key,
|
|
2533
|
+
final int offset, final int len,
|
|
2534
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2535
|
+
return keyMayExist(columnFamilyHandle, null, key, offset, len,
|
|
2536
|
+
valueHolder);
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
/**
|
|
2540
|
+
* If the key definitely does not exist in the database, then this method
|
|
2541
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2542
|
+
* That is to say that this method is probabilistic and may return false
|
|
2543
|
+
* positives, but never a true negative.
|
|
2544
|
+
* <p>
|
|
2545
|
+
* If the caller wants to obtain value when the key
|
|
2546
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2547
|
+
* <p>
|
|
2548
|
+
* This check is potentially lighter-weight than invoking
|
|
2549
|
+
* {@link #get(ReadOptions, byte[])}. One way to make this
|
|
2550
|
+
* lighter weight is to avoid doing any IOs.
|
|
2551
|
+
*
|
|
2552
|
+
* @param readOptions {@link ReadOptions} instance
|
|
2553
|
+
* @param key byte array of a key to search for
|
|
2554
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2555
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2556
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2557
|
+
*
|
|
2558
|
+
* @return false if the key definitely does not exist in the database,
|
|
2559
|
+
* otherwise true.
|
|
2560
|
+
*/
|
|
2561
|
+
public boolean keyMayExist(
|
|
2562
|
+
final ReadOptions readOptions, final byte[] key,
|
|
2563
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2564
|
+
return keyMayExist(readOptions, key, 0, key.length,
|
|
2565
|
+
valueHolder);
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
/**
|
|
2569
|
+
* If the key definitely does not exist in the database, then this method
|
|
2570
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2571
|
+
* That is to say that this method is probabilistic and may return false
|
|
2572
|
+
* positives, but never a true negative.
|
|
2573
|
+
* <p>
|
|
2574
|
+
* If the caller wants to obtain value when the key
|
|
2575
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2576
|
+
* <p>
|
|
2577
|
+
* This check is potentially lighter-weight than invoking
|
|
2578
|
+
* {@link #get(ReadOptions, byte[], int, int)}. One way to make this
|
|
2579
|
+
* lighter weight is to avoid doing any IOs.
|
|
2580
|
+
*
|
|
2581
|
+
* @param readOptions {@link ReadOptions} instance
|
|
2582
|
+
* @param key byte array of a key to search for
|
|
2583
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2584
|
+
* non-negative and no larger than "key".length
|
|
2585
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2586
|
+
* and no larger than "key".length
|
|
2587
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2588
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2589
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2590
|
+
*
|
|
2591
|
+
* @return false if the key definitely does not exist in the database,
|
|
2592
|
+
* otherwise true.
|
|
2593
|
+
*/
|
|
2594
|
+
public boolean keyMayExist(
|
|
2595
|
+
final ReadOptions readOptions,
|
|
2596
|
+
final byte[] key, final int offset, final int len,
|
|
2597
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2598
|
+
return keyMayExist(null, readOptions,
|
|
2599
|
+
key, offset, len, valueHolder);
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
/**
|
|
2603
|
+
* If the key definitely does not exist in the database, then this method
|
|
2604
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2605
|
+
* That is to say that this method is probabilistic and may return false
|
|
2606
|
+
* positives, but never a true negative.
|
|
2607
|
+
* <p>
|
|
2608
|
+
* If the caller wants to obtain value when the key
|
|
2609
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2610
|
+
* <p>
|
|
2611
|
+
* This check is potentially lighter-weight than invoking
|
|
2612
|
+
* {@link #get(ColumnFamilyHandle, ReadOptions, byte[])}. One way to make this
|
|
2613
|
+
* lighter weight is to avoid doing any IOs.
|
|
2614
|
+
*
|
|
2615
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
2616
|
+
* @param readOptions {@link ReadOptions} instance
|
|
2617
|
+
* @param key byte array of a key to search for
|
|
2618
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2619
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2620
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2621
|
+
*
|
|
2622
|
+
* @return false if the key definitely does not exist in the database,
|
|
2623
|
+
* otherwise true.
|
|
2624
|
+
*/
|
|
2625
|
+
public boolean keyMayExist(
|
|
2626
|
+
final ColumnFamilyHandle columnFamilyHandle,
|
|
2627
|
+
final ReadOptions readOptions, final byte[] key,
|
|
2628
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2629
|
+
return keyMayExist(columnFamilyHandle, readOptions,
|
|
2630
|
+
key, 0, key.length, valueHolder);
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
/**
|
|
2634
|
+
* If the key definitely does not exist in the database, then this method
|
|
2635
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2636
|
+
* That is to say that this method is probabilistic and may return false
|
|
2637
|
+
* positives, but never a false negative.
|
|
2638
|
+
* <p>
|
|
2639
|
+
* If the caller wants to obtain value when the key
|
|
2640
|
+
* is found in memory, then {@code valueHolder} must be set.
|
|
2641
|
+
* <p>
|
|
2642
|
+
* This check is potentially lighter-weight than invoking
|
|
2643
|
+
* {@link #get(ColumnFamilyHandle, ReadOptions, byte[], int, int)}.
|
|
2644
|
+
* One way to make this lighter weight is to avoid doing any IOs.
|
|
2645
|
+
*
|
|
2646
|
+
* @param columnFamilyHandle {@link ColumnFamilyHandle} instance
|
|
2647
|
+
* @param readOptions {@link ReadOptions} instance
|
|
2648
|
+
* @param key byte array of a key to search for
|
|
2649
|
+
* @param offset the offset of the "key" array to be used, must be
|
|
2650
|
+
* non-negative and no larger than "key".length
|
|
2651
|
+
* @param len the length of the "key" array to be used, must be non-negative
|
|
2652
|
+
* and no larger than "key".length
|
|
2653
|
+
* @param valueHolder non-null to retrieve the value if it is found, or null
|
|
2654
|
+
* if the value is not needed. If non-null, upon return of the function,
|
|
2655
|
+
* the {@code value} will be set if it could be retrieved.
|
|
2656
|
+
*
|
|
2657
|
+
* @return false if the key definitely does not exist in the database,
|
|
2658
|
+
* otherwise true.
|
|
2659
|
+
*/
|
|
2660
|
+
public boolean keyMayExist(
|
|
2661
|
+
final ColumnFamilyHandle columnFamilyHandle,
|
|
2662
|
+
final ReadOptions readOptions,
|
|
2663
|
+
final byte[] key, final int offset, final int len,
|
|
2664
|
+
/* @Nullable */ final Holder<byte[]> valueHolder) {
|
|
2665
|
+
checkBounds(offset, len, key.length);
|
|
2666
|
+
if (valueHolder == null) {
|
|
2667
|
+
return keyMayExist(nativeHandle_,
|
|
2668
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
2669
|
+
readOptions == null ? 0 : readOptions.nativeHandle_,
|
|
2670
|
+
key, offset, len);
|
|
2671
|
+
} else {
|
|
2672
|
+
final byte[][] result = keyMayExistFoundValue(
|
|
2673
|
+
nativeHandle_,
|
|
2674
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
2675
|
+
readOptions == null ? 0 : readOptions.nativeHandle_,
|
|
2676
|
+
key, offset, len);
|
|
2677
|
+
if (result[0][0] == 0x0) {
|
|
2678
|
+
valueHolder.setValue(null);
|
|
2679
|
+
return false;
|
|
2680
|
+
} else if (result[0][0] == 0x1) {
|
|
2681
|
+
valueHolder.setValue(null);
|
|
2682
|
+
return true;
|
|
2683
|
+
} else {
|
|
2684
|
+
valueHolder.setValue(result[1]);
|
|
2685
|
+
return true;
|
|
2686
|
+
}
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
/**
|
|
2691
|
+
* If the key definitely does not exist in the database, then this method
|
|
2692
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2693
|
+
* That is to say that this method is probabilistic and may return false
|
|
2694
|
+
* positives, but never a false negative.
|
|
2695
|
+
*
|
|
2696
|
+
* @param key bytebuffer containing the value of the key
|
|
2697
|
+
* @return false if the key definitely does not exist in the database,
|
|
2698
|
+
* otherwise true.
|
|
2699
|
+
*/
|
|
2700
|
+
public boolean keyMayExist(final ByteBuffer key) {
|
|
2701
|
+
return keyMayExist(null, (ReadOptions) null, key);
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2704
|
+
/**
|
|
2705
|
+
* If the key definitely does not exist in the database, then this method
|
|
2706
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2707
|
+
* That is to say that this method is probabilistic and may return false
|
|
2708
|
+
* positives, but never a false negative.
|
|
2709
|
+
*
|
|
2710
|
+
* @param columnFamilyHandle the {@link ColumnFamilyHandle} to look for the key in
|
|
2711
|
+
* @param key bytebuffer containing the value of the key
|
|
2712
|
+
* @return false if the key definitely does not exist in the database,
|
|
2713
|
+
* otherwise true.
|
|
2714
|
+
*/
|
|
2715
|
+
public boolean keyMayExist(final ColumnFamilyHandle columnFamilyHandle, final ByteBuffer key) {
|
|
2716
|
+
return keyMayExist(columnFamilyHandle, (ReadOptions) null, key);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
/**
|
|
2720
|
+
* If the key definitely does not exist in the database, then this method
|
|
2721
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2722
|
+
* That is to say that this method is probabilistic and may return false
|
|
2723
|
+
* positives, but never a false negative.
|
|
2724
|
+
*
|
|
2725
|
+
* @param readOptions the {@link ReadOptions} to use when reading the key/value
|
|
2726
|
+
* @param key bytebuffer containing the value of the key
|
|
2727
|
+
* @return false if the key definitely does not exist in the database,
|
|
2728
|
+
* otherwise true.
|
|
2729
|
+
*/
|
|
2730
|
+
public boolean keyMayExist(final ReadOptions readOptions, final ByteBuffer key) {
|
|
2731
|
+
return keyMayExist(null, readOptions, key);
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
/**
|
|
2735
|
+
* If the key definitely does not exist in the database, then this method
|
|
2736
|
+
* returns {@link KeyMayExist.KeyMayExistEnum#kNotExist},
|
|
2737
|
+
* otherwise if it can with best effort retreive the value, it returns {@link
|
|
2738
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithValue} otherwise it returns {@link
|
|
2739
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithoutValue}. The choice not to return a value which might
|
|
2740
|
+
* exist is at the discretion of the implementation; the only guarantee is that {@link
|
|
2741
|
+
* KeyMayExist.KeyMayExistEnum#kNotExist} is an assurance that the key does not exist.
|
|
2742
|
+
*
|
|
2743
|
+
* @param key bytebuffer containing the value of the key
|
|
2744
|
+
* @param value bytebuffer which will receive a value if the key exists and a value is known
|
|
2745
|
+
* @return a {@link KeyMayExist} object reporting if key may exist and if a value is provided
|
|
2746
|
+
*/
|
|
2747
|
+
public KeyMayExist keyMayExist(final ByteBuffer key, final ByteBuffer value) {
|
|
2748
|
+
return keyMayExist(null, null, key, value);
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
/**
|
|
2752
|
+
* If the key definitely does not exist in the database, then this method
|
|
2753
|
+
* returns {@link KeyMayExist.KeyMayExistEnum#kNotExist},
|
|
2754
|
+
* otherwise if it can with best effort retreive the value, it returns {@link
|
|
2755
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithValue} otherwise it returns {@link
|
|
2756
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithoutValue}. The choice not to return a value which might
|
|
2757
|
+
* exist is at the discretion of the implementation; the only guarantee is that {@link
|
|
2758
|
+
* KeyMayExist.KeyMayExistEnum#kNotExist} is an assurance that the key does not exist.
|
|
2759
|
+
*
|
|
2760
|
+
* @param columnFamilyHandle the {@link ColumnFamilyHandle} to look for the key in
|
|
2761
|
+
* @param key bytebuffer containing the value of the key
|
|
2762
|
+
* @param value bytebuffer which will receive a value if the key exists and a value is known
|
|
2763
|
+
* @return a {@link KeyMayExist} object reporting if key may exist and if a value is provided
|
|
2764
|
+
*/
|
|
2765
|
+
public KeyMayExist keyMayExist(
|
|
2766
|
+
final ColumnFamilyHandle columnFamilyHandle, final ByteBuffer key, final ByteBuffer value) {
|
|
2767
|
+
return keyMayExist(columnFamilyHandle, null, key, value);
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
/**
|
|
2771
|
+
* If the key definitely does not exist in the database, then this method
|
|
2772
|
+
* returns {@link KeyMayExist.KeyMayExistEnum#kNotExist},
|
|
2773
|
+
* otherwise if it can with best effort retreive the value, it returns {@link
|
|
2774
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithValue} otherwise it returns {@link
|
|
2775
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithoutValue}. The choice not to return a value which might
|
|
2776
|
+
* exist is at the discretion of the implementation; the only guarantee is that {@link
|
|
2777
|
+
* KeyMayExist.KeyMayExistEnum#kNotExist} is an assurance that the key does not exist.
|
|
2778
|
+
*
|
|
2779
|
+
* @param readOptions the {@link ReadOptions} to use when reading the key/value
|
|
2780
|
+
* @param key bytebuffer containing the value of the key
|
|
2781
|
+
* @param value bytebuffer which will receive a value if the key exists and a value is known
|
|
2782
|
+
* @return a {@link KeyMayExist} object reporting if key may exist and if a value is provided
|
|
2783
|
+
*/
|
|
2784
|
+
public KeyMayExist keyMayExist(
|
|
2785
|
+
final ReadOptions readOptions, final ByteBuffer key, final ByteBuffer value) {
|
|
2786
|
+
return keyMayExist(null, readOptions, key, value);
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
/**
|
|
2790
|
+
* If the key definitely does not exist in the database, then this method
|
|
2791
|
+
* returns false, otherwise it returns true if the key might exist.
|
|
2792
|
+
* That is to say that this method is probabilistic and may return false
|
|
2793
|
+
* positives, but never a false negative.
|
|
2794
|
+
*
|
|
2795
|
+
* @param columnFamilyHandle the {@link ColumnFamilyHandle} to look for the key in
|
|
2796
|
+
* @param readOptions the {@link ReadOptions} to use when reading the key/value
|
|
2797
|
+
* @param key bytebuffer containing the value of the key
|
|
2798
|
+
* @return false if the key definitely does not exist in the database,
|
|
2799
|
+
* otherwise true.
|
|
2800
|
+
*/
|
|
2801
|
+
public boolean keyMayExist(final ColumnFamilyHandle columnFamilyHandle,
|
|
2802
|
+
final ReadOptions readOptions, final ByteBuffer key) {
|
|
2803
|
+
assert key != null : "key ByteBuffer parameter cannot be null";
|
|
2804
|
+
assert key.isDirect() : "key parameter must be a direct ByteBuffer";
|
|
2805
|
+
return keyMayExistDirect(nativeHandle_,
|
|
2806
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
2807
|
+
readOptions == null ? 0 : readOptions.nativeHandle_, key, key.position(), key.limit());
|
|
2808
|
+
}
|
|
2809
|
+
|
|
2810
|
+
/**
|
|
2811
|
+
* If the key definitely does not exist in the database, then this method
|
|
2812
|
+
* returns {@link KeyMayExist.KeyMayExistEnum#kNotExist},
|
|
2813
|
+
* otherwise if it can with best effort retreive the value, it returns {@link
|
|
2814
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithValue} otherwise it returns {@link
|
|
2815
|
+
* KeyMayExist.KeyMayExistEnum#kExistsWithoutValue}. The choice not to return a value which might
|
|
2816
|
+
* exist is at the discretion of the implementation; the only guarantee is that {@link
|
|
2817
|
+
* KeyMayExist.KeyMayExistEnum#kNotExist} is an assurance that the key does not exist.
|
|
2818
|
+
*
|
|
2819
|
+
* @param columnFamilyHandle the {@link ColumnFamilyHandle} to look for the key in
|
|
2820
|
+
* @param readOptions the {@link ReadOptions} to use when reading the key/value
|
|
2821
|
+
* @param key bytebuffer containing the value of the key
|
|
2822
|
+
* @param value bytebuffer which will receive a value if the key exists and a value is known
|
|
2823
|
+
* @return a {@link KeyMayExist} object reporting if key may exist and if a value is provided
|
|
2824
|
+
*/
|
|
2825
|
+
public KeyMayExist keyMayExist(final ColumnFamilyHandle columnFamilyHandle,
|
|
2826
|
+
final ReadOptions readOptions, final ByteBuffer key, final ByteBuffer value) {
|
|
2827
|
+
assert key != null : "key ByteBuffer parameter cannot be null";
|
|
2828
|
+
assert key.isDirect() : "key parameter must be a direct ByteBuffer";
|
|
2829
|
+
assert value
|
|
2830
|
+
!= null
|
|
2831
|
+
: "value ByteBuffer parameter cannot be null. If you do not need the value, use a different version of the method";
|
|
2832
|
+
assert value.isDirect() : "value parameter must be a direct ByteBuffer";
|
|
2833
|
+
|
|
2834
|
+
final int[] result = keyMayExistDirectFoundValue(nativeHandle_,
|
|
2835
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
2836
|
+
readOptions == null ? 0 : readOptions.nativeHandle_, key, key.position(), key.remaining(),
|
|
2837
|
+
value, value.position(), value.remaining());
|
|
2838
|
+
final int valueLength = result[1];
|
|
2839
|
+
value.limit(value.position() + Math.min(valueLength, value.remaining()));
|
|
2840
|
+
return new KeyMayExist(KeyMayExist.KeyMayExistEnum.values()[result[0]], valueLength);
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
/**
|
|
2844
|
+
* <p>Return a heap-allocated iterator over the contents of the
|
|
2845
|
+
* database. The result of newIterator() is initially invalid
|
|
2846
|
+
* (caller must call one of the Seek methods on the iterator
|
|
2847
|
+
* before using it).</p>
|
|
2848
|
+
*
|
|
2849
|
+
* <p>Caller should close the iterator when it is no longer needed.
|
|
2850
|
+
* The returned iterator should be closed before this db is closed.
|
|
2851
|
+
* </p>
|
|
2852
|
+
*
|
|
2853
|
+
* @return instance of iterator object.
|
|
2854
|
+
*/
|
|
2855
|
+
public RocksIterator newIterator() {
|
|
2856
|
+
return new RocksIterator(this, iterator(nativeHandle_));
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
/**
|
|
2860
|
+
* <p>Return a heap-allocated iterator over the contents of the
|
|
2861
|
+
* database. The result of newIterator() is initially invalid
|
|
2862
|
+
* (caller must call one of the Seek methods on the iterator
|
|
2863
|
+
* before using it).</p>
|
|
2864
|
+
*
|
|
2865
|
+
* <p>Caller should close the iterator when it is no longer needed.
|
|
2866
|
+
* The returned iterator should be closed before this db is closed.
|
|
2867
|
+
* </p>
|
|
2868
|
+
*
|
|
2869
|
+
* @param readOptions {@link ReadOptions} instance.
|
|
2870
|
+
* @return instance of iterator object.
|
|
2871
|
+
*/
|
|
2872
|
+
public RocksIterator newIterator(final ReadOptions readOptions) {
|
|
2873
|
+
return new RocksIterator(this, iterator(nativeHandle_,
|
|
2874
|
+
readOptions.nativeHandle_));
|
|
2875
|
+
}
|
|
2876
|
+
|
|
2877
|
+
/**
|
|
2878
|
+
* <p>Return a heap-allocated iterator over the contents of a
|
|
2879
|
+
* ColumnFamily. The result of newIterator() is initially invalid
|
|
2880
|
+
* (caller must call one of the Seek methods on the iterator
|
|
2881
|
+
* before using it).</p>
|
|
2882
|
+
*
|
|
2883
|
+
* <p>Caller should close the iterator when it is no longer needed.
|
|
2884
|
+
* The returned iterator should be closed before this db is closed.
|
|
2885
|
+
* </p>
|
|
2886
|
+
*
|
|
2887
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
2888
|
+
* instance
|
|
2889
|
+
* @return instance of iterator object.
|
|
2890
|
+
*/
|
|
2891
|
+
public RocksIterator newIterator(
|
|
2892
|
+
final ColumnFamilyHandle columnFamilyHandle) {
|
|
2893
|
+
return new RocksIterator(this, iteratorCF(nativeHandle_,
|
|
2894
|
+
columnFamilyHandle.nativeHandle_));
|
|
2895
|
+
}
|
|
2896
|
+
|
|
2897
|
+
/**
|
|
2898
|
+
* <p>Return a heap-allocated iterator over the contents of a
|
|
2899
|
+
* ColumnFamily. The result of newIterator() is initially invalid
|
|
2900
|
+
* (caller must call one of the Seek methods on the iterator
|
|
2901
|
+
* before using it).</p>
|
|
2902
|
+
*
|
|
2903
|
+
* <p>Caller should close the iterator when it is no longer needed.
|
|
2904
|
+
* The returned iterator should be closed before this db is closed.
|
|
2905
|
+
* </p>
|
|
2906
|
+
*
|
|
2907
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
2908
|
+
* instance
|
|
2909
|
+
* @param readOptions {@link ReadOptions} instance.
|
|
2910
|
+
* @return instance of iterator object.
|
|
2911
|
+
*/
|
|
2912
|
+
public RocksIterator newIterator(final ColumnFamilyHandle columnFamilyHandle,
|
|
2913
|
+
final ReadOptions readOptions) {
|
|
2914
|
+
return new RocksIterator(this, iteratorCF(nativeHandle_,
|
|
2915
|
+
columnFamilyHandle.nativeHandle_, readOptions.nativeHandle_));
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
/**
|
|
2919
|
+
* Returns iterators from a consistent database state across multiple
|
|
2920
|
+
* column families. Iterators are heap allocated and need to be deleted
|
|
2921
|
+
* before the db is deleted
|
|
2922
|
+
*
|
|
2923
|
+
* @param columnFamilyHandleList {@link java.util.List} containing
|
|
2924
|
+
* {@link org.rocksdb.ColumnFamilyHandle} instances.
|
|
2925
|
+
* @return {@link java.util.List} containing {@link org.rocksdb.RocksIterator}
|
|
2926
|
+
* instances
|
|
2927
|
+
*
|
|
2928
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2929
|
+
* native library.
|
|
2930
|
+
*/
|
|
2931
|
+
public List<RocksIterator> newIterators(
|
|
2932
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList)
|
|
2933
|
+
throws RocksDBException {
|
|
2934
|
+
return newIterators(columnFamilyHandleList, new ReadOptions());
|
|
2935
|
+
}
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
* Returns iterators from a consistent database state across multiple
|
|
2939
|
+
* column families. Iterators are heap allocated and need to be deleted
|
|
2940
|
+
* before the db is deleted
|
|
2941
|
+
*
|
|
2942
|
+
* @param columnFamilyHandleList {@link java.util.List} containing
|
|
2943
|
+
* {@link org.rocksdb.ColumnFamilyHandle} instances.
|
|
2944
|
+
* @param readOptions {@link ReadOptions} instance.
|
|
2945
|
+
* @return {@link java.util.List} containing {@link org.rocksdb.RocksIterator}
|
|
2946
|
+
* instances
|
|
2947
|
+
*
|
|
2948
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
2949
|
+
* native library.
|
|
2950
|
+
*/
|
|
2951
|
+
public List<RocksIterator> newIterators(
|
|
2952
|
+
final List<ColumnFamilyHandle> columnFamilyHandleList,
|
|
2953
|
+
final ReadOptions readOptions) throws RocksDBException {
|
|
2954
|
+
|
|
2955
|
+
final long[] columnFamilyHandles = new long[columnFamilyHandleList.size()];
|
|
2956
|
+
for (int i = 0; i < columnFamilyHandleList.size(); i++) {
|
|
2957
|
+
columnFamilyHandles[i] = columnFamilyHandleList.get(i).nativeHandle_;
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
final long[] iteratorRefs = iterators(nativeHandle_, columnFamilyHandles,
|
|
2961
|
+
readOptions.nativeHandle_);
|
|
2962
|
+
|
|
2963
|
+
final List<RocksIterator> iterators = new ArrayList<>(
|
|
2964
|
+
columnFamilyHandleList.size());
|
|
2965
|
+
for (int i=0; i<columnFamilyHandleList.size(); i++){
|
|
2966
|
+
iterators.add(new RocksIterator(this, iteratorRefs[i]));
|
|
2967
|
+
}
|
|
2968
|
+
return iterators;
|
|
2969
|
+
}
|
|
2970
|
+
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* <p>Return a handle to the current DB state. Iterators created with
|
|
2974
|
+
* this handle will all observe a stable snapshot of the current DB
|
|
2975
|
+
* state. The caller must call ReleaseSnapshot(result) when the
|
|
2976
|
+
* snapshot is no longer needed.</p>
|
|
2977
|
+
*
|
|
2978
|
+
* <p>nullptr will be returned if the DB fails to take a snapshot or does
|
|
2979
|
+
* not support snapshot.</p>
|
|
2980
|
+
*
|
|
2981
|
+
* @return Snapshot {@link Snapshot} instance
|
|
2982
|
+
*/
|
|
2983
|
+
public Snapshot getSnapshot() {
|
|
2984
|
+
final long snapshotHandle = getSnapshot(nativeHandle_);
|
|
2985
|
+
if (snapshotHandle != 0) {
|
|
2986
|
+
return new Snapshot(snapshotHandle);
|
|
2987
|
+
}
|
|
2988
|
+
return null;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2991
|
+
/**
|
|
2992
|
+
* Release a previously acquired snapshot.
|
|
2993
|
+
* <p>
|
|
2994
|
+
* The caller must not use "snapshot" after this call.
|
|
2995
|
+
*
|
|
2996
|
+
* @param snapshot {@link Snapshot} instance
|
|
2997
|
+
*/
|
|
2998
|
+
public void releaseSnapshot(final Snapshot snapshot) {
|
|
2999
|
+
if (snapshot != null) {
|
|
3000
|
+
releaseSnapshot(nativeHandle_, snapshot.nativeHandle_);
|
|
3001
|
+
}
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
/**
|
|
3005
|
+
* DB implements can export properties about their state
|
|
3006
|
+
* via this method on a per column family level.
|
|
3007
|
+
*
|
|
3008
|
+
* <p>If {@code property} is a valid property understood by this DB
|
|
3009
|
+
* implementation, fills {@code value} with its current value and
|
|
3010
|
+
* returns true. Otherwise returns false.</p>
|
|
3011
|
+
*
|
|
3012
|
+
* <p>Valid property names include:
|
|
3013
|
+
* <ul>
|
|
3014
|
+
* <li>"rocksdb.num-files-at-level<N>" - return the number of files at
|
|
3015
|
+
* level <N>, where <N> is an ASCII representation of a level
|
|
3016
|
+
* number (e.g. "0").</li>
|
|
3017
|
+
* <li>"rocksdb.stats" - returns a multi-line string that describes statistics
|
|
3018
|
+
* about the internal operation of the DB.</li>
|
|
3019
|
+
* <li>"rocksdb.sstables" - returns a multi-line string that describes all
|
|
3020
|
+
* of the sstables that make up the db contents.</li>
|
|
3021
|
+
* </ul>
|
|
3022
|
+
*
|
|
3023
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3024
|
+
* instance, or null for the default column family.
|
|
3025
|
+
* @param property to be fetched. See above for examples
|
|
3026
|
+
* @return property value
|
|
3027
|
+
*
|
|
3028
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
3029
|
+
* native library.
|
|
3030
|
+
*/
|
|
3031
|
+
public String getProperty(
|
|
3032
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle,
|
|
3033
|
+
final String property) throws RocksDBException {
|
|
3034
|
+
return getProperty(nativeHandle_,
|
|
3035
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3036
|
+
property, property.length());
|
|
3037
|
+
}
|
|
3038
|
+
|
|
3039
|
+
/**
|
|
3040
|
+
* DB implementations can export properties about their state
|
|
3041
|
+
* via this method. If "property" is a valid property understood by this
|
|
3042
|
+
* DB implementation, fills "*value" with its current value and returns
|
|
3043
|
+
* true. Otherwise returns false.
|
|
3044
|
+
*
|
|
3045
|
+
* <p>Valid property names include:
|
|
3046
|
+
* <ul>
|
|
3047
|
+
* <li>"rocksdb.num-files-at-level<N>" - return the number of files at
|
|
3048
|
+
* level <N>, where <N> is an ASCII representation of a level
|
|
3049
|
+
* number (e.g. "0").</li>
|
|
3050
|
+
* <li>"rocksdb.stats" - returns a multi-line string that describes statistics
|
|
3051
|
+
* about the internal operation of the DB.</li>
|
|
3052
|
+
* <li>"rocksdb.sstables" - returns a multi-line string that describes all
|
|
3053
|
+
* of the sstables that make up the db contents.</li>
|
|
3054
|
+
*</ul>
|
|
3055
|
+
*
|
|
3056
|
+
* @param property to be fetched. See above for examples
|
|
3057
|
+
* @return property value
|
|
3058
|
+
*
|
|
3059
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
3060
|
+
* native library.
|
|
3061
|
+
*/
|
|
3062
|
+
public String getProperty(final String property) throws RocksDBException {
|
|
3063
|
+
return getProperty(null, property);
|
|
3064
|
+
}
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
/**
|
|
3068
|
+
* Gets a property map.
|
|
3069
|
+
*
|
|
3070
|
+
* @param property to be fetched.
|
|
3071
|
+
*
|
|
3072
|
+
* @return the property map
|
|
3073
|
+
*
|
|
3074
|
+
* @throws RocksDBException if an error happens in the underlying native code.
|
|
3075
|
+
*/
|
|
3076
|
+
public Map<String, String> getMapProperty(final String property)
|
|
3077
|
+
throws RocksDBException {
|
|
3078
|
+
return getMapProperty(null, property);
|
|
3079
|
+
}
|
|
3080
|
+
|
|
3081
|
+
/**
|
|
3082
|
+
* Gets a property map.
|
|
3083
|
+
*
|
|
3084
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3085
|
+
* instance, or null for the default column family.
|
|
3086
|
+
* @param property to be fetched.
|
|
3087
|
+
*
|
|
3088
|
+
* @return the property map
|
|
3089
|
+
*
|
|
3090
|
+
* @throws RocksDBException if an error happens in the underlying native code.
|
|
3091
|
+
*/
|
|
3092
|
+
public Map<String, String> getMapProperty(
|
|
3093
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle,
|
|
3094
|
+
final String property) throws RocksDBException {
|
|
3095
|
+
return getMapProperty(nativeHandle_,
|
|
3096
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3097
|
+
property, property.length());
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3100
|
+
/**
|
|
3101
|
+
* <p> Similar to GetProperty(), but only works for a subset of properties
|
|
3102
|
+
* whose return value is a numerical value. Return the value as long.</p>
|
|
3103
|
+
*
|
|
3104
|
+
* <p><strong>Note</strong>: As the returned property is of type
|
|
3105
|
+
* {@code uint64_t} on C++ side the returning value can be negative
|
|
3106
|
+
* because Java supports in Java 7 only signed long values.</p>
|
|
3107
|
+
*
|
|
3108
|
+
* <p><strong>Java 7</strong>: To mitigate the problem of the non
|
|
3109
|
+
* existent unsigned long tpye, values should be encapsulated using
|
|
3110
|
+
* {@link java.math.BigInteger} to reflect the correct value. The correct
|
|
3111
|
+
* behavior is guaranteed if {@code 2^64} is added to negative values.</p>
|
|
3112
|
+
*
|
|
3113
|
+
* <p><strong>Java 8</strong>: In Java 8 the value should be treated as
|
|
3114
|
+
* unsigned long using provided methods of type {@link Long}.</p>
|
|
3115
|
+
*
|
|
3116
|
+
* @param property to be fetched.
|
|
3117
|
+
*
|
|
3118
|
+
* @return numerical property value.
|
|
3119
|
+
*
|
|
3120
|
+
* @throws RocksDBException if an error happens in the underlying native code.
|
|
3121
|
+
*/
|
|
3122
|
+
public long getLongProperty(final String property) throws RocksDBException {
|
|
3123
|
+
return getLongProperty(null, property);
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
/**
|
|
3127
|
+
* <p> Similar to GetProperty(), but only works for a subset of properties
|
|
3128
|
+
* whose return value is a numerical value. Return the value as long.</p>
|
|
3129
|
+
*
|
|
3130
|
+
* <p><strong>Note</strong>: As the returned property is of type
|
|
3131
|
+
* {@code uint64_t} on C++ side the returning value can be negative
|
|
3132
|
+
* because Java supports in Java 7 only signed long values.</p>
|
|
3133
|
+
*
|
|
3134
|
+
* <p><strong>Java 7</strong>: To mitigate the problem of the non
|
|
3135
|
+
* existent unsigned long tpye, values should be encapsulated using
|
|
3136
|
+
* {@link java.math.BigInteger} to reflect the correct value. The correct
|
|
3137
|
+
* behavior is guaranteed if {@code 2^64} is added to negative values.</p>
|
|
3138
|
+
*
|
|
3139
|
+
* <p><strong>Java 8</strong>: In Java 8 the value should be treated as
|
|
3140
|
+
* unsigned long using provided methods of type {@link Long}.</p>
|
|
3141
|
+
*
|
|
3142
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3143
|
+
* instance, or null for the default column family
|
|
3144
|
+
* @param property to be fetched.
|
|
3145
|
+
*
|
|
3146
|
+
* @return numerical property value
|
|
3147
|
+
*
|
|
3148
|
+
* @throws RocksDBException if an error happens in the underlying native code.
|
|
3149
|
+
*/
|
|
3150
|
+
public long getLongProperty(
|
|
3151
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle,
|
|
3152
|
+
final String property) throws RocksDBException {
|
|
3153
|
+
return getLongProperty(nativeHandle_,
|
|
3154
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3155
|
+
property, property.length());
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
/**
|
|
3159
|
+
* Reset internal stats for DB and all column families.
|
|
3160
|
+
* <p>
|
|
3161
|
+
* Note this doesn't reset {@link Options#statistics()} as it is not
|
|
3162
|
+
* owned by DB.
|
|
3163
|
+
*
|
|
3164
|
+
* @throws RocksDBException if an error occurs whilst reseting the stats
|
|
3165
|
+
*/
|
|
3166
|
+
public void resetStats() throws RocksDBException {
|
|
3167
|
+
resetStats(nativeHandle_);
|
|
3168
|
+
}
|
|
3169
|
+
|
|
3170
|
+
/**
|
|
3171
|
+
* <p> Return sum of the getLongProperty of all the column families</p>
|
|
3172
|
+
*
|
|
3173
|
+
* <p><strong>Note</strong>: As the returned property is of type
|
|
3174
|
+
* {@code uint64_t} on C++ side the returning value can be negative
|
|
3175
|
+
* because Java supports in Java 7 only signed long values.</p>
|
|
3176
|
+
*
|
|
3177
|
+
* <p><strong>Java 7</strong>: To mitigate the problem of the non
|
|
3178
|
+
* existent unsigned long tpye, values should be encapsulated using
|
|
3179
|
+
* {@link java.math.BigInteger} to reflect the correct value. The correct
|
|
3180
|
+
* behavior is guaranteed if {@code 2^64} is added to negative values.</p>
|
|
3181
|
+
*
|
|
3182
|
+
* <p><strong>Java 8</strong>: In Java 8 the value should be treated as
|
|
3183
|
+
* unsigned long using provided methods of type {@link Long}.</p>
|
|
3184
|
+
*
|
|
3185
|
+
* @param property to be fetched.
|
|
3186
|
+
*
|
|
3187
|
+
* @return numerical property value
|
|
3188
|
+
*
|
|
3189
|
+
* @throws RocksDBException if an error happens in the underlying native code.
|
|
3190
|
+
*/
|
|
3191
|
+
public long getAggregatedLongProperty(final String property)
|
|
3192
|
+
throws RocksDBException {
|
|
3193
|
+
return getAggregatedLongProperty(nativeHandle_, property,
|
|
3194
|
+
property.length());
|
|
3195
|
+
}
|
|
3196
|
+
|
|
3197
|
+
/**
|
|
3198
|
+
* Get the approximate file system space used by keys in each range.
|
|
3199
|
+
* <p>
|
|
3200
|
+
* Note that the returned sizes measure file system space usage, so
|
|
3201
|
+
* if the user data compresses by a factor of ten, the returned
|
|
3202
|
+
* sizes will be one-tenth the size of the corresponding user data size.
|
|
3203
|
+
* <p>
|
|
3204
|
+
* If {@code sizeApproximationFlags} defines whether the returned size
|
|
3205
|
+
* should include the recently written data in the mem-tables (if
|
|
3206
|
+
* the mem-table type supports it), data serialized to disk, or both.
|
|
3207
|
+
*
|
|
3208
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3209
|
+
* instance, or null for the default column family
|
|
3210
|
+
* @param ranges the ranges over which to approximate sizes
|
|
3211
|
+
* @param sizeApproximationFlags flags to determine what to include in the
|
|
3212
|
+
* approximation.
|
|
3213
|
+
*
|
|
3214
|
+
* @return the sizes
|
|
3215
|
+
*/
|
|
3216
|
+
public long[] getApproximateSizes(
|
|
3217
|
+
/*@Nullable*/ final ColumnFamilyHandle columnFamilyHandle,
|
|
3218
|
+
final List<Range> ranges,
|
|
3219
|
+
final SizeApproximationFlag... sizeApproximationFlags) {
|
|
3220
|
+
|
|
3221
|
+
byte flags = 0x0;
|
|
3222
|
+
for (final SizeApproximationFlag sizeApproximationFlag
|
|
3223
|
+
: sizeApproximationFlags) {
|
|
3224
|
+
flags |= sizeApproximationFlag.getValue();
|
|
3225
|
+
}
|
|
3226
|
+
|
|
3227
|
+
return getApproximateSizes(nativeHandle_,
|
|
3228
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3229
|
+
toRangeSliceHandles(ranges), flags);
|
|
3230
|
+
}
|
|
3231
|
+
|
|
3232
|
+
/**
|
|
3233
|
+
* Get the approximate file system space used by keys in each range for
|
|
3234
|
+
* the default column family.
|
|
3235
|
+
* <p>
|
|
3236
|
+
* Note that the returned sizes measure file system space usage, so
|
|
3237
|
+
* if the user data compresses by a factor of ten, the returned
|
|
3238
|
+
* sizes will be one-tenth the size of the corresponding user data size.
|
|
3239
|
+
* <p>
|
|
3240
|
+
* If {@code sizeApproximationFlags} defines whether the returned size
|
|
3241
|
+
* should include the recently written data in the mem-tables (if
|
|
3242
|
+
* the mem-table type supports it), data serialized to disk, or both.
|
|
3243
|
+
*
|
|
3244
|
+
* @param ranges the ranges over which to approximate sizes
|
|
3245
|
+
* @param sizeApproximationFlags flags to determine what to include in the
|
|
3246
|
+
* approximation.
|
|
3247
|
+
*
|
|
3248
|
+
* @return the sizes.
|
|
3249
|
+
*/
|
|
3250
|
+
public long[] getApproximateSizes(final List<Range> ranges,
|
|
3251
|
+
final SizeApproximationFlag... sizeApproximationFlags) {
|
|
3252
|
+
return getApproximateSizes(null, ranges, sizeApproximationFlags);
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
public static class CountAndSize {
|
|
3256
|
+
public final long count;
|
|
3257
|
+
public final long size;
|
|
3258
|
+
|
|
3259
|
+
public CountAndSize(final long count, final long size) {
|
|
3260
|
+
this.count = count;
|
|
3261
|
+
this.size = size;
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
/**
|
|
3266
|
+
* This method is similar to
|
|
3267
|
+
* {@link #getApproximateSizes(ColumnFamilyHandle, List, SizeApproximationFlag...)},
|
|
3268
|
+
* except that it returns approximate number of records and size in memtables.
|
|
3269
|
+
*
|
|
3270
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3271
|
+
* instance, or null for the default column family
|
|
3272
|
+
* @param range the ranges over which to get the memtable stats
|
|
3273
|
+
*
|
|
3274
|
+
* @return the count and size for the range
|
|
3275
|
+
*/
|
|
3276
|
+
public CountAndSize getApproximateMemTableStats(
|
|
3277
|
+
/*@Nullable*/ final ColumnFamilyHandle columnFamilyHandle,
|
|
3278
|
+
final Range range) {
|
|
3279
|
+
final long[] result = getApproximateMemTableStats(nativeHandle_,
|
|
3280
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3281
|
+
range.start.getNativeHandle(),
|
|
3282
|
+
range.limit.getNativeHandle());
|
|
3283
|
+
return new CountAndSize(result[0], result[1]);
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
/**
|
|
3287
|
+
* This method is similar to
|
|
3288
|
+
* {@link #getApproximateSizes(ColumnFamilyHandle, List, SizeApproximationFlag...)},
|
|
3289
|
+
* except that it returns approximate number of records and size in memtables.
|
|
3290
|
+
*
|
|
3291
|
+
* @param range the ranges over which to get the memtable stats
|
|
3292
|
+
*
|
|
3293
|
+
* @return the count and size for the range
|
|
3294
|
+
*/
|
|
3295
|
+
public CountAndSize getApproximateMemTableStats(
|
|
3296
|
+
final Range range) {
|
|
3297
|
+
return getApproximateMemTableStats(null, range);
|
|
3298
|
+
}
|
|
3299
|
+
|
|
3300
|
+
/**
|
|
3301
|
+
* <p>Range compaction of database.</p>
|
|
3302
|
+
* <p><strong>Note</strong>: After the database has been compacted,
|
|
3303
|
+
* all data will have been pushed down to the last level containing
|
|
3304
|
+
* any data.</p>
|
|
3305
|
+
*
|
|
3306
|
+
* <p><strong>See also</strong></p>
|
|
3307
|
+
* <ul>
|
|
3308
|
+
* <li>{@link #compactRange(byte[], byte[])}</li>
|
|
3309
|
+
* </ul>
|
|
3310
|
+
*
|
|
3311
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3312
|
+
* part of the library.
|
|
3313
|
+
*/
|
|
3314
|
+
public void compactRange() throws RocksDBException {
|
|
3315
|
+
compactRange(null);
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
/**
|
|
3319
|
+
* <p>Range compaction of column family.</p>
|
|
3320
|
+
* <p><strong>Note</strong>: After the database has been compacted,
|
|
3321
|
+
* all data will have been pushed down to the last level containing
|
|
3322
|
+
* any data.</p>
|
|
3323
|
+
*
|
|
3324
|
+
* <p><strong>See also</strong></p>
|
|
3325
|
+
* <ul>
|
|
3326
|
+
* <li>
|
|
3327
|
+
* {@link #compactRange(ColumnFamilyHandle, byte[], byte[])}
|
|
3328
|
+
* </li>
|
|
3329
|
+
* </ul>
|
|
3330
|
+
*
|
|
3331
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3332
|
+
* instance, or null for the default column family.
|
|
3333
|
+
*
|
|
3334
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3335
|
+
* part of the library.
|
|
3336
|
+
*/
|
|
3337
|
+
public void compactRange(
|
|
3338
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle)
|
|
3339
|
+
throws RocksDBException {
|
|
3340
|
+
compactRange(nativeHandle_, null, -1, null, -1, 0,
|
|
3341
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
/**
|
|
3345
|
+
* <p>Range compaction of database.</p>
|
|
3346
|
+
* <p><strong>Note</strong>: After the database has been compacted,
|
|
3347
|
+
* all data will have been pushed down to the last level containing
|
|
3348
|
+
* any data.</p>
|
|
3349
|
+
*
|
|
3350
|
+
* <p><strong>See also</strong></p>
|
|
3351
|
+
* <ul>
|
|
3352
|
+
* <li>{@link #compactRange()}</li>
|
|
3353
|
+
* </ul>
|
|
3354
|
+
*
|
|
3355
|
+
* @param begin start of key range (included in range)
|
|
3356
|
+
* @param end end of key range (excluded from range)
|
|
3357
|
+
*
|
|
3358
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3359
|
+
* part of the library.
|
|
3360
|
+
*/
|
|
3361
|
+
public void compactRange(final byte[] begin, final byte[] end)
|
|
3362
|
+
throws RocksDBException {
|
|
3363
|
+
compactRange(null, begin, end);
|
|
3364
|
+
}
|
|
3365
|
+
|
|
3366
|
+
/**
|
|
3367
|
+
* <p>Range compaction of column family.</p>
|
|
3368
|
+
* <p><strong>Note</strong>: After the database has been compacted,
|
|
3369
|
+
* all data will have been pushed down to the last level containing
|
|
3370
|
+
* any data.</p>
|
|
3371
|
+
*
|
|
3372
|
+
* <p><strong>See also</strong></p>
|
|
3373
|
+
* <ul>
|
|
3374
|
+
* <li>{@link #compactRange(ColumnFamilyHandle)}</li>
|
|
3375
|
+
* </ul>
|
|
3376
|
+
*
|
|
3377
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3378
|
+
* instance, or null for the default column family.
|
|
3379
|
+
* @param begin start of key range (included in range)
|
|
3380
|
+
* @param end end of key range (excluded from range)
|
|
3381
|
+
*
|
|
3382
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3383
|
+
* part of the library.
|
|
3384
|
+
*/
|
|
3385
|
+
public void compactRange(
|
|
3386
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle,
|
|
3387
|
+
final byte[] begin, final byte[] end) throws RocksDBException {
|
|
3388
|
+
compactRange(nativeHandle_,
|
|
3389
|
+
begin, begin == null ? -1 : begin.length,
|
|
3390
|
+
end, end == null ? -1 : end.length,
|
|
3391
|
+
0, columnFamilyHandle == null ? 0: columnFamilyHandle.nativeHandle_);
|
|
3392
|
+
}
|
|
3393
|
+
|
|
3394
|
+
/**
|
|
3395
|
+
* <p>Range compaction of column family.</p>
|
|
3396
|
+
* <p><strong>Note</strong>: After the database has been compacted,
|
|
3397
|
+
* all data will have been pushed down to the last level containing
|
|
3398
|
+
* any data.</p>
|
|
3399
|
+
*
|
|
3400
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle} instance.
|
|
3401
|
+
* @param begin start of key range (included in range)
|
|
3402
|
+
* @param end end of key range (excluded from range)
|
|
3403
|
+
* @param compactRangeOptions options for the compaction
|
|
3404
|
+
*
|
|
3405
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3406
|
+
* part of the library.
|
|
3407
|
+
*/
|
|
3408
|
+
public void compactRange(
|
|
3409
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle,
|
|
3410
|
+
final byte[] begin, final byte[] end,
|
|
3411
|
+
final CompactRangeOptions compactRangeOptions) throws RocksDBException {
|
|
3412
|
+
compactRange(nativeHandle_,
|
|
3413
|
+
begin, begin == null ? -1 : begin.length,
|
|
3414
|
+
end, end == null ? -1 : end.length,
|
|
3415
|
+
compactRangeOptions.nativeHandle_,
|
|
3416
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3417
|
+
}
|
|
3418
|
+
|
|
3419
|
+
/**
|
|
3420
|
+
* Change the options for the column family handle.
|
|
3421
|
+
*
|
|
3422
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3423
|
+
* instance, or null for the default column family.
|
|
3424
|
+
* @param mutableColumnFamilyOptions the options.
|
|
3425
|
+
*
|
|
3426
|
+
* @throws RocksDBException if an error occurs whilst setting the options
|
|
3427
|
+
*/
|
|
3428
|
+
public void setOptions(
|
|
3429
|
+
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle,
|
|
3430
|
+
final MutableColumnFamilyOptions mutableColumnFamilyOptions)
|
|
3431
|
+
throws RocksDBException {
|
|
3432
|
+
setOptions(nativeHandle_, columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3433
|
+
mutableColumnFamilyOptions.getKeys(), mutableColumnFamilyOptions.getValues());
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
/**
|
|
3437
|
+
* Get the options for the column family handle
|
|
3438
|
+
*
|
|
3439
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle}
|
|
3440
|
+
* instance, or null for the default column family.
|
|
3441
|
+
*
|
|
3442
|
+
* @return the options parsed from the options string return by RocksDB
|
|
3443
|
+
*
|
|
3444
|
+
* @throws RocksDBException if an error occurs while getting the options string, or parsing the
|
|
3445
|
+
* resulting options string into options
|
|
3446
|
+
*/
|
|
3447
|
+
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder getOptions(
|
|
3448
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle) throws RocksDBException {
|
|
3449
|
+
final String optionsString = getOptions(
|
|
3450
|
+
nativeHandle_, columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3451
|
+
return MutableColumnFamilyOptions.parse(optionsString, true);
|
|
3452
|
+
}
|
|
3453
|
+
|
|
3454
|
+
/**
|
|
3455
|
+
* Default column family options
|
|
3456
|
+
*
|
|
3457
|
+
* @return the options parsed from the options string return by RocksDB
|
|
3458
|
+
*
|
|
3459
|
+
* @throws RocksDBException if an error occurs while getting the options string, or parsing the
|
|
3460
|
+
* resulting options string into options
|
|
3461
|
+
*/
|
|
3462
|
+
public MutableColumnFamilyOptions.MutableColumnFamilyOptionsBuilder getOptions()
|
|
3463
|
+
throws RocksDBException {
|
|
3464
|
+
return getOptions(null);
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
/**
|
|
3468
|
+
* Get the database options
|
|
3469
|
+
*
|
|
3470
|
+
* @return the DB options parsed from the options string return by RocksDB
|
|
3471
|
+
*
|
|
3472
|
+
* @throws RocksDBException if an error occurs while getting the options string, or parsing the
|
|
3473
|
+
* resulting options string into options
|
|
3474
|
+
*/
|
|
3475
|
+
public MutableDBOptions.MutableDBOptionsBuilder getDBOptions() throws RocksDBException {
|
|
3476
|
+
final String optionsString = getDBOptions(nativeHandle_);
|
|
3477
|
+
return MutableDBOptions.parse(optionsString, true);
|
|
3478
|
+
}
|
|
3479
|
+
|
|
3480
|
+
/**
|
|
3481
|
+
* Change the options for the default column family handle.
|
|
3482
|
+
*
|
|
3483
|
+
* @param mutableColumnFamilyOptions the options.
|
|
3484
|
+
*
|
|
3485
|
+
* @throws RocksDBException if an error occurs whilst setting the options
|
|
3486
|
+
*/
|
|
3487
|
+
public void setOptions(
|
|
3488
|
+
final MutableColumnFamilyOptions mutableColumnFamilyOptions)
|
|
3489
|
+
throws RocksDBException {
|
|
3490
|
+
setOptions(null, mutableColumnFamilyOptions);
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
/**
|
|
3494
|
+
* Set the options for the column family handle.
|
|
3495
|
+
*
|
|
3496
|
+
* @param mutableDBoptions the options.
|
|
3497
|
+
*
|
|
3498
|
+
* @throws RocksDBException if an error occurs whilst setting the options
|
|
3499
|
+
*/
|
|
3500
|
+
public void setDBOptions(final MutableDBOptions mutableDBoptions)
|
|
3501
|
+
throws RocksDBException {
|
|
3502
|
+
setDBOptions(nativeHandle_,
|
|
3503
|
+
mutableDBoptions.getKeys(),
|
|
3504
|
+
mutableDBoptions.getValues());
|
|
3505
|
+
}
|
|
3506
|
+
|
|
3507
|
+
/**
|
|
3508
|
+
* Takes a list of files specified by file names and
|
|
3509
|
+
* compacts them to the specified level.
|
|
3510
|
+
* <p>
|
|
3511
|
+
* Note that the behavior is different from
|
|
3512
|
+
* {@link #compactRange(ColumnFamilyHandle, byte[], byte[])}
|
|
3513
|
+
* in that CompactFiles() performs the compaction job using the CURRENT
|
|
3514
|
+
* thread.
|
|
3515
|
+
*
|
|
3516
|
+
* @param compactionOptions compaction options
|
|
3517
|
+
* @param inputFileNames the name of the files to compact
|
|
3518
|
+
* @param outputLevel the level to which they should be compacted
|
|
3519
|
+
* @param outputPathId the id of the output path, or -1
|
|
3520
|
+
* @param compactionJobInfo the compaction job info, this parameter
|
|
3521
|
+
* will be updated with the info from compacting the files,
|
|
3522
|
+
* can just be null if you don't need it.
|
|
3523
|
+
*
|
|
3524
|
+
* @return the list of compacted files
|
|
3525
|
+
*
|
|
3526
|
+
* @throws RocksDBException if an error occurs during compaction
|
|
3527
|
+
*/
|
|
3528
|
+
public List<String> compactFiles(
|
|
3529
|
+
final CompactionOptions compactionOptions,
|
|
3530
|
+
final List<String> inputFileNames,
|
|
3531
|
+
final int outputLevel,
|
|
3532
|
+
final int outputPathId,
|
|
3533
|
+
/* @Nullable */ final CompactionJobInfo compactionJobInfo)
|
|
3534
|
+
throws RocksDBException {
|
|
3535
|
+
return compactFiles(compactionOptions, null, inputFileNames, outputLevel,
|
|
3536
|
+
outputPathId, compactionJobInfo);
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
/**
|
|
3540
|
+
* Takes a list of files specified by file names and
|
|
3541
|
+
* compacts them to the specified level.
|
|
3542
|
+
* <p>
|
|
3543
|
+
* Note that the behavior is different from
|
|
3544
|
+
* {@link #compactRange(ColumnFamilyHandle, byte[], byte[])}
|
|
3545
|
+
* in that CompactFiles() performs the compaction job using the CURRENT
|
|
3546
|
+
* thread.
|
|
3547
|
+
*
|
|
3548
|
+
* @param compactionOptions compaction options
|
|
3549
|
+
* @param columnFamilyHandle columnFamilyHandle, or null for the
|
|
3550
|
+
* default column family
|
|
3551
|
+
* @param inputFileNames the name of the files to compact
|
|
3552
|
+
* @param outputLevel the level to which they should be compacted
|
|
3553
|
+
* @param outputPathId the id of the output path, or -1
|
|
3554
|
+
* @param compactionJobInfo the compaction job info, this parameter
|
|
3555
|
+
* will be updated with the info from compacting the files,
|
|
3556
|
+
* can just be null if you don't need it.
|
|
3557
|
+
*
|
|
3558
|
+
* @return the list of compacted files
|
|
3559
|
+
*
|
|
3560
|
+
* @throws RocksDBException if an error occurs during compaction
|
|
3561
|
+
*/
|
|
3562
|
+
public List<String> compactFiles(
|
|
3563
|
+
final CompactionOptions compactionOptions,
|
|
3564
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle,
|
|
3565
|
+
final List<String> inputFileNames,
|
|
3566
|
+
final int outputLevel,
|
|
3567
|
+
final int outputPathId,
|
|
3568
|
+
/* @Nullable */ final CompactionJobInfo compactionJobInfo)
|
|
3569
|
+
throws RocksDBException {
|
|
3570
|
+
return Arrays.asList(compactFiles(nativeHandle_, compactionOptions.nativeHandle_,
|
|
3571
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
3572
|
+
inputFileNames.toArray(new String[0]),
|
|
3573
|
+
outputLevel,
|
|
3574
|
+
outputPathId,
|
|
3575
|
+
compactionJobInfo == null ? 0 : compactionJobInfo.nativeHandle_));
|
|
3576
|
+
}
|
|
3577
|
+
|
|
3578
|
+
/**
|
|
3579
|
+
* This function will cancel all currently running background processes.
|
|
3580
|
+
*
|
|
3581
|
+
* @param wait if true, wait for all background work to be cancelled before
|
|
3582
|
+
* returning.
|
|
3583
|
+
*
|
|
3584
|
+
*/
|
|
3585
|
+
public void cancelAllBackgroundWork(final boolean wait) {
|
|
3586
|
+
cancelAllBackgroundWork(nativeHandle_, wait);
|
|
3587
|
+
}
|
|
3588
|
+
|
|
3589
|
+
/**
|
|
3590
|
+
* This function will wait until all currently running background processes
|
|
3591
|
+
* finish. After it returns, no background process will be run until
|
|
3592
|
+
* {@link #continueBackgroundWork()} is called
|
|
3593
|
+
*
|
|
3594
|
+
* @throws RocksDBException if an error occurs when pausing background work
|
|
3595
|
+
*/
|
|
3596
|
+
public void pauseBackgroundWork() throws RocksDBException {
|
|
3597
|
+
pauseBackgroundWork(nativeHandle_);
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3600
|
+
/**
|
|
3601
|
+
* Resumes background work which was suspended by
|
|
3602
|
+
* previously calling {@link #pauseBackgroundWork()}
|
|
3603
|
+
*
|
|
3604
|
+
* @throws RocksDBException if an error occurs when resuming background work
|
|
3605
|
+
*/
|
|
3606
|
+
public void continueBackgroundWork() throws RocksDBException {
|
|
3607
|
+
continueBackgroundWork(nativeHandle_);
|
|
3608
|
+
}
|
|
3609
|
+
|
|
3610
|
+
/**
|
|
3611
|
+
* Enable automatic compactions for the given column
|
|
3612
|
+
* families if they were previously disabled.
|
|
3613
|
+
* <p>
|
|
3614
|
+
* The function will first set the
|
|
3615
|
+
* {@link ColumnFamilyOptions#disableAutoCompactions()} option for each
|
|
3616
|
+
* column family to false, after which it will schedule a flush/compaction.
|
|
3617
|
+
* <p>
|
|
3618
|
+
* NOTE: Setting disableAutoCompactions to 'false' through
|
|
3619
|
+
* {@link #setOptions(ColumnFamilyHandle, MutableColumnFamilyOptions)}
|
|
3620
|
+
* does NOT schedule a flush/compaction afterwards, and only changes the
|
|
3621
|
+
* parameter itself within the column family option.
|
|
3622
|
+
*
|
|
3623
|
+
* @param columnFamilyHandles the column family handles
|
|
3624
|
+
*
|
|
3625
|
+
* @throws RocksDBException if an error occurs whilst enabling auto-compaction
|
|
3626
|
+
*/
|
|
3627
|
+
public void enableAutoCompaction(
|
|
3628
|
+
final List<ColumnFamilyHandle> columnFamilyHandles)
|
|
3629
|
+
throws RocksDBException {
|
|
3630
|
+
enableAutoCompaction(nativeHandle_,
|
|
3631
|
+
toNativeHandleList(columnFamilyHandles));
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
/**
|
|
3635
|
+
* Number of levels used for this DB.
|
|
3636
|
+
*
|
|
3637
|
+
* @return the number of levels
|
|
3638
|
+
*/
|
|
3639
|
+
public int numberLevels() {
|
|
3640
|
+
return numberLevels(null);
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
/**
|
|
3644
|
+
* Number of levels used for a column family in this DB.
|
|
3645
|
+
*
|
|
3646
|
+
* @param columnFamilyHandle the column family handle, or null
|
|
3647
|
+
* for the default column family
|
|
3648
|
+
*
|
|
3649
|
+
* @return the number of levels
|
|
3650
|
+
*/
|
|
3651
|
+
public int numberLevels(/* @Nullable */final ColumnFamilyHandle columnFamilyHandle) {
|
|
3652
|
+
return numberLevels(nativeHandle_,
|
|
3653
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3654
|
+
}
|
|
3655
|
+
|
|
3656
|
+
/**
|
|
3657
|
+
* Maximum level to which a new compacted memtable is pushed if it
|
|
3658
|
+
* does not create overlap.
|
|
3659
|
+
*
|
|
3660
|
+
* @return the maximum level
|
|
3661
|
+
*/
|
|
3662
|
+
public int maxMemCompactionLevel() {
|
|
3663
|
+
return maxMemCompactionLevel(null);
|
|
3664
|
+
}
|
|
3665
|
+
|
|
3666
|
+
/**
|
|
3667
|
+
* Maximum level to which a new compacted memtable is pushed if it
|
|
3668
|
+
* does not create overlap.
|
|
3669
|
+
*
|
|
3670
|
+
* @param columnFamilyHandle the column family handle
|
|
3671
|
+
*
|
|
3672
|
+
* @return the maximum level
|
|
3673
|
+
*/
|
|
3674
|
+
public int maxMemCompactionLevel(
|
|
3675
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle) {
|
|
3676
|
+
return maxMemCompactionLevel(nativeHandle_,
|
|
3677
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3678
|
+
}
|
|
3679
|
+
|
|
3680
|
+
/**
|
|
3681
|
+
* Number of files in level-0 that would stop writes.
|
|
3682
|
+
*
|
|
3683
|
+
* @return the number of files
|
|
3684
|
+
*/
|
|
3685
|
+
public int level0StopWriteTrigger() {
|
|
3686
|
+
return level0StopWriteTrigger(null);
|
|
3687
|
+
}
|
|
3688
|
+
|
|
3689
|
+
/**
|
|
3690
|
+
* Number of files in level-0 that would stop writes.
|
|
3691
|
+
*
|
|
3692
|
+
* @param columnFamilyHandle the column family handle
|
|
3693
|
+
*
|
|
3694
|
+
* @return the number of files
|
|
3695
|
+
*/
|
|
3696
|
+
public int level0StopWriteTrigger(
|
|
3697
|
+
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle) {
|
|
3698
|
+
return level0StopWriteTrigger(nativeHandle_,
|
|
3699
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3700
|
+
}
|
|
3701
|
+
|
|
3702
|
+
/**
|
|
3703
|
+
* Get DB name -- the exact same name that was provided as an argument to
|
|
3704
|
+
* as path to {@link #open(Options, String)}.
|
|
3705
|
+
*
|
|
3706
|
+
* @return the DB name
|
|
3707
|
+
*/
|
|
3708
|
+
public String getName() {
|
|
3709
|
+
return getName(nativeHandle_);
|
|
3710
|
+
}
|
|
3711
|
+
|
|
3712
|
+
/**
|
|
3713
|
+
* Get the Env object from the DB
|
|
3714
|
+
*
|
|
3715
|
+
* @return the env
|
|
3716
|
+
*/
|
|
3717
|
+
public Env getEnv() {
|
|
3718
|
+
final long envHandle = getEnv(nativeHandle_);
|
|
3719
|
+
if (envHandle == Env.getDefault().nativeHandle_) {
|
|
3720
|
+
return Env.getDefault();
|
|
3721
|
+
} else {
|
|
3722
|
+
final Env env = new RocksEnv(envHandle);
|
|
3723
|
+
env.disOwnNativeHandle(); // we do not own the Env!
|
|
3724
|
+
return env;
|
|
3725
|
+
}
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
/**
|
|
3729
|
+
* <p>Flush all memory table data.</p>
|
|
3730
|
+
*
|
|
3731
|
+
* <p>Note: it must be ensured that the FlushOptions instance
|
|
3732
|
+
* is not GC'ed before this method finishes. If the wait parameter is
|
|
3733
|
+
* set to false, flush processing is asynchronous.</p>
|
|
3734
|
+
*
|
|
3735
|
+
* @param flushOptions {@link org.rocksdb.FlushOptions} instance.
|
|
3736
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3737
|
+
* part of the library.
|
|
3738
|
+
*/
|
|
3739
|
+
public void flush(final FlushOptions flushOptions)
|
|
3740
|
+
throws RocksDBException {
|
|
3741
|
+
flush(flushOptions, (List<ColumnFamilyHandle>) null);
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
/**
|
|
3745
|
+
* <p>Flush all memory table data.</p>
|
|
3746
|
+
*
|
|
3747
|
+
* <p>Note: it must be ensured that the FlushOptions instance
|
|
3748
|
+
* is not GC'ed before this method finishes. If the wait parameter is
|
|
3749
|
+
* set to false, flush processing is asynchronous.</p>
|
|
3750
|
+
*
|
|
3751
|
+
* @param flushOptions {@link org.rocksdb.FlushOptions} instance.
|
|
3752
|
+
* @param columnFamilyHandle {@link org.rocksdb.ColumnFamilyHandle} instance.
|
|
3753
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3754
|
+
* part of the library.
|
|
3755
|
+
*/
|
|
3756
|
+
public void flush(final FlushOptions flushOptions,
|
|
3757
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle)
|
|
3758
|
+
throws RocksDBException {
|
|
3759
|
+
flush(flushOptions,
|
|
3760
|
+
columnFamilyHandle == null ? null : Collections.singletonList(columnFamilyHandle));
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
/**
|
|
3764
|
+
* Flushes multiple column families.
|
|
3765
|
+
* <p>
|
|
3766
|
+
* If atomic flush is not enabled, this is equivalent to calling
|
|
3767
|
+
* {@link #flush(FlushOptions, ColumnFamilyHandle)} multiple times.
|
|
3768
|
+
* <p>
|
|
3769
|
+
* If atomic flush is enabled, this will flush all column families
|
|
3770
|
+
* specified up to the latest sequence number at the time when flush is
|
|
3771
|
+
* requested.
|
|
3772
|
+
*
|
|
3773
|
+
* @param flushOptions {@link org.rocksdb.FlushOptions} instance.
|
|
3774
|
+
* @param columnFamilyHandles column family handles.
|
|
3775
|
+
* @throws RocksDBException thrown if an error occurs within the native
|
|
3776
|
+
* part of the library.
|
|
3777
|
+
*/
|
|
3778
|
+
public void flush(final FlushOptions flushOptions,
|
|
3779
|
+
/* @Nullable */ final List<ColumnFamilyHandle> columnFamilyHandles)
|
|
3780
|
+
throws RocksDBException {
|
|
3781
|
+
flush(nativeHandle_, flushOptions.nativeHandle_,
|
|
3782
|
+
toNativeHandleList(columnFamilyHandles));
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
/**
|
|
3786
|
+
* Flush the WAL memory buffer to the file. If {@code sync} is true,
|
|
3787
|
+
* it calls {@link #syncWal()} afterwards.
|
|
3788
|
+
*
|
|
3789
|
+
* @param sync true to also fsync to disk.
|
|
3790
|
+
*
|
|
3791
|
+
* @throws RocksDBException if an error occurs whilst flushing
|
|
3792
|
+
*/
|
|
3793
|
+
public void flushWal(final boolean sync) throws RocksDBException {
|
|
3794
|
+
flushWal(nativeHandle_, sync);
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
/**
|
|
3798
|
+
* Sync the WAL.
|
|
3799
|
+
* <p>
|
|
3800
|
+
* Note that {@link #write(WriteOptions, WriteBatch)} followed by
|
|
3801
|
+
* {@code #syncWal()} is not exactly the same as
|
|
3802
|
+
* {@link #write(WriteOptions, WriteBatch)} with
|
|
3803
|
+
* {@link WriteOptions#sync()} set to true; In the latter case the changes
|
|
3804
|
+
* won't be visible until the sync is done.
|
|
3805
|
+
* <p>
|
|
3806
|
+
* Currently only works if {@link Options#allowMmapWrites()} is set to false.
|
|
3807
|
+
*
|
|
3808
|
+
* @throws RocksDBException if an error occurs whilst syncing
|
|
3809
|
+
*/
|
|
3810
|
+
public void syncWal() throws RocksDBException {
|
|
3811
|
+
syncWal(nativeHandle_);
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
/**
|
|
3815
|
+
* <p>The sequence number of the most recent transaction.</p>
|
|
3816
|
+
*
|
|
3817
|
+
* @return sequence number of the most
|
|
3818
|
+
* recent transaction.
|
|
3819
|
+
*/
|
|
3820
|
+
public long getLatestSequenceNumber() {
|
|
3821
|
+
return getLatestSequenceNumber(nativeHandle_);
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
/**
|
|
3825
|
+
* <p>Prevent file deletions. Compactions will continue to occur,
|
|
3826
|
+
* but no obsolete files will be deleted. Calling this multiple
|
|
3827
|
+
* times have the same effect as calling it once.</p>
|
|
3828
|
+
*
|
|
3829
|
+
* @throws RocksDBException thrown if operation was not performed
|
|
3830
|
+
* successfully.
|
|
3831
|
+
*/
|
|
3832
|
+
public void disableFileDeletions() throws RocksDBException {
|
|
3833
|
+
disableFileDeletions(nativeHandle_);
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
/**
|
|
3837
|
+
* <p>Allow compactions to delete obsolete files.
|
|
3838
|
+
* If force == true, the call to EnableFileDeletions()
|
|
3839
|
+
* will guarantee that file deletions are enabled after
|
|
3840
|
+
* the call, even if DisableFileDeletions() was called
|
|
3841
|
+
* multiple times before.</p>
|
|
3842
|
+
*
|
|
3843
|
+
* <p>If force == false, EnableFileDeletions will only
|
|
3844
|
+
* enable file deletion after it's been called at least
|
|
3845
|
+
* as many times as DisableFileDeletions(), enabling
|
|
3846
|
+
* the two methods to be called by two threads
|
|
3847
|
+
* concurrently without synchronization
|
|
3848
|
+
* -- i.e., file deletions will be enabled only after both
|
|
3849
|
+
* threads call EnableFileDeletions()</p>
|
|
3850
|
+
*
|
|
3851
|
+
* @param force boolean value described above.
|
|
3852
|
+
*
|
|
3853
|
+
* @throws RocksDBException thrown if operation was not performed
|
|
3854
|
+
* successfully.
|
|
3855
|
+
*/
|
|
3856
|
+
public void enableFileDeletions(final boolean force)
|
|
3857
|
+
throws RocksDBException {
|
|
3858
|
+
enableFileDeletions(nativeHandle_, force);
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
public static class LiveFiles {
|
|
3862
|
+
/**
|
|
3863
|
+
* The valid size of the manifest file. The manifest file is an ever growing
|
|
3864
|
+
* file, but only the portion specified here is valid for this snapshot.
|
|
3865
|
+
*/
|
|
3866
|
+
public final long manifestFileSize;
|
|
3867
|
+
|
|
3868
|
+
/**
|
|
3869
|
+
* The files are relative to the {@link #getName()} and are not
|
|
3870
|
+
* absolute paths. Despite being relative paths, the file names begin
|
|
3871
|
+
* with "/".
|
|
3872
|
+
*/
|
|
3873
|
+
public final List<String> files;
|
|
3874
|
+
|
|
3875
|
+
LiveFiles(final long manifestFileSize, final List<String> files) {
|
|
3876
|
+
this.manifestFileSize = manifestFileSize;
|
|
3877
|
+
this.files = files;
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3881
|
+
/**
|
|
3882
|
+
* Retrieve the list of all files in the database after flushing the memtable.
|
|
3883
|
+
* <p>
|
|
3884
|
+
* See {@link #getLiveFiles(boolean)}.
|
|
3885
|
+
*
|
|
3886
|
+
* @return the live files
|
|
3887
|
+
*
|
|
3888
|
+
* @throws RocksDBException if an error occurs whilst retrieving the list
|
|
3889
|
+
* of live files
|
|
3890
|
+
*/
|
|
3891
|
+
public LiveFiles getLiveFiles() throws RocksDBException {
|
|
3892
|
+
return getLiveFiles(true);
|
|
3893
|
+
}
|
|
3894
|
+
|
|
3895
|
+
/**
|
|
3896
|
+
* Retrieve the list of all files in the database.
|
|
3897
|
+
* <p>
|
|
3898
|
+
* In case you have multiple column families, even if {@code flushMemtable}
|
|
3899
|
+
* is true, you still need to call {@link #getSortedWalFiles()}
|
|
3900
|
+
* after {@code #getLiveFiles(boolean)} to compensate for new data that
|
|
3901
|
+
* arrived to already-flushed column families while other column families
|
|
3902
|
+
* were flushing.
|
|
3903
|
+
* <p>
|
|
3904
|
+
* NOTE: Calling {@code #getLiveFiles(boolean)} followed by
|
|
3905
|
+
* {@link #getSortedWalFiles()} can generate a lossless backup.
|
|
3906
|
+
*
|
|
3907
|
+
* @param flushMemtable set to true to flush before recoding the live
|
|
3908
|
+
* files. Setting to false is useful when we don't want to wait for flush
|
|
3909
|
+
* which may have to wait for compaction to complete taking an
|
|
3910
|
+
* indeterminate time.
|
|
3911
|
+
*
|
|
3912
|
+
* @return the live files
|
|
3913
|
+
*
|
|
3914
|
+
* @throws RocksDBException if an error occurs whilst retrieving the list
|
|
3915
|
+
* of live files
|
|
3916
|
+
*/
|
|
3917
|
+
public LiveFiles getLiveFiles(final boolean flushMemtable)
|
|
3918
|
+
throws RocksDBException {
|
|
3919
|
+
final String[] result = getLiveFiles(nativeHandle_, flushMemtable);
|
|
3920
|
+
if (result == null) {
|
|
3921
|
+
return null;
|
|
3922
|
+
}
|
|
3923
|
+
final String[] files = Arrays.copyOf(result, result.length - 1);
|
|
3924
|
+
final long manifestFileSize = Long.parseLong(result[result.length - 1]);
|
|
3925
|
+
|
|
3926
|
+
return new LiveFiles(manifestFileSize, Arrays.asList(files));
|
|
3927
|
+
}
|
|
3928
|
+
|
|
3929
|
+
/**
|
|
3930
|
+
* Retrieve the sorted list of all wal files with earliest file first.
|
|
3931
|
+
*
|
|
3932
|
+
* @return the log files
|
|
3933
|
+
*
|
|
3934
|
+
* @throws RocksDBException if an error occurs whilst retrieving the list
|
|
3935
|
+
* of sorted WAL files
|
|
3936
|
+
*/
|
|
3937
|
+
public List<LogFile> getSortedWalFiles() throws RocksDBException {
|
|
3938
|
+
final LogFile[] logFiles = getSortedWalFiles(nativeHandle_);
|
|
3939
|
+
return Arrays.asList(logFiles);
|
|
3940
|
+
}
|
|
3941
|
+
|
|
3942
|
+
/**
|
|
3943
|
+
* <p>Returns an iterator that is positioned at a write-batch containing
|
|
3944
|
+
* seq_number. If the sequence number is non existent, it returns an iterator
|
|
3945
|
+
* at the first available seq_no after the requested seq_no.</p>
|
|
3946
|
+
*
|
|
3947
|
+
* <p>Must set WAL_ttl_seconds or WAL_size_limit_MB to large values to
|
|
3948
|
+
* use this api, else the WAL files will get
|
|
3949
|
+
* cleared aggressively and the iterator might keep getting invalid before
|
|
3950
|
+
* an update is read.</p>
|
|
3951
|
+
*
|
|
3952
|
+
* @param sequenceNumber sequence number offset
|
|
3953
|
+
*
|
|
3954
|
+
* @return {@link org.rocksdb.TransactionLogIterator} instance.
|
|
3955
|
+
*
|
|
3956
|
+
* @throws org.rocksdb.RocksDBException if iterator cannot be retrieved
|
|
3957
|
+
* from native-side.
|
|
3958
|
+
*/
|
|
3959
|
+
public TransactionLogIterator getUpdatesSince(final long sequenceNumber)
|
|
3960
|
+
throws RocksDBException {
|
|
3961
|
+
return new TransactionLogIterator(
|
|
3962
|
+
getUpdatesSince(nativeHandle_, sequenceNumber));
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
/**
|
|
3966
|
+
* Delete the file name from the db directory and update the internal state to
|
|
3967
|
+
* reflect that. Supports deletion of sst and log files only. 'name' must be
|
|
3968
|
+
* path relative to the db directory. eg. 000001.sst, /archive/000003.log
|
|
3969
|
+
*
|
|
3970
|
+
* @param name the file name
|
|
3971
|
+
*
|
|
3972
|
+
* @throws RocksDBException if an error occurs whilst deleting the file
|
|
3973
|
+
*/
|
|
3974
|
+
public void deleteFile(final String name) throws RocksDBException {
|
|
3975
|
+
deleteFile(nativeHandle_, name);
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3978
|
+
/**
|
|
3979
|
+
* Gets a list of all table files metadata.
|
|
3980
|
+
*
|
|
3981
|
+
* @return table files metadata.
|
|
3982
|
+
*/
|
|
3983
|
+
public List<LiveFileMetaData> getLiveFilesMetaData() {
|
|
3984
|
+
return Arrays.asList(getLiveFilesMetaData(nativeHandle_));
|
|
3985
|
+
}
|
|
3986
|
+
|
|
3987
|
+
/**
|
|
3988
|
+
* Obtains the meta data of the specified column family of the DB.
|
|
3989
|
+
*
|
|
3990
|
+
* @param columnFamilyHandle the column family
|
|
3991
|
+
*
|
|
3992
|
+
* @return the column family metadata
|
|
3993
|
+
*/
|
|
3994
|
+
public ColumnFamilyMetaData getColumnFamilyMetaData(
|
|
3995
|
+
/* @Nullable */ final ColumnFamilyHandle columnFamilyHandle) {
|
|
3996
|
+
return getColumnFamilyMetaData(nativeHandle_,
|
|
3997
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
3998
|
+
}
|
|
3999
|
+
|
|
4000
|
+
/**
|
|
4001
|
+
* Obtains the meta data of the default column family of the DB.
|
|
4002
|
+
*
|
|
4003
|
+
* @return the column family metadata
|
|
4004
|
+
*/
|
|
4005
|
+
public ColumnFamilyMetaData getColumnFamilyMetaData() {
|
|
4006
|
+
return getColumnFamilyMetaData(null);
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
/**
|
|
4010
|
+
* ingestExternalFile will load a list of external SST files (1) into the DB
|
|
4011
|
+
* We will try to find the lowest possible level that the file can fit in, and
|
|
4012
|
+
* ingest the file into this level (2). A file that have a key range that
|
|
4013
|
+
* overlap with the memtable key range will require us to Flush the memtable
|
|
4014
|
+
* first before ingesting the file.
|
|
4015
|
+
* <p>
|
|
4016
|
+
* (1) External SST files can be created using {@link SstFileWriter}
|
|
4017
|
+
* (2) We will try to ingest the files to the lowest possible level
|
|
4018
|
+
* even if the file compression doesn't match the level compression
|
|
4019
|
+
*
|
|
4020
|
+
* @param filePathList The list of files to ingest
|
|
4021
|
+
* @param ingestExternalFileOptions the options for the ingestion
|
|
4022
|
+
*
|
|
4023
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
4024
|
+
* native library.
|
|
4025
|
+
*/
|
|
4026
|
+
public void ingestExternalFile(final List<String> filePathList,
|
|
4027
|
+
final IngestExternalFileOptions ingestExternalFileOptions)
|
|
4028
|
+
throws RocksDBException {
|
|
4029
|
+
ingestExternalFile(nativeHandle_, getDefaultColumnFamily().nativeHandle_,
|
|
4030
|
+
filePathList.toArray(new String[0]),
|
|
4031
|
+
filePathList.size(), ingestExternalFileOptions.nativeHandle_);
|
|
4032
|
+
}
|
|
4033
|
+
|
|
4034
|
+
/**
|
|
4035
|
+
* ingestExternalFile will load a list of external SST files (1) into the DB
|
|
4036
|
+
* We will try to find the lowest possible level that the file can fit in, and
|
|
4037
|
+
* ingest the file into this level (2). A file that have a key range that
|
|
4038
|
+
* overlap with the memtable key range will require us to Flush the memtable
|
|
4039
|
+
* first before ingesting the file.
|
|
4040
|
+
* <p>
|
|
4041
|
+
* (1) External SST files can be created using {@link SstFileWriter}
|
|
4042
|
+
* (2) We will try to ingest the files to the lowest possible level
|
|
4043
|
+
* even if the file compression doesn't match the level compression
|
|
4044
|
+
*
|
|
4045
|
+
* @param columnFamilyHandle The column family for the ingested files
|
|
4046
|
+
* @param filePathList The list of files to ingest
|
|
4047
|
+
* @param ingestExternalFileOptions the options for the ingestion
|
|
4048
|
+
*
|
|
4049
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
4050
|
+
* native library.
|
|
4051
|
+
*/
|
|
4052
|
+
public void ingestExternalFile(final ColumnFamilyHandle columnFamilyHandle,
|
|
4053
|
+
final List<String> filePathList,
|
|
4054
|
+
final IngestExternalFileOptions ingestExternalFileOptions)
|
|
4055
|
+
throws RocksDBException {
|
|
4056
|
+
ingestExternalFile(nativeHandle_, columnFamilyHandle.nativeHandle_,
|
|
4057
|
+
filePathList.toArray(new String[0]),
|
|
4058
|
+
filePathList.size(), ingestExternalFileOptions.nativeHandle_);
|
|
4059
|
+
}
|
|
4060
|
+
|
|
4061
|
+
/**
|
|
4062
|
+
* Verify checksum
|
|
4063
|
+
*
|
|
4064
|
+
* @throws RocksDBException if the checksum is not valid
|
|
4065
|
+
*/
|
|
4066
|
+
public void verifyChecksum() throws RocksDBException {
|
|
4067
|
+
verifyChecksum(nativeHandle_);
|
|
4068
|
+
}
|
|
4069
|
+
|
|
4070
|
+
/**
|
|
4071
|
+
* Gets the handle for the default column family
|
|
4072
|
+
*
|
|
4073
|
+
* @return The handle of the default column family
|
|
4074
|
+
*/
|
|
4075
|
+
public ColumnFamilyHandle getDefaultColumnFamily() {
|
|
4076
|
+
final ColumnFamilyHandle cfHandle = new ColumnFamilyHandle(this,
|
|
4077
|
+
getDefaultColumnFamily(nativeHandle_));
|
|
4078
|
+
cfHandle.disOwnNativeHandle();
|
|
4079
|
+
return cfHandle;
|
|
4080
|
+
}
|
|
4081
|
+
|
|
4082
|
+
/**
|
|
4083
|
+
* Get the properties of all tables.
|
|
4084
|
+
*
|
|
4085
|
+
* @param columnFamilyHandle the column family handle, or null for the default
|
|
4086
|
+
* column family.
|
|
4087
|
+
*
|
|
4088
|
+
* @return the properties
|
|
4089
|
+
*
|
|
4090
|
+
* @throws RocksDBException if an error occurs whilst getting the properties
|
|
4091
|
+
*/
|
|
4092
|
+
public Map<String, TableProperties> getPropertiesOfAllTables(
|
|
4093
|
+
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle)
|
|
4094
|
+
throws RocksDBException {
|
|
4095
|
+
return getPropertiesOfAllTables(nativeHandle_,
|
|
4096
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
4097
|
+
}
|
|
4098
|
+
|
|
4099
|
+
/**
|
|
4100
|
+
* Get the properties of all tables in the default column family.
|
|
4101
|
+
*
|
|
4102
|
+
* @return the properties
|
|
4103
|
+
*
|
|
4104
|
+
* @throws RocksDBException if an error occurs whilst getting the properties
|
|
4105
|
+
*/
|
|
4106
|
+
public Map<String, TableProperties> getPropertiesOfAllTables()
|
|
4107
|
+
throws RocksDBException {
|
|
4108
|
+
return getPropertiesOfAllTables(null);
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
/**
|
|
4112
|
+
* Get the properties of tables in range.
|
|
4113
|
+
*
|
|
4114
|
+
* @param columnFamilyHandle the column family handle, or null for the default
|
|
4115
|
+
* column family.
|
|
4116
|
+
* @param ranges the ranges over which to get the table properties
|
|
4117
|
+
*
|
|
4118
|
+
* @return the properties
|
|
4119
|
+
*
|
|
4120
|
+
* @throws RocksDBException if an error occurs whilst getting the properties
|
|
4121
|
+
*/
|
|
4122
|
+
public Map<String, TableProperties> getPropertiesOfTablesInRange(
|
|
4123
|
+
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle,
|
|
4124
|
+
final List<Range> ranges) throws RocksDBException {
|
|
4125
|
+
return getPropertiesOfTablesInRange(nativeHandle_,
|
|
4126
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
4127
|
+
toRangeSliceHandles(ranges));
|
|
4128
|
+
}
|
|
4129
|
+
|
|
4130
|
+
/**
|
|
4131
|
+
* Get the properties of tables in range for the default column family.
|
|
4132
|
+
*
|
|
4133
|
+
* @param ranges the ranges over which to get the table properties
|
|
4134
|
+
*
|
|
4135
|
+
* @return the properties
|
|
4136
|
+
*
|
|
4137
|
+
* @throws RocksDBException if an error occurs whilst getting the properties
|
|
4138
|
+
*/
|
|
4139
|
+
public Map<String, TableProperties> getPropertiesOfTablesInRange(
|
|
4140
|
+
final List<Range> ranges) throws RocksDBException {
|
|
4141
|
+
return getPropertiesOfTablesInRange(null, ranges);
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
/**
|
|
4145
|
+
* Suggest the range to compact.
|
|
4146
|
+
*
|
|
4147
|
+
* @param columnFamilyHandle the column family handle, or null for the default
|
|
4148
|
+
* column family.
|
|
4149
|
+
*
|
|
4150
|
+
* @return the suggested range.
|
|
4151
|
+
*
|
|
4152
|
+
* @throws RocksDBException if an error occurs whilst suggesting the range
|
|
4153
|
+
*/
|
|
4154
|
+
public Range suggestCompactRange(
|
|
4155
|
+
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle)
|
|
4156
|
+
throws RocksDBException {
|
|
4157
|
+
final long[] rangeSliceHandles = suggestCompactRange(nativeHandle_,
|
|
4158
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_);
|
|
4159
|
+
return new Range(new Slice(rangeSliceHandles[0]),
|
|
4160
|
+
new Slice(rangeSliceHandles[1]));
|
|
4161
|
+
}
|
|
4162
|
+
|
|
4163
|
+
/**
|
|
4164
|
+
* Suggest the range to compact for the default column family.
|
|
4165
|
+
*
|
|
4166
|
+
* @return the suggested range.
|
|
4167
|
+
*
|
|
4168
|
+
* @throws RocksDBException if an error occurs whilst suggesting the range
|
|
4169
|
+
*/
|
|
4170
|
+
public Range suggestCompactRange()
|
|
4171
|
+
throws RocksDBException {
|
|
4172
|
+
return suggestCompactRange(null);
|
|
4173
|
+
}
|
|
4174
|
+
|
|
4175
|
+
/**
|
|
4176
|
+
* Promote L0.
|
|
4177
|
+
*
|
|
4178
|
+
* @param columnFamilyHandle the column family handle,
|
|
4179
|
+
* or null for the default column family.
|
|
4180
|
+
* @param targetLevel the target level for L0
|
|
4181
|
+
*
|
|
4182
|
+
* @throws RocksDBException if an error occurs whilst promoting L0
|
|
4183
|
+
*/
|
|
4184
|
+
public void promoteL0(
|
|
4185
|
+
/* @Nullable */final ColumnFamilyHandle columnFamilyHandle,
|
|
4186
|
+
final int targetLevel) throws RocksDBException {
|
|
4187
|
+
promoteL0(nativeHandle_,
|
|
4188
|
+
columnFamilyHandle == null ? 0 : columnFamilyHandle.nativeHandle_,
|
|
4189
|
+
targetLevel);
|
|
4190
|
+
}
|
|
4191
|
+
|
|
4192
|
+
/**
|
|
4193
|
+
* Promote L0 for the default column family.
|
|
4194
|
+
*
|
|
4195
|
+
* @param targetLevel the target level for L0
|
|
4196
|
+
*
|
|
4197
|
+
* @throws RocksDBException if an error occurs whilst promoting L0
|
|
4198
|
+
*/
|
|
4199
|
+
public void promoteL0(final int targetLevel)
|
|
4200
|
+
throws RocksDBException {
|
|
4201
|
+
promoteL0(null, targetLevel);
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
/**
|
|
4205
|
+
* Trace DB operations.
|
|
4206
|
+
* <p>
|
|
4207
|
+
* Use {@link #endTrace()} to stop tracing.
|
|
4208
|
+
*
|
|
4209
|
+
* @param traceOptions the options
|
|
4210
|
+
* @param traceWriter the trace writer
|
|
4211
|
+
*
|
|
4212
|
+
* @throws RocksDBException if an error occurs whilst starting the trace
|
|
4213
|
+
*/
|
|
4214
|
+
public void startTrace(final TraceOptions traceOptions,
|
|
4215
|
+
final AbstractTraceWriter traceWriter) throws RocksDBException {
|
|
4216
|
+
startTrace(nativeHandle_, traceOptions.getMaxTraceFileSize(),
|
|
4217
|
+
traceWriter.nativeHandle_);
|
|
4218
|
+
/*
|
|
4219
|
+
* NOTE: {@link #startTrace(long, long, long) transfers the ownership
|
|
4220
|
+
* from Java to C++, so we must disown the native handle here.
|
|
4221
|
+
*/
|
|
4222
|
+
traceWriter.disOwnNativeHandle();
|
|
4223
|
+
}
|
|
4224
|
+
|
|
4225
|
+
/**
|
|
4226
|
+
* Stop tracing DB operations.
|
|
4227
|
+
* <p>
|
|
4228
|
+
* See {@link #startTrace(TraceOptions, AbstractTraceWriter)}
|
|
4229
|
+
*
|
|
4230
|
+
* @throws RocksDBException if an error occurs whilst ending the trace
|
|
4231
|
+
*/
|
|
4232
|
+
public void endTrace() throws RocksDBException {
|
|
4233
|
+
endTrace(nativeHandle_);
|
|
4234
|
+
}
|
|
4235
|
+
|
|
4236
|
+
/**
|
|
4237
|
+
* Make the secondary instance catch up with the primary by tailing and
|
|
4238
|
+
* replaying the MANIFEST and WAL of the primary.
|
|
4239
|
+
* Column families created by the primary after the secondary instance starts
|
|
4240
|
+
* will be ignored unless the secondary instance closes and restarts with the
|
|
4241
|
+
* newly created column families.
|
|
4242
|
+
* Column families that exist before secondary instance starts and dropped by
|
|
4243
|
+
* the primary afterwards will be marked as dropped. However, as long as the
|
|
4244
|
+
* secondary instance does not delete the corresponding column family
|
|
4245
|
+
* handles, the data of the column family is still accessible to the
|
|
4246
|
+
* secondary.
|
|
4247
|
+
*
|
|
4248
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
4249
|
+
* native library.
|
|
4250
|
+
*/
|
|
4251
|
+
public void tryCatchUpWithPrimary() throws RocksDBException {
|
|
4252
|
+
tryCatchUpWithPrimary(nativeHandle_);
|
|
4253
|
+
}
|
|
4254
|
+
|
|
4255
|
+
/**
|
|
4256
|
+
* Delete files in multiple ranges at once.
|
|
4257
|
+
* Delete files in a lot of ranges one at a time can be slow, use this API for
|
|
4258
|
+
* better performance in that case.
|
|
4259
|
+
*
|
|
4260
|
+
* @param columnFamily - The column family for operation (null for default)
|
|
4261
|
+
* @param includeEnd - Whether ranges should include end
|
|
4262
|
+
* @param ranges - pairs of ranges (from1, to1, from2, to2, ...)
|
|
4263
|
+
*
|
|
4264
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
4265
|
+
* native library.
|
|
4266
|
+
*/
|
|
4267
|
+
public void deleteFilesInRanges(final ColumnFamilyHandle columnFamily,
|
|
4268
|
+
final List<byte[]> ranges, final boolean includeEnd)
|
|
4269
|
+
throws RocksDBException {
|
|
4270
|
+
if (ranges.size() == 0) {
|
|
4271
|
+
return;
|
|
4272
|
+
}
|
|
4273
|
+
if ((ranges.size() % 2) != 0) {
|
|
4274
|
+
throw new IllegalArgumentException("Ranges size needs to be multiple of 2 "
|
|
4275
|
+
+ "(from1, to1, from2, to2, ...), but is " + ranges.size());
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4278
|
+
final byte[][] rangesArray = ranges.toArray(new byte[ranges.size()][]);
|
|
4279
|
+
|
|
4280
|
+
deleteFilesInRanges(nativeHandle_, columnFamily == null ? 0 : columnFamily.nativeHandle_,
|
|
4281
|
+
rangesArray, includeEnd);
|
|
4282
|
+
}
|
|
4283
|
+
|
|
4284
|
+
/**
|
|
4285
|
+
* Static method to destroy the contents of the specified database.
|
|
4286
|
+
* Be very careful using this method.
|
|
4287
|
+
*
|
|
4288
|
+
* @param path the path to the Rocksdb database.
|
|
4289
|
+
* @param options {@link org.rocksdb.Options} instance.
|
|
4290
|
+
*
|
|
4291
|
+
* @throws RocksDBException thrown if error happens in underlying
|
|
4292
|
+
* native library.
|
|
4293
|
+
*/
|
|
4294
|
+
public static void destroyDB(final String path, final Options options)
|
|
4295
|
+
throws RocksDBException {
|
|
4296
|
+
destroyDB(path, options.nativeHandle_);
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
private /* @Nullable */ long[] toNativeHandleList(
|
|
4300
|
+
/* @Nullable */ final List<? extends RocksObject> objectList) {
|
|
4301
|
+
if (objectList == null) {
|
|
4302
|
+
return null;
|
|
4303
|
+
}
|
|
4304
|
+
final int len = objectList.size();
|
|
4305
|
+
final long[] handleList = new long[len];
|
|
4306
|
+
for (int i = 0; i < len; i++) {
|
|
4307
|
+
handleList[i] = objectList.get(i).nativeHandle_;
|
|
4308
|
+
}
|
|
4309
|
+
return handleList;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
private static long[] toRangeSliceHandles(final List<Range> ranges) {
|
|
4313
|
+
final long[] rangeSliceHandles = new long[ranges.size() * 2];
|
|
4314
|
+
for (int i = 0, j = 0; i < ranges.size(); i++) {
|
|
4315
|
+
final Range range = ranges.get(i);
|
|
4316
|
+
rangeSliceHandles[j++] = range.start.getNativeHandle();
|
|
4317
|
+
rangeSliceHandles[j++] = range.limit.getNativeHandle();
|
|
4318
|
+
}
|
|
4319
|
+
return rangeSliceHandles;
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
protected void storeOptionsInstance(final DBOptionsInterface<?> options) {
|
|
4323
|
+
options_ = options;
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4326
|
+
private static void checkBounds(final int offset, final int len, final int size) {
|
|
4327
|
+
if ((offset | len | (offset + len) | (size - (offset + len))) < 0) {
|
|
4328
|
+
throw new IndexOutOfBoundsException(String.format("offset(%d), len(%d), size(%d)", offset, len, size));
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4332
|
+
private static int computeCapacityHint(final int estimatedNumberOfItems) {
|
|
4333
|
+
// Default load factor for HashMap is 0.75, so N * 1.5 will be at the load
|
|
4334
|
+
// limit. We add +1 for a buffer.
|
|
4335
|
+
return (int)Math.ceil(estimatedNumberOfItems * 1.5 + 1.0);
|
|
4336
|
+
}
|
|
4337
|
+
|
|
4338
|
+
// native methods
|
|
4339
|
+
private static native long open(final long optionsHandle, final String path)
|
|
4340
|
+
throws RocksDBException;
|
|
4341
|
+
|
|
4342
|
+
/**
|
|
4343
|
+
* @param optionsHandle Native handle pointing to an Options object
|
|
4344
|
+
* @param path The directory path for the database files
|
|
4345
|
+
* @param columnFamilyNames An array of column family names
|
|
4346
|
+
* @param columnFamilyOptions An array of native handles pointing to
|
|
4347
|
+
* ColumnFamilyOptions objects
|
|
4348
|
+
*
|
|
4349
|
+
* @return An array of native handles, [0] is the handle of the RocksDB object
|
|
4350
|
+
* [1..1+n] are handles of the ColumnFamilyReferences
|
|
4351
|
+
*
|
|
4352
|
+
* @throws RocksDBException thrown if the database could not be opened
|
|
4353
|
+
*/
|
|
4354
|
+
private static native long[] open(final long optionsHandle, final String path,
|
|
4355
|
+
final byte[][] columnFamilyNames, final long[] columnFamilyOptions) throws RocksDBException;
|
|
4356
|
+
|
|
4357
|
+
private static native long openROnly(final long optionsHandle, final String path,
|
|
4358
|
+
final boolean errorIfWalFileExists) throws RocksDBException;
|
|
4359
|
+
|
|
4360
|
+
/**
|
|
4361
|
+
* @param optionsHandle Native handle pointing to an Options object
|
|
4362
|
+
* @param path The directory path for the database files
|
|
4363
|
+
* @param columnFamilyNames An array of column family names
|
|
4364
|
+
* @param columnFamilyOptions An array of native handles pointing to
|
|
4365
|
+
* ColumnFamilyOptions objects
|
|
4366
|
+
*
|
|
4367
|
+
* @return An array of native handles, [0] is the handle of the RocksDB object
|
|
4368
|
+
* [1..1+n] are handles of the ColumnFamilyReferences
|
|
4369
|
+
*
|
|
4370
|
+
* @throws RocksDBException thrown if the database could not be opened
|
|
4371
|
+
*/
|
|
4372
|
+
private static native long[] openROnly(final long optionsHandle, final String path,
|
|
4373
|
+
final byte[][] columnFamilyNames, final long[] columnFamilyOptions,
|
|
4374
|
+
final boolean errorIfWalFileExists) throws RocksDBException;
|
|
4375
|
+
|
|
4376
|
+
private static native long openAsSecondary(final long optionsHandle, final String path,
|
|
4377
|
+
final String secondaryPath) throws RocksDBException;
|
|
4378
|
+
|
|
4379
|
+
private static native long[] openAsSecondary(final long optionsHandle, final String path,
|
|
4380
|
+
final String secondaryPath, final byte[][] columnFamilyNames,
|
|
4381
|
+
final long[] columnFamilyOptions) throws RocksDBException;
|
|
4382
|
+
|
|
4383
|
+
@Override protected native void disposeInternal(final long handle);
|
|
4384
|
+
|
|
4385
|
+
private static native void closeDatabase(final long handle) throws RocksDBException;
|
|
4386
|
+
private static native byte[][] listColumnFamilies(final long optionsHandle, final String path)
|
|
4387
|
+
throws RocksDBException;
|
|
4388
|
+
private native long createColumnFamily(final long handle,
|
|
4389
|
+
final byte[] columnFamilyName, final int columnFamilyNamelen,
|
|
4390
|
+
final long columnFamilyOptions) throws RocksDBException;
|
|
4391
|
+
private native long[] createColumnFamilies(final long handle,
|
|
4392
|
+
final long columnFamilyOptionsHandle, final byte[][] columnFamilyNames)
|
|
4393
|
+
throws RocksDBException;
|
|
4394
|
+
private native long[] createColumnFamilies(
|
|
4395
|
+
final long handle, final long[] columnFamilyOptionsHandles, final byte[][] columnFamilyNames)
|
|
4396
|
+
throws RocksDBException;
|
|
4397
|
+
private native void dropColumnFamily(
|
|
4398
|
+
final long handle, final long cfHandle) throws RocksDBException;
|
|
4399
|
+
private native void dropColumnFamilies(final long handle,
|
|
4400
|
+
final long[] cfHandles) throws RocksDBException;
|
|
4401
|
+
private native void put(final long handle, final byte[] key,
|
|
4402
|
+
final int keyOffset, final int keyLength, final byte[] value,
|
|
4403
|
+
final int valueOffset, int valueLength) throws RocksDBException;
|
|
4404
|
+
private native void put(final long handle, final byte[] key, final int keyOffset,
|
|
4405
|
+
final int keyLength, final byte[] value, final int valueOffset,
|
|
4406
|
+
final int valueLength, final long cfHandle) throws RocksDBException;
|
|
4407
|
+
private native void put(final long handle, final long writeOptHandle,
|
|
4408
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4409
|
+
final byte[] value, final int valueOffset, final int valueLength)
|
|
4410
|
+
throws RocksDBException;
|
|
4411
|
+
private native void put(final long handle, final long writeOptHandle,
|
|
4412
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4413
|
+
final byte[] value, final int valueOffset, final int valueLength,
|
|
4414
|
+
final long cfHandle) throws RocksDBException;
|
|
4415
|
+
private native void delete(final long handle, final byte[] key,
|
|
4416
|
+
final int keyOffset, final int keyLength) throws RocksDBException;
|
|
4417
|
+
private native void delete(final long handle, final byte[] key,
|
|
4418
|
+
final int keyOffset, final int keyLength, final long cfHandle)
|
|
4419
|
+
throws RocksDBException;
|
|
4420
|
+
private native void delete(final long handle, final long writeOptHandle,
|
|
4421
|
+
final byte[] key, final int keyOffset, final int keyLength)
|
|
4422
|
+
throws RocksDBException;
|
|
4423
|
+
private native void delete(final long handle, final long writeOptHandle,
|
|
4424
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4425
|
+
final long cfHandle) throws RocksDBException;
|
|
4426
|
+
private native void singleDelete(
|
|
4427
|
+
final long handle, final byte[] key, final int keyLen)
|
|
4428
|
+
throws RocksDBException;
|
|
4429
|
+
private native void singleDelete(
|
|
4430
|
+
final long handle, final byte[] key, final int keyLen,
|
|
4431
|
+
final long cfHandle) throws RocksDBException;
|
|
4432
|
+
private native void singleDelete(
|
|
4433
|
+
final long handle, final long writeOptHandle, final byte[] key,
|
|
4434
|
+
final int keyLen) throws RocksDBException;
|
|
4435
|
+
private native void singleDelete(
|
|
4436
|
+
final long handle, final long writeOptHandle,
|
|
4437
|
+
final byte[] key, final int keyLen, final long cfHandle)
|
|
4438
|
+
throws RocksDBException;
|
|
4439
|
+
private native void deleteRange(final long handle, final byte[] beginKey,
|
|
4440
|
+
final int beginKeyOffset, final int beginKeyLength, final byte[] endKey,
|
|
4441
|
+
final int endKeyOffset, final int endKeyLength) throws RocksDBException;
|
|
4442
|
+
private native void deleteRange(final long handle, final byte[] beginKey,
|
|
4443
|
+
final int beginKeyOffset, final int beginKeyLength, final byte[] endKey,
|
|
4444
|
+
final int endKeyOffset, final int endKeyLength, final long cfHandle)
|
|
4445
|
+
throws RocksDBException;
|
|
4446
|
+
private native void deleteRange(final long handle, final long writeOptHandle,
|
|
4447
|
+
final byte[] beginKey, final int beginKeyOffset, final int beginKeyLength,
|
|
4448
|
+
final byte[] endKey, final int endKeyOffset, final int endKeyLength)
|
|
4449
|
+
throws RocksDBException;
|
|
4450
|
+
private native void deleteRange(
|
|
4451
|
+
final long handle, final long writeOptHandle, final byte[] beginKey,
|
|
4452
|
+
final int beginKeyOffset, final int beginKeyLength, final byte[] endKey,
|
|
4453
|
+
final int endKeyOffset, final int endKeyLength, final long cfHandle)
|
|
4454
|
+
throws RocksDBException;
|
|
4455
|
+
private native void merge(final long handle, final byte[] key,
|
|
4456
|
+
final int keyOffset, final int keyLength, final byte[] value,
|
|
4457
|
+
final int valueOffset, final int valueLength) throws RocksDBException;
|
|
4458
|
+
private native void merge(final long handle, final byte[] key,
|
|
4459
|
+
final int keyOffset, final int keyLength, final byte[] value,
|
|
4460
|
+
final int valueOffset, final int valueLength, final long cfHandle)
|
|
4461
|
+
throws RocksDBException;
|
|
4462
|
+
private native void merge(final long handle, final long writeOptHandle,
|
|
4463
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4464
|
+
final byte[] value, final int valueOffset, final int valueLength)
|
|
4465
|
+
throws RocksDBException;
|
|
4466
|
+
private native void merge(final long handle, final long writeOptHandle,
|
|
4467
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4468
|
+
final byte[] value, final int valueOffset, final int valueLength,
|
|
4469
|
+
final long cfHandle) throws RocksDBException;
|
|
4470
|
+
private native void write0(final long handle, final long writeOptHandle,
|
|
4471
|
+
final long wbHandle) throws RocksDBException;
|
|
4472
|
+
private native void write1(final long handle, final long writeOptHandle,
|
|
4473
|
+
final long wbwiHandle) throws RocksDBException;
|
|
4474
|
+
private native int get(final long handle, final byte[] key,
|
|
4475
|
+
final int keyOffset, final int keyLength, final byte[] value,
|
|
4476
|
+
final int valueOffset, final int valueLength) throws RocksDBException;
|
|
4477
|
+
private native int get(final long handle, final byte[] key,
|
|
4478
|
+
final int keyOffset, final int keyLength, byte[] value,
|
|
4479
|
+
final int valueOffset, final int valueLength, final long cfHandle)
|
|
4480
|
+
throws RocksDBException;
|
|
4481
|
+
private native int get(final long handle, final long readOptHandle,
|
|
4482
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4483
|
+
final byte[] value, final int valueOffset, final int valueLength)
|
|
4484
|
+
throws RocksDBException;
|
|
4485
|
+
private native int get(final long handle, final long readOptHandle,
|
|
4486
|
+
final byte[] key, final int keyOffset, final int keyLength,
|
|
4487
|
+
final byte[] value, final int valueOffset, final int valueLength,
|
|
4488
|
+
final long cfHandle) throws RocksDBException;
|
|
4489
|
+
private native byte[] get(final long handle, byte[] key, final int keyOffset,
|
|
4490
|
+
final int keyLength) throws RocksDBException;
|
|
4491
|
+
private native byte[] get(final long handle, final byte[] key,
|
|
4492
|
+
final int keyOffset, final int keyLength, final long cfHandle)
|
|
4493
|
+
throws RocksDBException;
|
|
4494
|
+
private native byte[] get(final long handle, final long readOptHandle,
|
|
4495
|
+
final byte[] key, final int keyOffset, final int keyLength)
|
|
4496
|
+
throws RocksDBException;
|
|
4497
|
+
private native byte[] get(final long handle,
|
|
4498
|
+
final long readOptHandle, final byte[] key, final int keyOffset,
|
|
4499
|
+
final int keyLength, final long cfHandle) throws RocksDBException;
|
|
4500
|
+
private native byte[][] multiGet(final long dbHandle, final byte[][] keys,
|
|
4501
|
+
final int[] keyOffsets, final int[] keyLengths);
|
|
4502
|
+
private native byte[][] multiGet(final long dbHandle, final byte[][] keys,
|
|
4503
|
+
final int[] keyOffsets, final int[] keyLengths,
|
|
4504
|
+
final long[] columnFamilyHandles);
|
|
4505
|
+
private native byte[][] multiGet(final long dbHandle, final long rOptHandle,
|
|
4506
|
+
final byte[][] keys, final int[] keyOffsets, final int[] keyLengths);
|
|
4507
|
+
private native byte[][] multiGet(final long dbHandle, final long rOptHandle,
|
|
4508
|
+
final byte[][] keys, final int[] keyOffsets, final int[] keyLengths,
|
|
4509
|
+
final long[] columnFamilyHandles);
|
|
4510
|
+
|
|
4511
|
+
private native void multiGet(final long dbHandle, final long rOptHandle,
|
|
4512
|
+
final long[] columnFamilyHandles, final ByteBuffer[] keysArray, final int[] keyOffsets,
|
|
4513
|
+
final int[] keyLengths, final ByteBuffer[] valuesArray, final int[] valuesSizeArray,
|
|
4514
|
+
final Status[] statusArray);
|
|
4515
|
+
|
|
4516
|
+
private native boolean keyMayExist(
|
|
4517
|
+
final long handle, final long cfHandle, final long readOptHandle,
|
|
4518
|
+
final byte[] key, final int keyOffset, final int keyLength);
|
|
4519
|
+
private native byte[][] keyMayExistFoundValue(
|
|
4520
|
+
final long handle, final long cfHandle, final long readOptHandle,
|
|
4521
|
+
final byte[] key, final int keyOffset, final int keyLength);
|
|
4522
|
+
private native void putDirect(long handle, long writeOptHandle, ByteBuffer key, int keyOffset,
|
|
4523
|
+
int keyLength, ByteBuffer value, int valueOffset, int valueLength, long cfHandle)
|
|
4524
|
+
throws RocksDBException;
|
|
4525
|
+
private native long iterator(final long handle);
|
|
4526
|
+
private native long iterator(final long handle, final long readOptHandle);
|
|
4527
|
+
private native long iteratorCF(final long handle, final long cfHandle);
|
|
4528
|
+
private native long iteratorCF(final long handle, final long cfHandle,
|
|
4529
|
+
final long readOptHandle);
|
|
4530
|
+
private native long[] iterators(final long handle,
|
|
4531
|
+
final long[] columnFamilyHandles, final long readOptHandle)
|
|
4532
|
+
throws RocksDBException;
|
|
4533
|
+
private native long getSnapshot(final long nativeHandle);
|
|
4534
|
+
private native void releaseSnapshot(
|
|
4535
|
+
final long nativeHandle, final long snapshotHandle);
|
|
4536
|
+
private native String getProperty(final long nativeHandle,
|
|
4537
|
+
final long cfHandle, final String property, final int propertyLength)
|
|
4538
|
+
throws RocksDBException;
|
|
4539
|
+
private native Map<String, String> getMapProperty(final long nativeHandle,
|
|
4540
|
+
final long cfHandle, final String property, final int propertyLength)
|
|
4541
|
+
throws RocksDBException;
|
|
4542
|
+
private native int getDirect(long handle, long readOptHandle, ByteBuffer key, int keyOffset,
|
|
4543
|
+
int keyLength, ByteBuffer value, int valueOffset, int valueLength, long cfHandle)
|
|
4544
|
+
throws RocksDBException;
|
|
4545
|
+
private native boolean keyMayExistDirect(final long handle, final long cfHhandle,
|
|
4546
|
+
final long readOptHandle, final ByteBuffer key, final int keyOffset, final int keyLength);
|
|
4547
|
+
private native int[] keyMayExistDirectFoundValue(final long handle, final long cfHhandle,
|
|
4548
|
+
final long readOptHandle, final ByteBuffer key, final int keyOffset, final int keyLength,
|
|
4549
|
+
final ByteBuffer value, final int valueOffset, final int valueLength);
|
|
4550
|
+
private native void deleteDirect(long handle, long optHandle, ByteBuffer key, int keyOffset,
|
|
4551
|
+
int keyLength, long cfHandle) throws RocksDBException;
|
|
4552
|
+
private native long getLongProperty(final long nativeHandle,
|
|
4553
|
+
final long cfHandle, final String property, final int propertyLength)
|
|
4554
|
+
throws RocksDBException;
|
|
4555
|
+
private native void resetStats(final long nativeHandle)
|
|
4556
|
+
throws RocksDBException;
|
|
4557
|
+
private native long getAggregatedLongProperty(final long nativeHandle,
|
|
4558
|
+
final String property, int propertyLength) throws RocksDBException;
|
|
4559
|
+
private native long[] getApproximateSizes(final long nativeHandle,
|
|
4560
|
+
final long columnFamilyHandle, final long[] rangeSliceHandles,
|
|
4561
|
+
final byte includeFlags);
|
|
4562
|
+
private native long[] getApproximateMemTableStats(final long nativeHandle,
|
|
4563
|
+
final long columnFamilyHandle, final long rangeStartSliceHandle,
|
|
4564
|
+
final long rangeLimitSliceHandle);
|
|
4565
|
+
private native void compactRange(final long handle,
|
|
4566
|
+
/* @Nullable */ final byte[] begin, final int beginLen,
|
|
4567
|
+
/* @Nullable */ final byte[] end, final int endLen,
|
|
4568
|
+
final long compactRangeOptHandle, final long cfHandle)
|
|
4569
|
+
throws RocksDBException;
|
|
4570
|
+
private native void setOptions(final long handle, final long cfHandle,
|
|
4571
|
+
final String[] keys, final String[] values) throws RocksDBException;
|
|
4572
|
+
private native String getOptions(final long handle, final long cfHandle);
|
|
4573
|
+
private native void setDBOptions(final long handle,
|
|
4574
|
+
final String[] keys, final String[] values) throws RocksDBException;
|
|
4575
|
+
private native String getDBOptions(final long handle);
|
|
4576
|
+
private native String[] compactFiles(final long handle,
|
|
4577
|
+
final long compactionOptionsHandle,
|
|
4578
|
+
final long columnFamilyHandle,
|
|
4579
|
+
final String[] inputFileNames,
|
|
4580
|
+
final int outputLevel,
|
|
4581
|
+
final int outputPathId,
|
|
4582
|
+
final long compactionJobInfoHandle) throws RocksDBException;
|
|
4583
|
+
private native void cancelAllBackgroundWork(final long handle,
|
|
4584
|
+
final boolean wait);
|
|
4585
|
+
private native void pauseBackgroundWork(final long handle)
|
|
4586
|
+
throws RocksDBException;
|
|
4587
|
+
private native void continueBackgroundWork(final long handle)
|
|
4588
|
+
throws RocksDBException;
|
|
4589
|
+
private native void enableAutoCompaction(final long handle,
|
|
4590
|
+
final long[] columnFamilyHandles) throws RocksDBException;
|
|
4591
|
+
private native int numberLevels(final long handle,
|
|
4592
|
+
final long columnFamilyHandle);
|
|
4593
|
+
private native int maxMemCompactionLevel(final long handle,
|
|
4594
|
+
final long columnFamilyHandle);
|
|
4595
|
+
private native int level0StopWriteTrigger(final long handle,
|
|
4596
|
+
final long columnFamilyHandle);
|
|
4597
|
+
private native String getName(final long handle);
|
|
4598
|
+
private native long getEnv(final long handle);
|
|
4599
|
+
private native void flush(final long handle, final long flushOptHandle,
|
|
4600
|
+
/* @Nullable */ final long[] cfHandles) throws RocksDBException;
|
|
4601
|
+
private native void flushWal(final long handle, final boolean sync)
|
|
4602
|
+
throws RocksDBException;
|
|
4603
|
+
private native void syncWal(final long handle) throws RocksDBException;
|
|
4604
|
+
private native long getLatestSequenceNumber(final long handle);
|
|
4605
|
+
private native void disableFileDeletions(long handle) throws RocksDBException;
|
|
4606
|
+
private native void enableFileDeletions(long handle, boolean force)
|
|
4607
|
+
throws RocksDBException;
|
|
4608
|
+
private native String[] getLiveFiles(final long handle,
|
|
4609
|
+
final boolean flushMemtable) throws RocksDBException;
|
|
4610
|
+
private native LogFile[] getSortedWalFiles(final long handle)
|
|
4611
|
+
throws RocksDBException;
|
|
4612
|
+
private native long getUpdatesSince(final long handle,
|
|
4613
|
+
final long sequenceNumber) throws RocksDBException;
|
|
4614
|
+
private native void deleteFile(final long handle, final String name)
|
|
4615
|
+
throws RocksDBException;
|
|
4616
|
+
private native LiveFileMetaData[] getLiveFilesMetaData(final long handle);
|
|
4617
|
+
private native ColumnFamilyMetaData getColumnFamilyMetaData(
|
|
4618
|
+
final long handle, final long columnFamilyHandle);
|
|
4619
|
+
private native void ingestExternalFile(final long handle,
|
|
4620
|
+
final long columnFamilyHandle, final String[] filePathList,
|
|
4621
|
+
final int filePathListLen, final long ingestExternalFileOptionsHandle)
|
|
4622
|
+
throws RocksDBException;
|
|
4623
|
+
private native void verifyChecksum(final long handle) throws RocksDBException;
|
|
4624
|
+
private native long getDefaultColumnFamily(final long handle);
|
|
4625
|
+
private native Map<String, TableProperties> getPropertiesOfAllTables(
|
|
4626
|
+
final long handle, final long columnFamilyHandle) throws RocksDBException;
|
|
4627
|
+
private native Map<String, TableProperties> getPropertiesOfTablesInRange(
|
|
4628
|
+
final long handle, final long columnFamilyHandle,
|
|
4629
|
+
final long[] rangeSliceHandles);
|
|
4630
|
+
private native long[] suggestCompactRange(final long handle,
|
|
4631
|
+
final long columnFamilyHandle) throws RocksDBException;
|
|
4632
|
+
private native void promoteL0(final long handle,
|
|
4633
|
+
final long columnFamilyHandle, final int tragetLevel)
|
|
4634
|
+
throws RocksDBException;
|
|
4635
|
+
private native void startTrace(final long handle, final long maxTraceFileSize,
|
|
4636
|
+
final long traceWriterHandle) throws RocksDBException;
|
|
4637
|
+
private native void endTrace(final long handle) throws RocksDBException;
|
|
4638
|
+
private native void tryCatchUpWithPrimary(final long handle) throws RocksDBException;
|
|
4639
|
+
private native void deleteFilesInRanges(long handle, long cfHandle, final byte[][] ranges,
|
|
4640
|
+
boolean include_end) throws RocksDBException;
|
|
4641
|
+
|
|
4642
|
+
private static native void destroyDB(final String path, final long optionsHandle)
|
|
4643
|
+
throws RocksDBException;
|
|
4644
|
+
|
|
4645
|
+
private static native int version();
|
|
4646
|
+
|
|
4647
|
+
protected DBOptionsInterface<?> options_;
|
|
4648
|
+
private static Version version;
|
|
4649
|
+
|
|
4650
|
+
public static class Version {
|
|
4651
|
+
private final byte major;
|
|
4652
|
+
private final byte minor;
|
|
4653
|
+
private final byte patch;
|
|
4654
|
+
|
|
4655
|
+
public Version(final byte major, final byte minor, final byte patch) {
|
|
4656
|
+
this.major = major;
|
|
4657
|
+
this.minor = minor;
|
|
4658
|
+
this.patch = patch;
|
|
4659
|
+
}
|
|
4660
|
+
|
|
4661
|
+
public int getMajor() {
|
|
4662
|
+
return major;
|
|
4663
|
+
}
|
|
4664
|
+
|
|
4665
|
+
public int getMinor() {
|
|
4666
|
+
return minor;
|
|
4667
|
+
}
|
|
4668
|
+
|
|
4669
|
+
public int getPatch() {
|
|
4670
|
+
return patch;
|
|
4671
|
+
}
|
|
4672
|
+
|
|
4673
|
+
@Override
|
|
4674
|
+
public String toString() {
|
|
4675
|
+
return getMajor() + "." + getMinor() + "." + getPatch();
|
|
4676
|
+
}
|
|
4677
|
+
|
|
4678
|
+
private static Version fromEncodedVersion(int encodedVersion) {
|
|
4679
|
+
final byte patch = (byte) (encodedVersion & 0xff);
|
|
4680
|
+
encodedVersion >>= 8;
|
|
4681
|
+
final byte minor = (byte) (encodedVersion & 0xff);
|
|
4682
|
+
encodedVersion >>= 8;
|
|
4683
|
+
final byte major = (byte) (encodedVersion & 0xff);
|
|
4684
|
+
|
|
4685
|
+
return new Version(major, minor, patch);
|
|
4686
|
+
}
|
|
4687
|
+
}
|
|
4688
|
+
}
|