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.
Files changed (1951) hide show
  1. package/.clang-format +15 -0
  2. package/.github/workflows/test-node.yml +23 -0
  3. package/.gitmodules +4 -0
  4. package/CMakeLists.txt +33 -0
  5. package/LICENSE +201 -0
  6. package/NOTICE +13 -0
  7. package/README.md +15 -0
  8. package/binding.c +470 -0
  9. package/binding.js +1 -0
  10. package/index.js +276 -0
  11. package/package.json +19 -0
  12. package/vendor/rocksdb/.circleci/config.yml +892 -0
  13. package/vendor/rocksdb/.circleci/ubsan_suppression_list.txt +6 -0
  14. package/vendor/rocksdb/.clang-format +5 -0
  15. package/vendor/rocksdb/.github/workflows/sanity_check.yml +47 -0
  16. package/vendor/rocksdb/.lgtm.yml +4 -0
  17. package/vendor/rocksdb/AUTHORS +12 -0
  18. package/vendor/rocksdb/CMakeLists.txt +1591 -0
  19. package/vendor/rocksdb/CODE_OF_CONDUCT.md +77 -0
  20. package/vendor/rocksdb/CONTRIBUTING.md +17 -0
  21. package/vendor/rocksdb/COPYING +339 -0
  22. package/vendor/rocksdb/DEFAULT_OPTIONS_HISTORY.md +24 -0
  23. package/vendor/rocksdb/DUMP_FORMAT.md +16 -0
  24. package/vendor/rocksdb/HISTORY.md +2399 -0
  25. package/vendor/rocksdb/INSTALL.md +220 -0
  26. package/vendor/rocksdb/LANGUAGE-BINDINGS.md +26 -0
  27. package/vendor/rocksdb/LICENSE.Apache +202 -0
  28. package/vendor/rocksdb/LICENSE.leveldb +29 -0
  29. package/vendor/rocksdb/Makefile +2579 -0
  30. package/vendor/rocksdb/PLUGINS.md +8 -0
  31. package/vendor/rocksdb/README.md +29 -0
  32. package/vendor/rocksdb/TARGETS +5599 -0
  33. package/vendor/rocksdb/USERS.md +165 -0
  34. package/vendor/rocksdb/Vagrantfile +39 -0
  35. package/vendor/rocksdb/WINDOWS_PORT.md +228 -0
  36. package/vendor/rocksdb/buckifier/bench-slow.json +6163 -0
  37. package/vendor/rocksdb/buckifier/bench.json +1594 -0
  38. package/vendor/rocksdb/buckifier/buckify_rocksdb.py +333 -0
  39. package/vendor/rocksdb/buckifier/check_buck_targets.sh +32 -0
  40. package/vendor/rocksdb/buckifier/rocks_test_runner.sh +6 -0
  41. package/vendor/rocksdb/buckifier/targets_builder.py +150 -0
  42. package/vendor/rocksdb/buckifier/targets_cfg.py +41 -0
  43. package/vendor/rocksdb/buckifier/util.py +118 -0
  44. package/vendor/rocksdb/build_tools/amalgamate.py +168 -0
  45. package/vendor/rocksdb/build_tools/benchmark_log_tool.py +238 -0
  46. package/vendor/rocksdb/build_tools/build_detect_platform +804 -0
  47. package/vendor/rocksdb/build_tools/check-sources.sh +48 -0
  48. package/vendor/rocksdb/build_tools/dependencies_platform010.sh +22 -0
  49. package/vendor/rocksdb/build_tools/dockerbuild.sh +3 -0
  50. package/vendor/rocksdb/build_tools/error_filter.py +181 -0
  51. package/vendor/rocksdb/build_tools/fb_compile_mongo.sh +55 -0
  52. package/vendor/rocksdb/build_tools/fbcode_config.sh +175 -0
  53. package/vendor/rocksdb/build_tools/fbcode_config_platform010.sh +175 -0
  54. package/vendor/rocksdb/build_tools/format-diff.sh +203 -0
  55. package/vendor/rocksdb/build_tools/gnu_parallel +7971 -0
  56. package/vendor/rocksdb/build_tools/make_package.sh +129 -0
  57. package/vendor/rocksdb/build_tools/ps_with_stack +38 -0
  58. package/vendor/rocksdb/build_tools/regression_build_test.sh +396 -0
  59. package/vendor/rocksdb/build_tools/run_ci_db_test.ps1 +493 -0
  60. package/vendor/rocksdb/build_tools/setup_centos7.sh +45 -0
  61. package/vendor/rocksdb/build_tools/ubuntu20_image/Dockerfile +57 -0
  62. package/vendor/rocksdb/build_tools/update_dependencies.sh +106 -0
  63. package/vendor/rocksdb/build_tools/version.sh +23 -0
  64. package/vendor/rocksdb/cache/cache.cc +158 -0
  65. package/vendor/rocksdb/cache/cache_bench.cc +20 -0
  66. package/vendor/rocksdb/cache/cache_bench_tool.cc +969 -0
  67. package/vendor/rocksdb/cache/cache_entry_roles.cc +104 -0
  68. package/vendor/rocksdb/cache/cache_entry_roles.h +20 -0
  69. package/vendor/rocksdb/cache/cache_entry_stats.h +182 -0
  70. package/vendor/rocksdb/cache/cache_helpers.cc +40 -0
  71. package/vendor/rocksdb/cache/cache_helpers.h +139 -0
  72. package/vendor/rocksdb/cache/cache_key.cc +364 -0
  73. package/vendor/rocksdb/cache/cache_key.h +143 -0
  74. package/vendor/rocksdb/cache/cache_reservation_manager.cc +184 -0
  75. package/vendor/rocksdb/cache/cache_reservation_manager.h +317 -0
  76. package/vendor/rocksdb/cache/cache_reservation_manager_test.cc +469 -0
  77. package/vendor/rocksdb/cache/cache_test.cc +1061 -0
  78. package/vendor/rocksdb/cache/charged_cache.cc +109 -0
  79. package/vendor/rocksdb/cache/charged_cache.h +59 -0
  80. package/vendor/rocksdb/cache/clock_cache.cc +1482 -0
  81. package/vendor/rocksdb/cache/clock_cache.h +707 -0
  82. package/vendor/rocksdb/cache/compressed_secondary_cache.cc +304 -0
  83. package/vendor/rocksdb/cache/compressed_secondary_cache.h +132 -0
  84. package/vendor/rocksdb/cache/compressed_secondary_cache_test.cc +983 -0
  85. package/vendor/rocksdb/cache/lru_cache.cc +723 -0
  86. package/vendor/rocksdb/cache/lru_cache.h +467 -0
  87. package/vendor/rocksdb/cache/lru_cache_test.cc +2559 -0
  88. package/vendor/rocksdb/cache/secondary_cache.cc +44 -0
  89. package/vendor/rocksdb/cache/secondary_cache_adapter.cc +295 -0
  90. package/vendor/rocksdb/cache/secondary_cache_adapter.h +52 -0
  91. package/vendor/rocksdb/cache/sharded_cache.cc +137 -0
  92. package/vendor/rocksdb/cache/sharded_cache.h +309 -0
  93. package/vendor/rocksdb/cache/typed_cache.h +375 -0
  94. package/vendor/rocksdb/cmake/RocksDBConfig.cmake.in +54 -0
  95. package/vendor/rocksdb/common.mk +30 -0
  96. package/vendor/rocksdb/crash_test.mk +107 -0
  97. package/vendor/rocksdb/db/arena_wrapped_db_iter.cc +163 -0
  98. package/vendor/rocksdb/db/arena_wrapped_db_iter.h +127 -0
  99. package/vendor/rocksdb/db/blob/blob_constants.h +16 -0
  100. package/vendor/rocksdb/db/blob/blob_contents.cc +42 -0
  101. package/vendor/rocksdb/db/blob/blob_contents.h +59 -0
  102. package/vendor/rocksdb/db/blob/blob_counting_iterator.h +150 -0
  103. package/vendor/rocksdb/db/blob/blob_counting_iterator_test.cc +327 -0
  104. package/vendor/rocksdb/db/blob/blob_fetcher.cc +34 -0
  105. package/vendor/rocksdb/db/blob/blob_fetcher.h +37 -0
  106. package/vendor/rocksdb/db/blob/blob_file_addition.cc +156 -0
  107. package/vendor/rocksdb/db/blob/blob_file_addition.h +67 -0
  108. package/vendor/rocksdb/db/blob/blob_file_addition_test.cc +211 -0
  109. package/vendor/rocksdb/db/blob/blob_file_builder.cc +426 -0
  110. package/vendor/rocksdb/db/blob/blob_file_builder.h +112 -0
  111. package/vendor/rocksdb/db/blob/blob_file_builder_test.cc +680 -0
  112. package/vendor/rocksdb/db/blob/blob_file_cache.cc +101 -0
  113. package/vendor/rocksdb/db/blob/blob_file_cache.h +56 -0
  114. package/vendor/rocksdb/db/blob/blob_file_cache_test.cc +278 -0
  115. package/vendor/rocksdb/db/blob/blob_file_completion_callback.h +84 -0
  116. package/vendor/rocksdb/db/blob/blob_file_garbage.cc +134 -0
  117. package/vendor/rocksdb/db/blob/blob_file_garbage.h +57 -0
  118. package/vendor/rocksdb/db/blob/blob_file_garbage_test.cc +174 -0
  119. package/vendor/rocksdb/db/blob/blob_file_meta.cc +62 -0
  120. package/vendor/rocksdb/db/blob/blob_file_meta.h +170 -0
  121. package/vendor/rocksdb/db/blob/blob_file_reader.cc +624 -0
  122. package/vendor/rocksdb/db/blob/blob_file_reader.h +112 -0
  123. package/vendor/rocksdb/db/blob/blob_file_reader_test.cc +1023 -0
  124. package/vendor/rocksdb/db/blob/blob_garbage_meter.cc +100 -0
  125. package/vendor/rocksdb/db/blob/blob_garbage_meter.h +102 -0
  126. package/vendor/rocksdb/db/blob/blob_garbage_meter_test.cc +197 -0
  127. package/vendor/rocksdb/db/blob/blob_index.h +187 -0
  128. package/vendor/rocksdb/db/blob/blob_log_format.cc +143 -0
  129. package/vendor/rocksdb/db/blob/blob_log_format.h +164 -0
  130. package/vendor/rocksdb/db/blob/blob_log_sequential_reader.cc +134 -0
  131. package/vendor/rocksdb/db/blob/blob_log_sequential_reader.h +83 -0
  132. package/vendor/rocksdb/db/blob/blob_log_writer.cc +178 -0
  133. package/vendor/rocksdb/db/blob/blob_log_writer.h +83 -0
  134. package/vendor/rocksdb/db/blob/blob_read_request.h +58 -0
  135. package/vendor/rocksdb/db/blob/blob_source.cc +459 -0
  136. package/vendor/rocksdb/db/blob/blob_source.h +161 -0
  137. package/vendor/rocksdb/db/blob/blob_source_test.cc +1611 -0
  138. package/vendor/rocksdb/db/blob/db_blob_basic_test.cc +2237 -0
  139. package/vendor/rocksdb/db/blob/db_blob_compaction_test.cc +899 -0
  140. package/vendor/rocksdb/db/blob/db_blob_corruption_test.cc +80 -0
  141. package/vendor/rocksdb/db/blob/db_blob_index_test.cc +596 -0
  142. package/vendor/rocksdb/db/blob/prefetch_buffer_collection.cc +21 -0
  143. package/vendor/rocksdb/db/blob/prefetch_buffer_collection.h +38 -0
  144. package/vendor/rocksdb/db/builder.cc +447 -0
  145. package/vendor/rocksdb/db/builder.h +78 -0
  146. package/vendor/rocksdb/db/c.cc +6559 -0
  147. package/vendor/rocksdb/db/c_test.c +3609 -0
  148. package/vendor/rocksdb/db/column_family.cc +1708 -0
  149. package/vendor/rocksdb/db/column_family.h +851 -0
  150. package/vendor/rocksdb/db/column_family_test.cc +3382 -0
  151. package/vendor/rocksdb/db/compact_files_test.cc +492 -0
  152. package/vendor/rocksdb/db/compaction/clipping_iterator.h +281 -0
  153. package/vendor/rocksdb/db/compaction/clipping_iterator_test.cc +259 -0
  154. package/vendor/rocksdb/db/compaction/compaction.cc +857 -0
  155. package/vendor/rocksdb/db/compaction/compaction.h +565 -0
  156. package/vendor/rocksdb/db/compaction/compaction_iteration_stats.h +49 -0
  157. package/vendor/rocksdb/db/compaction/compaction_iterator.cc +1445 -0
  158. package/vendor/rocksdb/db/compaction/compaction_iterator.h +530 -0
  159. package/vendor/rocksdb/db/compaction/compaction_iterator_test.cc +1618 -0
  160. package/vendor/rocksdb/db/compaction/compaction_job.cc +2054 -0
  161. package/vendor/rocksdb/db/compaction/compaction_job.h +504 -0
  162. package/vendor/rocksdb/db/compaction/compaction_job_stats_test.cc +965 -0
  163. package/vendor/rocksdb/db/compaction/compaction_job_test.cc +2444 -0
  164. package/vendor/rocksdb/db/compaction/compaction_outputs.cc +784 -0
  165. package/vendor/rocksdb/db/compaction/compaction_outputs.h +403 -0
  166. package/vendor/rocksdb/db/compaction/compaction_picker.cc +1225 -0
  167. package/vendor/rocksdb/db/compaction/compaction_picker.h +318 -0
  168. package/vendor/rocksdb/db/compaction/compaction_picker_fifo.cc +471 -0
  169. package/vendor/rocksdb/db/compaction/compaction_picker_fifo.h +60 -0
  170. package/vendor/rocksdb/db/compaction/compaction_picker_level.cc +888 -0
  171. package/vendor/rocksdb/db/compaction/compaction_picker_level.h +33 -0
  172. package/vendor/rocksdb/db/compaction/compaction_picker_test.cc +4074 -0
  173. package/vendor/rocksdb/db/compaction/compaction_picker_universal.cc +1452 -0
  174. package/vendor/rocksdb/db/compaction/compaction_picker_universal.h +30 -0
  175. package/vendor/rocksdb/db/compaction/compaction_service_job.cc +833 -0
  176. package/vendor/rocksdb/db/compaction/compaction_service_test.cc +954 -0
  177. package/vendor/rocksdb/db/compaction/compaction_state.cc +46 -0
  178. package/vendor/rocksdb/db/compaction/compaction_state.h +42 -0
  179. package/vendor/rocksdb/db/compaction/file_pri.h +92 -0
  180. package/vendor/rocksdb/db/compaction/sst_partitioner.cc +83 -0
  181. package/vendor/rocksdb/db/compaction/subcompaction_state.cc +106 -0
  182. package/vendor/rocksdb/db/compaction/subcompaction_state.h +220 -0
  183. package/vendor/rocksdb/db/compaction/tiered_compaction_test.cc +2149 -0
  184. package/vendor/rocksdb/db/comparator_db_test.cc +678 -0
  185. package/vendor/rocksdb/db/convenience.cc +81 -0
  186. package/vendor/rocksdb/db/corruption_test.cc +1670 -0
  187. package/vendor/rocksdb/db/cuckoo_table_db_test.cc +351 -0
  188. package/vendor/rocksdb/db/db_basic_test.cc +4777 -0
  189. package/vendor/rocksdb/db/db_block_cache_test.cc +1972 -0
  190. package/vendor/rocksdb/db/db_bloom_filter_test.cc +3513 -0
  191. package/vendor/rocksdb/db/db_clip_test.cc +142 -0
  192. package/vendor/rocksdb/db/db_compaction_filter_test.cc +1030 -0
  193. package/vendor/rocksdb/db/db_compaction_test.cc +9424 -0
  194. package/vendor/rocksdb/db/db_dynamic_level_test.cc +499 -0
  195. package/vendor/rocksdb/db/db_encryption_test.cc +126 -0
  196. package/vendor/rocksdb/db/db_filesnapshot.cc +436 -0
  197. package/vendor/rocksdb/db/db_flush_test.cc +3202 -0
  198. package/vendor/rocksdb/db/db_impl/compacted_db_impl.cc +260 -0
  199. package/vendor/rocksdb/db/db_impl/compacted_db_impl.h +157 -0
  200. package/vendor/rocksdb/db/db_impl/db_impl.cc +6132 -0
  201. package/vendor/rocksdb/db/db_impl/db_impl.h +2841 -0
  202. package/vendor/rocksdb/db/db_impl/db_impl_compaction_flush.cc +3980 -0
  203. package/vendor/rocksdb/db/db_impl/db_impl_debug.cc +314 -0
  204. package/vendor/rocksdb/db/db_impl/db_impl_experimental.cc +159 -0
  205. package/vendor/rocksdb/db/db_impl/db_impl_files.cc +1014 -0
  206. package/vendor/rocksdb/db/db_impl/db_impl_open.cc +2202 -0
  207. package/vendor/rocksdb/db/db_impl/db_impl_readonly.cc +334 -0
  208. package/vendor/rocksdb/db/db_impl/db_impl_readonly.h +173 -0
  209. package/vendor/rocksdb/db/db_impl/db_impl_secondary.cc +964 -0
  210. package/vendor/rocksdb/db/db_impl/db_impl_secondary.h +406 -0
  211. package/vendor/rocksdb/db/db_impl/db_impl_write.cc +2487 -0
  212. package/vendor/rocksdb/db/db_info_dumper.cc +147 -0
  213. package/vendor/rocksdb/db/db_info_dumper.h +15 -0
  214. package/vendor/rocksdb/db/db_inplace_update_test.cc +262 -0
  215. package/vendor/rocksdb/db/db_io_failure_test.cc +589 -0
  216. package/vendor/rocksdb/db/db_iter.cc +1708 -0
  217. package/vendor/rocksdb/db/db_iter.h +411 -0
  218. package/vendor/rocksdb/db/db_iter_stress_test.cc +658 -0
  219. package/vendor/rocksdb/db/db_iter_test.cc +3195 -0
  220. package/vendor/rocksdb/db/db_iterator_test.cc +3304 -0
  221. package/vendor/rocksdb/db/db_kv_checksum_test.cc +885 -0
  222. package/vendor/rocksdb/db/db_log_iter_test.cc +297 -0
  223. package/vendor/rocksdb/db/db_logical_block_size_cache_test.cc +505 -0
  224. package/vendor/rocksdb/db/db_memtable_test.cc +344 -0
  225. package/vendor/rocksdb/db/db_merge_operand_test.cc +488 -0
  226. package/vendor/rocksdb/db/db_merge_operator_test.cc +866 -0
  227. package/vendor/rocksdb/db/db_options_test.cc +1330 -0
  228. package/vendor/rocksdb/db/db_properties_test.cc +2377 -0
  229. package/vendor/rocksdb/db/db_range_del_test.cc +3414 -0
  230. package/vendor/rocksdb/db/db_rate_limiter_test.cc +437 -0
  231. package/vendor/rocksdb/db/db_readonly_with_timestamp_test.cc +956 -0
  232. package/vendor/rocksdb/db/db_secondary_test.cc +1691 -0
  233. package/vendor/rocksdb/db/db_sst_test.cc +1865 -0
  234. package/vendor/rocksdb/db/db_statistics_test.cc +292 -0
  235. package/vendor/rocksdb/db/db_table_properties_test.cc +623 -0
  236. package/vendor/rocksdb/db/db_tailing_iter_test.cc +595 -0
  237. package/vendor/rocksdb/db/db_test.cc +7359 -0
  238. package/vendor/rocksdb/db/db_test2.cc +7679 -0
  239. package/vendor/rocksdb/db/db_test_util.cc +1759 -0
  240. package/vendor/rocksdb/db/db_test_util.h +1340 -0
  241. package/vendor/rocksdb/db/db_universal_compaction_test.cc +2227 -0
  242. package/vendor/rocksdb/db/db_wal_test.cc +2433 -0
  243. package/vendor/rocksdb/db/db_with_timestamp_basic_test.cc +4016 -0
  244. package/vendor/rocksdb/db/db_with_timestamp_compaction_test.cc +353 -0
  245. package/vendor/rocksdb/db/db_with_timestamp_test_util.cc +96 -0
  246. package/vendor/rocksdb/db/db_with_timestamp_test_util.h +126 -0
  247. package/vendor/rocksdb/db/db_write_buffer_manager_test.cc +927 -0
  248. package/vendor/rocksdb/db/db_write_test.cc +795 -0
  249. package/vendor/rocksdb/db/dbformat.cc +213 -0
  250. package/vendor/rocksdb/db/dbformat.h +869 -0
  251. package/vendor/rocksdb/db/dbformat_test.cc +214 -0
  252. package/vendor/rocksdb/db/deletefile_test.cc +603 -0
  253. package/vendor/rocksdb/db/error_handler.cc +792 -0
  254. package/vendor/rocksdb/db/error_handler.h +124 -0
  255. package/vendor/rocksdb/db/error_handler_fs_test.cc +2862 -0
  256. package/vendor/rocksdb/db/event_helpers.cc +323 -0
  257. package/vendor/rocksdb/db/event_helpers.h +78 -0
  258. package/vendor/rocksdb/db/experimental.cc +144 -0
  259. package/vendor/rocksdb/db/external_sst_file_basic_test.cc +2084 -0
  260. package/vendor/rocksdb/db/external_sst_file_ingestion_job.cc +1104 -0
  261. package/vendor/rocksdb/db/external_sst_file_ingestion_job.h +238 -0
  262. package/vendor/rocksdb/db/external_sst_file_test.cc +2859 -0
  263. package/vendor/rocksdb/db/fault_injection_test.cc +637 -0
  264. package/vendor/rocksdb/db/file_indexer.cc +218 -0
  265. package/vendor/rocksdb/db/file_indexer.h +140 -0
  266. package/vendor/rocksdb/db/file_indexer_test.cc +352 -0
  267. package/vendor/rocksdb/db/filename_test.cc +241 -0
  268. package/vendor/rocksdb/db/flush_job.cc +1097 -0
  269. package/vendor/rocksdb/db/flush_job.h +200 -0
  270. package/vendor/rocksdb/db/flush_job_test.cc +743 -0
  271. package/vendor/rocksdb/db/flush_scheduler.cc +86 -0
  272. package/vendor/rocksdb/db/flush_scheduler.h +55 -0
  273. package/vendor/rocksdb/db/forward_iterator.cc +1070 -0
  274. package/vendor/rocksdb/db/forward_iterator.h +166 -0
  275. package/vendor/rocksdb/db/forward_iterator_bench.cc +378 -0
  276. package/vendor/rocksdb/db/history_trimming_iterator.h +95 -0
  277. package/vendor/rocksdb/db/import_column_family_job.cc +364 -0
  278. package/vendor/rocksdb/db/import_column_family_job.h +82 -0
  279. package/vendor/rocksdb/db/import_column_family_test.cc +748 -0
  280. package/vendor/rocksdb/db/internal_stats.cc +2121 -0
  281. package/vendor/rocksdb/db/internal_stats.h +875 -0
  282. package/vendor/rocksdb/db/job_context.h +237 -0
  283. package/vendor/rocksdb/db/kv_checksum.h +484 -0
  284. package/vendor/rocksdb/db/listener_test.cc +1598 -0
  285. package/vendor/rocksdb/db/log_format.h +55 -0
  286. package/vendor/rocksdb/db/log_reader.cc +934 -0
  287. package/vendor/rocksdb/db/log_reader.h +241 -0
  288. package/vendor/rocksdb/db/log_test.cc +1216 -0
  289. package/vendor/rocksdb/db/log_writer.cc +279 -0
  290. package/vendor/rocksdb/db/log_writer.h +144 -0
  291. package/vendor/rocksdb/db/logs_with_prep_tracker.cc +67 -0
  292. package/vendor/rocksdb/db/logs_with_prep_tracker.h +62 -0
  293. package/vendor/rocksdb/db/lookup_key.h +68 -0
  294. package/vendor/rocksdb/db/malloc_stats.cc +53 -0
  295. package/vendor/rocksdb/db/malloc_stats.h +22 -0
  296. package/vendor/rocksdb/db/manual_compaction_test.cc +308 -0
  297. package/vendor/rocksdb/db/memtable.cc +1675 -0
  298. package/vendor/rocksdb/db/memtable.h +660 -0
  299. package/vendor/rocksdb/db/memtable_list.cc +987 -0
  300. package/vendor/rocksdb/db/memtable_list.h +471 -0
  301. package/vendor/rocksdb/db/memtable_list_test.cc +1037 -0
  302. package/vendor/rocksdb/db/merge_context.h +147 -0
  303. package/vendor/rocksdb/db/merge_helper.cc +606 -0
  304. package/vendor/rocksdb/db/merge_helper.h +224 -0
  305. package/vendor/rocksdb/db/merge_helper_test.cc +298 -0
  306. package/vendor/rocksdb/db/merge_operator.cc +85 -0
  307. package/vendor/rocksdb/db/merge_test.cc +621 -0
  308. package/vendor/rocksdb/db/obsolete_files_test.cc +317 -0
  309. package/vendor/rocksdb/db/options_file_test.cc +110 -0
  310. package/vendor/rocksdb/db/output_validator.cc +33 -0
  311. package/vendor/rocksdb/db/output_validator.h +48 -0
  312. package/vendor/rocksdb/db/perf_context_test.cc +1158 -0
  313. package/vendor/rocksdb/db/periodic_task_scheduler.cc +111 -0
  314. package/vendor/rocksdb/db/periodic_task_scheduler.h +108 -0
  315. package/vendor/rocksdb/db/periodic_task_scheduler_test.cc +229 -0
  316. package/vendor/rocksdb/db/pinned_iterators_manager.h +92 -0
  317. package/vendor/rocksdb/db/plain_table_db_test.cc +1348 -0
  318. package/vendor/rocksdb/db/post_memtable_callback.h +25 -0
  319. package/vendor/rocksdb/db/pre_release_callback.h +37 -0
  320. package/vendor/rocksdb/db/prefix_test.cc +894 -0
  321. package/vendor/rocksdb/db/range_del_aggregator.cc +555 -0
  322. package/vendor/rocksdb/db/range_del_aggregator.h +478 -0
  323. package/vendor/rocksdb/db/range_del_aggregator_bench.cc +280 -0
  324. package/vendor/rocksdb/db/range_del_aggregator_test.cc +713 -0
  325. package/vendor/rocksdb/db/range_tombstone_fragmenter.cc +502 -0
  326. package/vendor/rocksdb/db/range_tombstone_fragmenter.h +356 -0
  327. package/vendor/rocksdb/db/range_tombstone_fragmenter_test.cc +555 -0
  328. package/vendor/rocksdb/db/read_callback.h +54 -0
  329. package/vendor/rocksdb/db/repair.cc +839 -0
  330. package/vendor/rocksdb/db/repair_test.cc +484 -0
  331. package/vendor/rocksdb/db/seqno_time_test.cc +994 -0
  332. package/vendor/rocksdb/db/seqno_to_time_mapping.cc +341 -0
  333. package/vendor/rocksdb/db/seqno_to_time_mapping.h +189 -0
  334. package/vendor/rocksdb/db/snapshot_checker.h +58 -0
  335. package/vendor/rocksdb/db/snapshot_impl.cc +25 -0
  336. package/vendor/rocksdb/db/snapshot_impl.h +239 -0
  337. package/vendor/rocksdb/db/table_cache.cc +710 -0
  338. package/vendor/rocksdb/db/table_cache.h +283 -0
  339. package/vendor/rocksdb/db/table_cache_sync_and_async.h +130 -0
  340. package/vendor/rocksdb/db/table_properties_collector.cc +74 -0
  341. package/vendor/rocksdb/db/table_properties_collector.h +177 -0
  342. package/vendor/rocksdb/db/table_properties_collector_test.cc +512 -0
  343. package/vendor/rocksdb/db/transaction_log_impl.cc +296 -0
  344. package/vendor/rocksdb/db/transaction_log_impl.h +128 -0
  345. package/vendor/rocksdb/db/trim_history_scheduler.cc +54 -0
  346. package/vendor/rocksdb/db/trim_history_scheduler.h +46 -0
  347. package/vendor/rocksdb/db/version_builder.cc +1426 -0
  348. package/vendor/rocksdb/db/version_builder.h +93 -0
  349. package/vendor/rocksdb/db/version_builder_test.cc +1840 -0
  350. package/vendor/rocksdb/db/version_edit.cc +1059 -0
  351. package/vendor/rocksdb/db/version_edit.h +702 -0
  352. package/vendor/rocksdb/db/version_edit_handler.cc +1017 -0
  353. package/vendor/rocksdb/db/version_edit_handler.h +334 -0
  354. package/vendor/rocksdb/db/version_edit_test.cc +732 -0
  355. package/vendor/rocksdb/db/version_set.cc +7286 -0
  356. package/vendor/rocksdb/db/version_set.h +1714 -0
  357. package/vendor/rocksdb/db/version_set_sync_and_async.h +172 -0
  358. package/vendor/rocksdb/db/version_set_test.cc +3659 -0
  359. package/vendor/rocksdb/db/version_util.h +72 -0
  360. package/vendor/rocksdb/db/wal_edit.cc +211 -0
  361. package/vendor/rocksdb/db/wal_edit.h +177 -0
  362. package/vendor/rocksdb/db/wal_edit_test.cc +213 -0
  363. package/vendor/rocksdb/db/wal_manager.cc +527 -0
  364. package/vendor/rocksdb/db/wal_manager.h +136 -0
  365. package/vendor/rocksdb/db/wal_manager_test.cc +336 -0
  366. package/vendor/rocksdb/db/wide/db_wide_basic_test.cc +1042 -0
  367. package/vendor/rocksdb/db/wide/wide_column_serialization.cc +182 -0
  368. package/vendor/rocksdb/db/wide/wide_column_serialization.h +77 -0
  369. package/vendor/rocksdb/db/wide/wide_column_serialization_test.cc +338 -0
  370. package/vendor/rocksdb/db/wide/wide_columns.cc +22 -0
  371. package/vendor/rocksdb/db/write_batch.cc +3142 -0
  372. package/vendor/rocksdb/db/write_batch_base.cc +94 -0
  373. package/vendor/rocksdb/db/write_batch_internal.h +401 -0
  374. package/vendor/rocksdb/db/write_batch_test.cc +1112 -0
  375. package/vendor/rocksdb/db/write_callback.h +27 -0
  376. package/vendor/rocksdb/db/write_callback_test.cc +454 -0
  377. package/vendor/rocksdb/db/write_controller.cc +121 -0
  378. package/vendor/rocksdb/db/write_controller.h +148 -0
  379. package/vendor/rocksdb/db/write_controller_test.cc +248 -0
  380. package/vendor/rocksdb/db/write_stall_stats.cc +179 -0
  381. package/vendor/rocksdb/db/write_stall_stats.h +47 -0
  382. package/vendor/rocksdb/db/write_thread.cc +844 -0
  383. package/vendor/rocksdb/db/write_thread.h +464 -0
  384. package/vendor/rocksdb/db_stress_tool/CMakeLists.txt +18 -0
  385. package/vendor/rocksdb/db_stress_tool/batched_ops_stress.cc +593 -0
  386. package/vendor/rocksdb/db_stress_tool/cf_consistency_stress.cc +892 -0
  387. package/vendor/rocksdb/db_stress_tool/db_stress.cc +25 -0
  388. package/vendor/rocksdb/db_stress_tool/db_stress_common.cc +491 -0
  389. package/vendor/rocksdb/db_stress_tool/db_stress_common.h +674 -0
  390. package/vendor/rocksdb/db_stress_tool/db_stress_compaction_filter.h +96 -0
  391. package/vendor/rocksdb/db_stress_tool/db_stress_driver.cc +216 -0
  392. package/vendor/rocksdb/db_stress_tool/db_stress_driver.h +18 -0
  393. package/vendor/rocksdb/db_stress_tool/db_stress_env_wrapper.h +78 -0
  394. package/vendor/rocksdb/db_stress_tool/db_stress_gflags.cc +1094 -0
  395. package/vendor/rocksdb/db_stress_tool/db_stress_listener.cc +189 -0
  396. package/vendor/rocksdb/db_stress_tool/db_stress_listener.h +269 -0
  397. package/vendor/rocksdb/db_stress_tool/db_stress_shared_state.cc +17 -0
  398. package/vendor/rocksdb/db_stress_tool/db_stress_shared_state.h +437 -0
  399. package/vendor/rocksdb/db_stress_tool/db_stress_stat.cc +17 -0
  400. package/vendor/rocksdb/db_stress_tool/db_stress_stat.h +219 -0
  401. package/vendor/rocksdb/db_stress_tool/db_stress_table_properties_collector.h +65 -0
  402. package/vendor/rocksdb/db_stress_tool/db_stress_test_base.cc +3294 -0
  403. package/vendor/rocksdb/db_stress_tool/db_stress_test_base.h +327 -0
  404. package/vendor/rocksdb/db_stress_tool/db_stress_tool.cc +371 -0
  405. package/vendor/rocksdb/db_stress_tool/expected_state.cc +780 -0
  406. package/vendor/rocksdb/db_stress_tool/expected_state.h +329 -0
  407. package/vendor/rocksdb/db_stress_tool/expected_value.cc +122 -0
  408. package/vendor/rocksdb/db_stress_tool/expected_value.h +206 -0
  409. package/vendor/rocksdb/db_stress_tool/multi_ops_txns_stress.cc +1761 -0
  410. package/vendor/rocksdb/db_stress_tool/multi_ops_txns_stress.h +446 -0
  411. package/vendor/rocksdb/db_stress_tool/no_batched_ops_stress.cc +1906 -0
  412. package/vendor/rocksdb/docs/CNAME +1 -0
  413. package/vendor/rocksdb/docs/CONTRIBUTING.md +115 -0
  414. package/vendor/rocksdb/docs/Gemfile +4 -0
  415. package/vendor/rocksdb/docs/LICENSE-DOCUMENTATION +385 -0
  416. package/vendor/rocksdb/docs/README.md +80 -0
  417. package/vendor/rocksdb/docs/TEMPLATE-INFORMATION.md +17 -0
  418. package/vendor/rocksdb/docs/_config.yml +85 -0
  419. package/vendor/rocksdb/docs/_data/authors.yml +81 -0
  420. package/vendor/rocksdb/docs/_data/features.yml +19 -0
  421. package/vendor/rocksdb/docs/_data/nav.yml +30 -0
  422. package/vendor/rocksdb/docs/_data/nav_docs.yml +3 -0
  423. package/vendor/rocksdb/docs/_data/powered_by.yml +1 -0
  424. package/vendor/rocksdb/docs/_data/powered_by_highlight.yml +1 -0
  425. package/vendor/rocksdb/docs/_data/promo.yml +6 -0
  426. package/vendor/rocksdb/docs/_docs/faq.md +48 -0
  427. package/vendor/rocksdb/docs/_docs/getting-started.md +78 -0
  428. package/vendor/rocksdb/docs/_includes/blog_pagination.html +28 -0
  429. package/vendor/rocksdb/docs/_includes/content/gridblocks.html +5 -0
  430. package/vendor/rocksdb/docs/_includes/content/items/gridblock.html +37 -0
  431. package/vendor/rocksdb/docs/_includes/doc.html +25 -0
  432. package/vendor/rocksdb/docs/_includes/doc_paging.html +0 -0
  433. package/vendor/rocksdb/docs/_includes/footer.html +34 -0
  434. package/vendor/rocksdb/docs/_includes/head.html +23 -0
  435. package/vendor/rocksdb/docs/_includes/header.html +19 -0
  436. package/vendor/rocksdb/docs/_includes/hero.html +0 -0
  437. package/vendor/rocksdb/docs/_includes/home_header.html +22 -0
  438. package/vendor/rocksdb/docs/_includes/katex_import.html +3 -0
  439. package/vendor/rocksdb/docs/_includes/katex_render.html +210 -0
  440. package/vendor/rocksdb/docs/_includes/nav/collection_nav.html +64 -0
  441. package/vendor/rocksdb/docs/_includes/nav/collection_nav_group.html +19 -0
  442. package/vendor/rocksdb/docs/_includes/nav/collection_nav_group_item.html +1 -0
  443. package/vendor/rocksdb/docs/_includes/nav/header_nav.html +30 -0
  444. package/vendor/rocksdb/docs/_includes/nav.html +37 -0
  445. package/vendor/rocksdb/docs/_includes/nav_search.html +15 -0
  446. package/vendor/rocksdb/docs/_includes/plugins/all_share.html +3 -0
  447. package/vendor/rocksdb/docs/_includes/plugins/ascii_cinema.html +2 -0
  448. package/vendor/rocksdb/docs/_includes/plugins/button.html +6 -0
  449. package/vendor/rocksdb/docs/_includes/plugins/github_star.html +4 -0
  450. package/vendor/rocksdb/docs/_includes/plugins/github_watch.html +4 -0
  451. package/vendor/rocksdb/docs/_includes/plugins/google_share.html +5 -0
  452. package/vendor/rocksdb/docs/_includes/plugins/iframe.html +6 -0
  453. package/vendor/rocksdb/docs/_includes/plugins/like_button.html +18 -0
  454. package/vendor/rocksdb/docs/_includes/plugins/plugin_row.html +5 -0
  455. package/vendor/rocksdb/docs/_includes/plugins/post_social_plugins.html +41 -0
  456. package/vendor/rocksdb/docs/_includes/plugins/slideshow.html +88 -0
  457. package/vendor/rocksdb/docs/_includes/plugins/twitter_follow.html +12 -0
  458. package/vendor/rocksdb/docs/_includes/plugins/twitter_share.html +11 -0
  459. package/vendor/rocksdb/docs/_includes/post.html +40 -0
  460. package/vendor/rocksdb/docs/_includes/powered_by.html +28 -0
  461. package/vendor/rocksdb/docs/_includes/social_plugins.html +31 -0
  462. package/vendor/rocksdb/docs/_includes/ui/button.html +1 -0
  463. package/vendor/rocksdb/docs/_layouts/basic.html +12 -0
  464. package/vendor/rocksdb/docs/_layouts/blog.html +11 -0
  465. package/vendor/rocksdb/docs/_layouts/blog_default.html +14 -0
  466. package/vendor/rocksdb/docs/_layouts/default.html +12 -0
  467. package/vendor/rocksdb/docs/_layouts/doc_default.html +14 -0
  468. package/vendor/rocksdb/docs/_layouts/doc_page.html +10 -0
  469. package/vendor/rocksdb/docs/_layouts/docs.html +5 -0
  470. package/vendor/rocksdb/docs/_layouts/home.html +26 -0
  471. package/vendor/rocksdb/docs/_layouts/page.html +3 -0
  472. package/vendor/rocksdb/docs/_layouts/plain.html +10 -0
  473. package/vendor/rocksdb/docs/_layouts/post.html +8 -0
  474. package/vendor/rocksdb/docs/_layouts/redirect.html +6 -0
  475. package/vendor/rocksdb/docs/_layouts/top-level.html +10 -0
  476. package/vendor/rocksdb/docs/_posts/2014-03-27-how-to-backup-rocksdb.markdown +135 -0
  477. package/vendor/rocksdb/docs/_posts/2014-03-27-how-to-persist-in-memory-rocksdb-database.markdown +54 -0
  478. package/vendor/rocksdb/docs/_posts/2014-04-02-the-1st-rocksdb-local-meetup-held-on-march-27-2014.markdown +53 -0
  479. package/vendor/rocksdb/docs/_posts/2014-04-07-rocksdb-2-8-release.markdown +40 -0
  480. package/vendor/rocksdb/docs/_posts/2014-04-21-indexing-sst-files-for-better-lookup-performance.markdown +28 -0
  481. package/vendor/rocksdb/docs/_posts/2014-05-14-lock.markdown +88 -0
  482. package/vendor/rocksdb/docs/_posts/2014-05-19-rocksdb-3-0-release.markdown +24 -0
  483. package/vendor/rocksdb/docs/_posts/2014-05-22-rocksdb-3-1-release.markdown +20 -0
  484. package/vendor/rocksdb/docs/_posts/2014-06-23-plaintable-a-new-file-format.markdown +47 -0
  485. package/vendor/rocksdb/docs/_posts/2014-06-27-avoid-expensive-locks-in-get.markdown +89 -0
  486. package/vendor/rocksdb/docs/_posts/2014-06-27-rocksdb-3-2-release.markdown +30 -0
  487. package/vendor/rocksdb/docs/_posts/2014-07-29-rocksdb-3-3-release.markdown +34 -0
  488. package/vendor/rocksdb/docs/_posts/2014-09-12-cuckoo.markdown +74 -0
  489. package/vendor/rocksdb/docs/_posts/2014-09-12-new-bloom-filter-format.markdown +52 -0
  490. package/vendor/rocksdb/docs/_posts/2014-09-15-rocksdb-3-5-release.markdown +38 -0
  491. package/vendor/rocksdb/docs/_posts/2015-01-16-migrating-from-leveldb-to-rocksdb-2.markdown +112 -0
  492. package/vendor/rocksdb/docs/_posts/2015-02-24-reading-rocksdb-options-from-a-file.markdown +41 -0
  493. package/vendor/rocksdb/docs/_posts/2015-02-27-write-batch-with-index.markdown +20 -0
  494. package/vendor/rocksdb/docs/_posts/2015-04-22-integrating-rocksdb-with-mongodb-2.markdown +16 -0
  495. package/vendor/rocksdb/docs/_posts/2015-06-12-rocksdb-in-osquery.markdown +10 -0
  496. package/vendor/rocksdb/docs/_posts/2015-07-15-rocksdb-2015-h2-roadmap.markdown +92 -0
  497. package/vendor/rocksdb/docs/_posts/2015-07-17-spatial-indexing-in-rocksdb.markdown +78 -0
  498. package/vendor/rocksdb/docs/_posts/2015-07-22-rocksdb-is-now-available-in-windows-platform.markdown +30 -0
  499. package/vendor/rocksdb/docs/_posts/2015-07-23-dynamic-level.markdown +29 -0
  500. package/vendor/rocksdb/docs/_posts/2015-10-27-getthreadlist.markdown +193 -0
  501. package/vendor/rocksdb/docs/_posts/2015-11-10-use-checkpoints-for-efficient-snapshots.markdown +45 -0
  502. package/vendor/rocksdb/docs/_posts/2015-11-16-analysis-file-read-latency-by-level.markdown +244 -0
  503. package/vendor/rocksdb/docs/_posts/2016-01-29-compaction_pri.markdown +51 -0
  504. package/vendor/rocksdb/docs/_posts/2016-02-24-rocksdb-4-2-release.markdown +41 -0
  505. package/vendor/rocksdb/docs/_posts/2016-02-25-rocksdb-ama.markdown +20 -0
  506. package/vendor/rocksdb/docs/_posts/2016-03-07-rocksdb-options-file.markdown +24 -0
  507. package/vendor/rocksdb/docs/_posts/2016-04-26-rocksdb-4-5-1-released.markdown +60 -0
  508. package/vendor/rocksdb/docs/_posts/2016-07-26-rocksdb-4-8-released.markdown +48 -0
  509. package/vendor/rocksdb/docs/_posts/2016-09-28-rocksdb-4-11-2-released.markdown +49 -0
  510. package/vendor/rocksdb/docs/_posts/2017-01-06-rocksdb-5-0-1-released.markdown +26 -0
  511. package/vendor/rocksdb/docs/_posts/2017-02-07-rocksdb-5-1-2-released.markdown +15 -0
  512. package/vendor/rocksdb/docs/_posts/2017-02-17-bulkoad-ingest-sst-file.markdown +50 -0
  513. package/vendor/rocksdb/docs/_posts/2017-03-02-rocksdb-5-2-1-released.markdown +22 -0
  514. package/vendor/rocksdb/docs/_posts/2017-05-12-partitioned-index-filter.markdown +34 -0
  515. package/vendor/rocksdb/docs/_posts/2017-05-14-core-local-stats.markdown +106 -0
  516. package/vendor/rocksdb/docs/_posts/2017-05-26-rocksdb-5-4-5-released.markdown +39 -0
  517. package/vendor/rocksdb/docs/_posts/2017-06-26-17-level-based-changes.markdown +60 -0
  518. package/vendor/rocksdb/docs/_posts/2017-06-29-rocksdb-5-5-1-released.markdown +22 -0
  519. package/vendor/rocksdb/docs/_posts/2017-07-25-rocksdb-5-6-1-released.markdown +22 -0
  520. package/vendor/rocksdb/docs/_posts/2017-08-24-pinnableslice.markdown +37 -0
  521. package/vendor/rocksdb/docs/_posts/2017-08-25-flushwal.markdown +26 -0
  522. package/vendor/rocksdb/docs/_posts/2017-09-28-rocksdb-5-8-released.markdown +25 -0
  523. package/vendor/rocksdb/docs/_posts/2017-12-18-17-auto-tuned-rate-limiter.markdown +28 -0
  524. package/vendor/rocksdb/docs/_posts/2017-12-19-write-prepared-txn.markdown +41 -0
  525. package/vendor/rocksdb/docs/_posts/2018-02-05-rocksdb-5-10-2-released.markdown +22 -0
  526. package/vendor/rocksdb/docs/_posts/2018-08-01-rocksdb-tuning-advisor.markdown +58 -0
  527. package/vendor/rocksdb/docs/_posts/2018-08-23-data-block-hash-index.markdown +118 -0
  528. package/vendor/rocksdb/docs/_posts/2018-11-21-delete-range.markdown +292 -0
  529. package/vendor/rocksdb/docs/_posts/2019-03-08-format-version-4.markdown +36 -0
  530. package/vendor/rocksdb/docs/_posts/2019-08-15-unordered-write.markdown +56 -0
  531. package/vendor/rocksdb/docs/_posts/2021-04-12-universal-improvements.markdown +46 -0
  532. package/vendor/rocksdb/docs/_posts/2021-05-26-integrated-blob-db.markdown +101 -0
  533. package/vendor/rocksdb/docs/_posts/2021-05-26-online-validation.markdown +17 -0
  534. package/vendor/rocksdb/docs/_posts/2021-05-27-rocksdb-secondary-cache.markdown +195 -0
  535. package/vendor/rocksdb/docs/_posts/2021-05-31-dictionary-compression.markdown +157 -0
  536. package/vendor/rocksdb/docs/_posts/2021-12-29-ribbon-filter.markdown +281 -0
  537. package/vendor/rocksdb/docs/_posts/2022-07-18-per-key-value-checksum.markdown +142 -0
  538. package/vendor/rocksdb/docs/_posts/2022-10-05-lost-buffered-write-recovery.markdown +123 -0
  539. package/vendor/rocksdb/docs/_posts/2022-10-07-asynchronous-io-in-rocksdb.markdown +133 -0
  540. package/vendor/rocksdb/docs/_posts/2022-10-31-align-compaction-output-file.markdown +107 -0
  541. package/vendor/rocksdb/docs/_posts/2022-11-09-time-aware-tiered-storage.markdown +121 -0
  542. package/vendor/rocksdb/docs/_sass/_base.scss +492 -0
  543. package/vendor/rocksdb/docs/_sass/_blog.scss +47 -0
  544. package/vendor/rocksdb/docs/_sass/_buttons.scss +47 -0
  545. package/vendor/rocksdb/docs/_sass/_footer.scss +82 -0
  546. package/vendor/rocksdb/docs/_sass/_gridBlock.scss +115 -0
  547. package/vendor/rocksdb/docs/_sass/_header.scss +139 -0
  548. package/vendor/rocksdb/docs/_sass/_poweredby.scss +69 -0
  549. package/vendor/rocksdb/docs/_sass/_promo.scss +55 -0
  550. package/vendor/rocksdb/docs/_sass/_react_docs_nav.scss +332 -0
  551. package/vendor/rocksdb/docs/_sass/_react_header_nav.scss +141 -0
  552. package/vendor/rocksdb/docs/_sass/_reset.scss +43 -0
  553. package/vendor/rocksdb/docs/_sass/_search.scss +142 -0
  554. package/vendor/rocksdb/docs/_sass/_slideshow.scss +48 -0
  555. package/vendor/rocksdb/docs/_sass/_syntax-highlighting.scss +129 -0
  556. package/vendor/rocksdb/docs/_sass/_tables.scss +47 -0
  557. package/vendor/rocksdb/docs/_top-level/support.md +22 -0
  558. package/vendor/rocksdb/docs/blog/all.html +20 -0
  559. package/vendor/rocksdb/docs/blog/index.html +12 -0
  560. package/vendor/rocksdb/docs/css/main.scss +159 -0
  561. package/vendor/rocksdb/docs/doc-type-examples/2016-04-07-blog-post-example.md +21 -0
  562. package/vendor/rocksdb/docs/doc-type-examples/docs-hello-world.md +12 -0
  563. package/vendor/rocksdb/docs/doc-type-examples/top-level-example.md +8 -0
  564. package/vendor/rocksdb/docs/docs/index.html +6 -0
  565. package/vendor/rocksdb/docs/feed.xml +30 -0
  566. package/vendor/rocksdb/docs/index.md +9 -0
  567. package/vendor/rocksdb/docs/static/favicon.png +0 -0
  568. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Black.woff +0 -0
  569. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Black.woff2 +0 -0
  570. package/vendor/rocksdb/docs/static/fonts/LatoLatin-BlackItalic.woff +0 -0
  571. package/vendor/rocksdb/docs/static/fonts/LatoLatin-BlackItalic.woff2 +0 -0
  572. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Italic.woff +0 -0
  573. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Italic.woff2 +0 -0
  574. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Light.woff +0 -0
  575. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Light.woff2 +0 -0
  576. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Regular.woff +0 -0
  577. package/vendor/rocksdb/docs/static/fonts/LatoLatin-Regular.woff2 +0 -0
  578. package/vendor/rocksdb/docs/static/images/Resize-of-20140327_200754-300x225.jpg +0 -0
  579. package/vendor/rocksdb/docs/static/images/align-compaction-output/compaction_output_file_size_compare.png +0 -0
  580. package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_align.png +0 -0
  581. package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_normal.png +0 -0
  582. package/vendor/rocksdb/docs/static/images/align-compaction-output/file_cut_trival_move.png +0 -0
  583. package/vendor/rocksdb/docs/static/images/align-compaction-output/file_size_compare.png +0 -0
  584. package/vendor/rocksdb/docs/static/images/align-compaction-output/write_amp_compare.png +0 -0
  585. package/vendor/rocksdb/docs/static/images/asynchronous-io/mget_async.png +0 -0
  586. package/vendor/rocksdb/docs/static/images/asynchronous-io/scan_async.png +0 -0
  587. package/vendor/rocksdb/docs/static/images/binaryseek.png +0 -0
  588. package/vendor/rocksdb/docs/static/images/bloom_fp_vs_bpk.png +0 -0
  589. package/vendor/rocksdb/docs/static/images/compaction/full-range.png +0 -0
  590. package/vendor/rocksdb/docs/static/images/compaction/l0-l1-contend.png +0 -0
  591. package/vendor/rocksdb/docs/static/images/compaction/l1-l2-contend.png +0 -0
  592. package/vendor/rocksdb/docs/static/images/compaction/part-range-old.png +0 -0
  593. package/vendor/rocksdb/docs/static/images/data-block-hash-index/block-format-binary-seek.png +0 -0
  594. package/vendor/rocksdb/docs/static/images/data-block-hash-index/block-format-hash-index.png +0 -0
  595. package/vendor/rocksdb/docs/static/images/data-block-hash-index/hash-index-data-structure.png +0 -0
  596. package/vendor/rocksdb/docs/static/images/data-block-hash-index/perf-cache-miss.png +0 -0
  597. package/vendor/rocksdb/docs/static/images/data-block-hash-index/perf-throughput.png +0 -0
  598. package/vendor/rocksdb/docs/static/images/delrange/delrange_collapsed.png +0 -0
  599. package/vendor/rocksdb/docs/static/images/delrange/delrange_key_schema.png +0 -0
  600. package/vendor/rocksdb/docs/static/images/delrange/delrange_sst_blocks.png +0 -0
  601. package/vendor/rocksdb/docs/static/images/delrange/delrange_uncollapsed.png +0 -0
  602. package/vendor/rocksdb/docs/static/images/delrange/delrange_write_path.png +0 -0
  603. package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_raw_sampled.png +0 -0
  604. package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_sst_blocks.png +0 -0
  605. package/vendor/rocksdb/docs/static/images/dictcmp/dictcmp_zstd_trained.png +0 -0
  606. package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Legacy_Vs_Integrated.png +0 -0
  607. package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_RW_RO_Perf.png +0 -0
  608. package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Amp.png +0 -0
  609. package/vendor/rocksdb/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Perf.png +0 -0
  610. package/vendor/rocksdb/docs/static/images/kv-checksum/Memtable-entry.png +0 -0
  611. package/vendor/rocksdb/docs/static/images/kv-checksum/Memtable-write.png +0 -0
  612. package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Memtable.png +0 -0
  613. package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Writebatch-to-Memtable.png +0 -0
  614. package/vendor/rocksdb/docs/static/images/kv-checksum/ProtInfo-Writebatch.png +0 -0
  615. package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-fragment.png +0 -0
  616. package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-read.png +0 -0
  617. package/vendor/rocksdb/docs/static/images/kv-checksum/WAL-write.png +0 -0
  618. package/vendor/rocksdb/docs/static/images/kv-checksum/Write-batch.png +0 -0
  619. package/vendor/rocksdb/docs/static/images/kv-checksum/Writebatch-write.png +0 -0
  620. package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/angry-cat.png +0 -0
  621. package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/basic-setup.png +0 -0
  622. package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/happy-cat.png +0 -0
  623. package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/replay-extension.png +0 -0
  624. package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/test-fs-writable-file.png +0 -0
  625. package/vendor/rocksdb/docs/static/images/lost-buffered-write-recovery/trace-extension.png +0 -0
  626. package/vendor/rocksdb/docs/static/images/pcache-blockindex.jpg +0 -0
  627. package/vendor/rocksdb/docs/static/images/pcache-fileindex.jpg +0 -0
  628. package/vendor/rocksdb/docs/static/images/pcache-filelayout.jpg +0 -0
  629. package/vendor/rocksdb/docs/static/images/pcache-readiopath.jpg +0 -0
  630. package/vendor/rocksdb/docs/static/images/pcache-tieredstorage.jpg +0 -0
  631. package/vendor/rocksdb/docs/static/images/pcache-writeiopath.jpg +0 -0
  632. package/vendor/rocksdb/docs/static/images/promo-adapt.svg +8 -0
  633. package/vendor/rocksdb/docs/static/images/promo-flash.svg +28 -0
  634. package/vendor/rocksdb/docs/static/images/promo-operations.svg +6 -0
  635. package/vendor/rocksdb/docs/static/images/promo-performance.svg +134 -0
  636. package/vendor/rocksdb/docs/static/images/rate-limiter/auto-tuned-write-KBps-series.png +0 -0
  637. package/vendor/rocksdb/docs/static/images/rate-limiter/write-KBps-cdf.png +0 -0
  638. package/vendor/rocksdb/docs/static/images/rate-limiter/write-KBps-series.png +0 -0
  639. package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/Mixgraph_hit_rate.png +0 -0
  640. package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/Mixgraph_throughput.png +0 -0
  641. package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/arch_diagram.png +0 -0
  642. package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/insert_flow.png +0 -0
  643. package/vendor/rocksdb/docs/static/images/rocksdb-secondary-cache/lookup_flow.png +0 -0
  644. package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/compaction_moving_up_conflict.png +0 -0
  645. package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/per_key_placement_compaction.png +0 -0
  646. package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_design.png +0 -0
  647. package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_overview.png +0 -0
  648. package/vendor/rocksdb/docs/static/images/time-aware-tiered-storage/tiered_storage_problem.png +0 -0
  649. package/vendor/rocksdb/docs/static/images/tree_example1.png +0 -0
  650. package/vendor/rocksdb/docs/static/logo.svg +76 -0
  651. package/vendor/rocksdb/docs/static/og_image.png +0 -0
  652. package/vendor/rocksdb/env/composite_env.cc +534 -0
  653. package/vendor/rocksdb/env/composite_env_wrapper.h +378 -0
  654. package/vendor/rocksdb/env/emulated_clock.h +114 -0
  655. package/vendor/rocksdb/env/env.cc +1233 -0
  656. package/vendor/rocksdb/env/env_basic_test.cc +397 -0
  657. package/vendor/rocksdb/env/env_chroot.cc +148 -0
  658. package/vendor/rocksdb/env/env_chroot.h +55 -0
  659. package/vendor/rocksdb/env/env_encryption.cc +1346 -0
  660. package/vendor/rocksdb/env/env_encryption_ctr.h +114 -0
  661. package/vendor/rocksdb/env/env_posix.cc +524 -0
  662. package/vendor/rocksdb/env/env_test.cc +3577 -0
  663. package/vendor/rocksdb/env/file_system.cc +277 -0
  664. package/vendor/rocksdb/env/file_system_tracer.cc +564 -0
  665. package/vendor/rocksdb/env/file_system_tracer.h +461 -0
  666. package/vendor/rocksdb/env/fs_posix.cc +1284 -0
  667. package/vendor/rocksdb/env/fs_readonly.h +105 -0
  668. package/vendor/rocksdb/env/fs_remap.cc +341 -0
  669. package/vendor/rocksdb/env/fs_remap.h +137 -0
  670. package/vendor/rocksdb/env/io_posix.cc +1733 -0
  671. package/vendor/rocksdb/env/io_posix.h +523 -0
  672. package/vendor/rocksdb/env/io_posix_test.cc +141 -0
  673. package/vendor/rocksdb/env/mock_env.cc +1058 -0
  674. package/vendor/rocksdb/env/mock_env.h +144 -0
  675. package/vendor/rocksdb/env/mock_env_test.cc +84 -0
  676. package/vendor/rocksdb/env/unique_id_gen.cc +164 -0
  677. package/vendor/rocksdb/env/unique_id_gen.h +85 -0
  678. package/vendor/rocksdb/examples/CMakeLists.txt +45 -0
  679. package/vendor/rocksdb/examples/Makefile +58 -0
  680. package/vendor/rocksdb/examples/README.md +2 -0
  681. package/vendor/rocksdb/examples/c_simple_example.c +96 -0
  682. package/vendor/rocksdb/examples/column_families_example.cc +88 -0
  683. package/vendor/rocksdb/examples/compact_files_example.cc +177 -0
  684. package/vendor/rocksdb/examples/compaction_filter_example.cc +96 -0
  685. package/vendor/rocksdb/examples/multi_processes_example.cc +393 -0
  686. package/vendor/rocksdb/examples/optimistic_transaction_example.cc +190 -0
  687. package/vendor/rocksdb/examples/options_file_example.cc +132 -0
  688. package/vendor/rocksdb/examples/rocksdb_backup_restore_example.cc +99 -0
  689. package/vendor/rocksdb/examples/rocksdb_option_file_example.ini +142 -0
  690. package/vendor/rocksdb/examples/simple_example.cc +93 -0
  691. package/vendor/rocksdb/examples/transaction_example.cc +196 -0
  692. package/vendor/rocksdb/file/delete_scheduler.cc +409 -0
  693. package/vendor/rocksdb/file/delete_scheduler.h +147 -0
  694. package/vendor/rocksdb/file/delete_scheduler_test.cc +717 -0
  695. package/vendor/rocksdb/file/file_prefetch_buffer.cc +955 -0
  696. package/vendor/rocksdb/file/file_prefetch_buffer.h +471 -0
  697. package/vendor/rocksdb/file/file_util.cc +277 -0
  698. package/vendor/rocksdb/file/file_util.h +91 -0
  699. package/vendor/rocksdb/file/filename.cc +523 -0
  700. package/vendor/rocksdb/file/filename.h +188 -0
  701. package/vendor/rocksdb/file/line_file_reader.cc +73 -0
  702. package/vendor/rocksdb/file/line_file_reader.h +60 -0
  703. package/vendor/rocksdb/file/prefetch_test.cc +2374 -0
  704. package/vendor/rocksdb/file/random_access_file_reader.cc +599 -0
  705. package/vendor/rocksdb/file/random_access_file_reader.h +210 -0
  706. package/vendor/rocksdb/file/random_access_file_reader_test.cc +479 -0
  707. package/vendor/rocksdb/file/read_write_util.cc +33 -0
  708. package/vendor/rocksdb/file/read_write_util.h +31 -0
  709. package/vendor/rocksdb/file/readahead_file_info.h +33 -0
  710. package/vendor/rocksdb/file/readahead_raf.cc +169 -0
  711. package/vendor/rocksdb/file/readahead_raf.h +29 -0
  712. package/vendor/rocksdb/file/sequence_file_reader.cc +320 -0
  713. package/vendor/rocksdb/file/sequence_file_reader.h +119 -0
  714. package/vendor/rocksdb/file/sst_file_manager_impl.cc +507 -0
  715. package/vendor/rocksdb/file/sst_file_manager_impl.h +193 -0
  716. package/vendor/rocksdb/file/writable_file_writer.cc +989 -0
  717. package/vendor/rocksdb/file/writable_file_writer.h +320 -0
  718. package/vendor/rocksdb/fuzz/Makefile +67 -0
  719. package/vendor/rocksdb/fuzz/README.md +165 -0
  720. package/vendor/rocksdb/fuzz/db_fuzzer.cc +172 -0
  721. package/vendor/rocksdb/fuzz/db_map_fuzzer.cc +107 -0
  722. package/vendor/rocksdb/fuzz/proto/db_operation.proto +28 -0
  723. package/vendor/rocksdb/fuzz/sst_file_writer_fuzzer.cc +210 -0
  724. package/vendor/rocksdb/fuzz/util.h +29 -0
  725. package/vendor/rocksdb/include/rocksdb/advanced_cache.h +623 -0
  726. package/vendor/rocksdb/include/rocksdb/advanced_options.h +1177 -0
  727. package/vendor/rocksdb/include/rocksdb/block_cache_trace_writer.h +149 -0
  728. package/vendor/rocksdb/include/rocksdb/c.h +2864 -0
  729. package/vendor/rocksdb/include/rocksdb/cache.h +442 -0
  730. package/vendor/rocksdb/include/rocksdb/cache_bench_tool.h +14 -0
  731. package/vendor/rocksdb/include/rocksdb/cleanable.h +128 -0
  732. package/vendor/rocksdb/include/rocksdb/compaction_filter.h +363 -0
  733. package/vendor/rocksdb/include/rocksdb/compaction_job_stats.h +109 -0
  734. package/vendor/rocksdb/include/rocksdb/comparator.h +164 -0
  735. package/vendor/rocksdb/include/rocksdb/compression_type.h +40 -0
  736. package/vendor/rocksdb/include/rocksdb/concurrent_task_limiter.h +51 -0
  737. package/vendor/rocksdb/include/rocksdb/configurable.h +390 -0
  738. package/vendor/rocksdb/include/rocksdb/convenience.h +466 -0
  739. package/vendor/rocksdb/include/rocksdb/customizable.h +229 -0
  740. package/vendor/rocksdb/include/rocksdb/data_structure.h +186 -0
  741. package/vendor/rocksdb/include/rocksdb/db.h +1980 -0
  742. package/vendor/rocksdb/include/rocksdb/db_bench_tool.h +11 -0
  743. package/vendor/rocksdb/include/rocksdb/db_dump_tool.h +43 -0
  744. package/vendor/rocksdb/include/rocksdb/db_stress_tool.h +11 -0
  745. package/vendor/rocksdb/include/rocksdb/env.h +1882 -0
  746. package/vendor/rocksdb/include/rocksdb/env_encryption.h +463 -0
  747. package/vendor/rocksdb/include/rocksdb/experimental.h +56 -0
  748. package/vendor/rocksdb/include/rocksdb/file_checksum.h +146 -0
  749. package/vendor/rocksdb/include/rocksdb/file_system.h +1849 -0
  750. package/vendor/rocksdb/include/rocksdb/filter_policy.h +206 -0
  751. package/vendor/rocksdb/include/rocksdb/flush_block_policy.h +75 -0
  752. package/vendor/rocksdb/include/rocksdb/functor_wrapper.h +56 -0
  753. package/vendor/rocksdb/include/rocksdb/io_status.h +244 -0
  754. package/vendor/rocksdb/include/rocksdb/iostats_context.h +98 -0
  755. package/vendor/rocksdb/include/rocksdb/iterator.h +144 -0
  756. package/vendor/rocksdb/include/rocksdb/ldb_tool.h +42 -0
  757. package/vendor/rocksdb/include/rocksdb/listener.h +840 -0
  758. package/vendor/rocksdb/include/rocksdb/memory_allocator.h +87 -0
  759. package/vendor/rocksdb/include/rocksdb/memtablerep.h +421 -0
  760. package/vendor/rocksdb/include/rocksdb/merge_operator.h +286 -0
  761. package/vendor/rocksdb/include/rocksdb/metadata.h +258 -0
  762. package/vendor/rocksdb/include/rocksdb/options.h +2083 -0
  763. package/vendor/rocksdb/include/rocksdb/perf_context.h +314 -0
  764. package/vendor/rocksdb/include/rocksdb/perf_level.h +36 -0
  765. package/vendor/rocksdb/include/rocksdb/persistent_cache.h +74 -0
  766. package/vendor/rocksdb/include/rocksdb/port_defs.h +22 -0
  767. package/vendor/rocksdb/include/rocksdb/rate_limiter.h +159 -0
  768. package/vendor/rocksdb/include/rocksdb/rocksdb_namespace.h +16 -0
  769. package/vendor/rocksdb/include/rocksdb/secondary_cache.h +139 -0
  770. package/vendor/rocksdb/include/rocksdb/slice.h +264 -0
  771. package/vendor/rocksdb/include/rocksdb/slice_transform.h +135 -0
  772. package/vendor/rocksdb/include/rocksdb/snapshot.h +53 -0
  773. package/vendor/rocksdb/include/rocksdb/sst_dump_tool.h +17 -0
  774. package/vendor/rocksdb/include/rocksdb/sst_file_manager.h +136 -0
  775. package/vendor/rocksdb/include/rocksdb/sst_file_reader.h +45 -0
  776. package/vendor/rocksdb/include/rocksdb/sst_file_writer.h +189 -0
  777. package/vendor/rocksdb/include/rocksdb/sst_partitioner.h +142 -0
  778. package/vendor/rocksdb/include/rocksdb/statistics.h +757 -0
  779. package/vendor/rocksdb/include/rocksdb/stats_history.h +70 -0
  780. package/vendor/rocksdb/include/rocksdb/status.h +574 -0
  781. package/vendor/rocksdb/include/rocksdb/system_clock.h +114 -0
  782. package/vendor/rocksdb/include/rocksdb/table.h +927 -0
  783. package/vendor/rocksdb/include/rocksdb/table_properties.h +332 -0
  784. package/vendor/rocksdb/include/rocksdb/table_reader_caller.h +41 -0
  785. package/vendor/rocksdb/include/rocksdb/thread_status.h +190 -0
  786. package/vendor/rocksdb/include/rocksdb/threadpool.h +67 -0
  787. package/vendor/rocksdb/include/rocksdb/trace_reader_writer.h +52 -0
  788. package/vendor/rocksdb/include/rocksdb/trace_record.h +248 -0
  789. package/vendor/rocksdb/include/rocksdb/trace_record_result.h +187 -0
  790. package/vendor/rocksdb/include/rocksdb/transaction_log.h +122 -0
  791. package/vendor/rocksdb/include/rocksdb/types.h +94 -0
  792. package/vendor/rocksdb/include/rocksdb/unique_id.h +55 -0
  793. package/vendor/rocksdb/include/rocksdb/universal_compaction.h +96 -0
  794. package/vendor/rocksdb/include/rocksdb/utilities/agg_merge.h +138 -0
  795. package/vendor/rocksdb/include/rocksdb/utilities/backup_engine.h +689 -0
  796. package/vendor/rocksdb/include/rocksdb/utilities/cache_dump_load.h +140 -0
  797. package/vendor/rocksdb/include/rocksdb/utilities/checkpoint.h +63 -0
  798. package/vendor/rocksdb/include/rocksdb/utilities/convenience.h +10 -0
  799. package/vendor/rocksdb/include/rocksdb/utilities/customizable_util.h +322 -0
  800. package/vendor/rocksdb/include/rocksdb/utilities/db_ttl.h +70 -0
  801. package/vendor/rocksdb/include/rocksdb/utilities/debug.h +46 -0
  802. package/vendor/rocksdb/include/rocksdb/utilities/env_mirror.h +179 -0
  803. package/vendor/rocksdb/include/rocksdb/utilities/info_log_finder.h +19 -0
  804. package/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd.h +316 -0
  805. package/vendor/rocksdb/include/rocksdb/utilities/ldb_cmd_execute_result.h +75 -0
  806. package/vendor/rocksdb/include/rocksdb/utilities/leveldb_options.h +145 -0
  807. package/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_custom_library.h +43 -0
  808. package/vendor/rocksdb/include/rocksdb/utilities/lua/rocks_lua_util.h +55 -0
  809. package/vendor/rocksdb/include/rocksdb/utilities/memory_util.h +48 -0
  810. package/vendor/rocksdb/include/rocksdb/utilities/object_registry.h +583 -0
  811. package/vendor/rocksdb/include/rocksdb/utilities/optimistic_transaction_db.h +98 -0
  812. package/vendor/rocksdb/include/rocksdb/utilities/option_change_migration.h +24 -0
  813. package/vendor/rocksdb/include/rocksdb/utilities/options_type.h +1221 -0
  814. package/vendor/rocksdb/include/rocksdb/utilities/options_util.h +105 -0
  815. package/vendor/rocksdb/include/rocksdb/utilities/replayer.h +85 -0
  816. package/vendor/rocksdb/include/rocksdb/utilities/sim_cache.h +93 -0
  817. package/vendor/rocksdb/include/rocksdb/utilities/stackable_db.h +587 -0
  818. package/vendor/rocksdb/include/rocksdb/utilities/table_properties_collectors.h +88 -0
  819. package/vendor/rocksdb/include/rocksdb/utilities/transaction.h +683 -0
  820. package/vendor/rocksdb/include/rocksdb/utilities/transaction_db.h +506 -0
  821. package/vendor/rocksdb/include/rocksdb/utilities/transaction_db_mutex.h +89 -0
  822. package/vendor/rocksdb/include/rocksdb/utilities/write_batch_with_index.h +307 -0
  823. package/vendor/rocksdb/include/rocksdb/version.h +43 -0
  824. package/vendor/rocksdb/include/rocksdb/wal_filter.h +111 -0
  825. package/vendor/rocksdb/include/rocksdb/wide_columns.h +210 -0
  826. package/vendor/rocksdb/include/rocksdb/write_batch.h +494 -0
  827. package/vendor/rocksdb/include/rocksdb/write_batch_base.h +144 -0
  828. package/vendor/rocksdb/include/rocksdb/write_buffer_manager.h +183 -0
  829. package/vendor/rocksdb/issue_template.md +7 -0
  830. package/vendor/rocksdb/java/CMakeLists.txt +549 -0
  831. package/vendor/rocksdb/java/GetBenchmarks.md +161 -0
  832. package/vendor/rocksdb/java/HISTORY-JAVA.md +86 -0
  833. package/vendor/rocksdb/java/Makefile +453 -0
  834. package/vendor/rocksdb/java/RELEASE.md +59 -0
  835. package/vendor/rocksdb/java/benchmark/src/main/java/org/rocksdb/benchmark/DbBenchmark.java +1640 -0
  836. package/vendor/rocksdb/java/crossbuild/Vagrantfile +51 -0
  837. package/vendor/rocksdb/java/crossbuild/build-linux-alpine.sh +70 -0
  838. package/vendor/rocksdb/java/crossbuild/build-linux-centos.sh +38 -0
  839. package/vendor/rocksdb/java/crossbuild/build-linux.sh +15 -0
  840. package/vendor/rocksdb/java/crossbuild/docker-build-linux-alpine.sh +17 -0
  841. package/vendor/rocksdb/java/crossbuild/docker-build-linux-centos.sh +38 -0
  842. package/vendor/rocksdb/java/jdb_bench.sh +13 -0
  843. package/vendor/rocksdb/java/jmh/LICENSE-HEADER.txt +5 -0
  844. package/vendor/rocksdb/java/jmh/README.md +24 -0
  845. package/vendor/rocksdb/java/jmh/pom.xml +138 -0
  846. package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/ComparatorBenchmarks.java +139 -0
  847. package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/GetBenchmarks.java +215 -0
  848. package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/MultiGetBenchmarks.java +214 -0
  849. package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/jmh/PutBenchmarks.java +112 -0
  850. package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/util/FileUtils.java +59 -0
  851. package/vendor/rocksdb/java/jmh/src/main/java/org/rocksdb/util/KVUtils.java +72 -0
  852. package/vendor/rocksdb/java/pom.xml.template +178 -0
  853. package/vendor/rocksdb/java/rocksjni/backup_engine_options.cc +365 -0
  854. package/vendor/rocksdb/java/rocksjni/backupenginejni.cc +279 -0
  855. package/vendor/rocksdb/java/rocksjni/cache.cc +34 -0
  856. package/vendor/rocksdb/java/rocksjni/cassandra_compactionfilterjni.cc +25 -0
  857. package/vendor/rocksdb/java/rocksjni/cassandra_value_operator.cc +50 -0
  858. package/vendor/rocksdb/java/rocksjni/checkpoint.cc +71 -0
  859. package/vendor/rocksdb/java/rocksjni/clock_cache.cc +42 -0
  860. package/vendor/rocksdb/java/rocksjni/columnfamilyhandle.cc +72 -0
  861. package/vendor/rocksdb/java/rocksjni/compact_range_options.cc +222 -0
  862. package/vendor/rocksdb/java/rocksjni/compaction_filter.cc +29 -0
  863. package/vendor/rocksdb/java/rocksjni/compaction_filter_factory.cc +42 -0
  864. package/vendor/rocksdb/java/rocksjni/compaction_filter_factory_jnicallback.cc +79 -0
  865. package/vendor/rocksdb/java/rocksjni/compaction_filter_factory_jnicallback.h +37 -0
  866. package/vendor/rocksdb/java/rocksjni/compaction_job_info.cc +230 -0
  867. package/vendor/rocksdb/java/rocksjni/compaction_job_stats.cc +345 -0
  868. package/vendor/rocksdb/java/rocksjni/compaction_options.cc +112 -0
  869. package/vendor/rocksdb/java/rocksjni/compaction_options_fifo.cc +83 -0
  870. package/vendor/rocksdb/java/rocksjni/compaction_options_universal.cc +209 -0
  871. package/vendor/rocksdb/java/rocksjni/comparator.cc +60 -0
  872. package/vendor/rocksdb/java/rocksjni/comparatorjnicallback.cc +647 -0
  873. package/vendor/rocksdb/java/rocksjni/comparatorjnicallback.h +137 -0
  874. package/vendor/rocksdb/java/rocksjni/compression_options.cc +214 -0
  875. package/vendor/rocksdb/java/rocksjni/concurrent_task_limiter.cc +97 -0
  876. package/vendor/rocksdb/java/rocksjni/config_options.cc +103 -0
  877. package/vendor/rocksdb/java/rocksjni/cplusplus_to_java_convert.h +37 -0
  878. package/vendor/rocksdb/java/rocksjni/env.cc +205 -0
  879. package/vendor/rocksdb/java/rocksjni/env_options.cc +305 -0
  880. package/vendor/rocksdb/java/rocksjni/event_listener.cc +44 -0
  881. package/vendor/rocksdb/java/rocksjni/event_listener_jnicallback.cc +502 -0
  882. package/vendor/rocksdb/java/rocksjni/event_listener_jnicallback.h +122 -0
  883. package/vendor/rocksdb/java/rocksjni/filter.cc +46 -0
  884. package/vendor/rocksdb/java/rocksjni/ingest_external_file_options.cc +199 -0
  885. package/vendor/rocksdb/java/rocksjni/iterator.cc +340 -0
  886. package/vendor/rocksdb/java/rocksjni/jnicallback.cc +54 -0
  887. package/vendor/rocksdb/java/rocksjni/jnicallback.h +32 -0
  888. package/vendor/rocksdb/java/rocksjni/loggerjnicallback.cc +299 -0
  889. package/vendor/rocksdb/java/rocksjni/loggerjnicallback.h +51 -0
  890. package/vendor/rocksdb/java/rocksjni/lru_cache.cc +49 -0
  891. package/vendor/rocksdb/java/rocksjni/memory_util.cc +100 -0
  892. package/vendor/rocksdb/java/rocksjni/memtablejni.cc +94 -0
  893. package/vendor/rocksdb/java/rocksjni/merge_operator.cc +98 -0
  894. package/vendor/rocksdb/java/rocksjni/native_comparator_wrapper_test.cc +45 -0
  895. package/vendor/rocksdb/java/rocksjni/optimistic_transaction_db.cc +270 -0
  896. package/vendor/rocksdb/java/rocksjni/optimistic_transaction_options.cc +78 -0
  897. package/vendor/rocksdb/java/rocksjni/options.cc +8695 -0
  898. package/vendor/rocksdb/java/rocksjni/options_util.cc +139 -0
  899. package/vendor/rocksdb/java/rocksjni/persistent_cache.cc +60 -0
  900. package/vendor/rocksdb/java/rocksjni/portal.h +8706 -0
  901. package/vendor/rocksdb/java/rocksjni/ratelimiterjni.cc +128 -0
  902. package/vendor/rocksdb/java/rocksjni/remove_emptyvalue_compactionfilterjni.cc +24 -0
  903. package/vendor/rocksdb/java/rocksjni/restorejni.cc +42 -0
  904. package/vendor/rocksdb/java/rocksjni/rocks_callback_object.cc +30 -0
  905. package/vendor/rocksdb/java/rocksjni/rocksdb_exception_test.cc +81 -0
  906. package/vendor/rocksdb/java/rocksjni/rocksjni.cc +3957 -0
  907. package/vendor/rocksdb/java/rocksjni/slice.cc +374 -0
  908. package/vendor/rocksdb/java/rocksjni/snapshot.cc +27 -0
  909. package/vendor/rocksdb/java/rocksjni/sst_file_manager.cc +250 -0
  910. package/vendor/rocksdb/java/rocksjni/sst_file_reader_iterator.cc +373 -0
  911. package/vendor/rocksdb/java/rocksjni/sst_file_readerjni.cc +118 -0
  912. package/vendor/rocksdb/java/rocksjni/sst_file_writerjni.cc +310 -0
  913. package/vendor/rocksdb/java/rocksjni/sst_partitioner.cc +43 -0
  914. package/vendor/rocksdb/java/rocksjni/statistics.cc +268 -0
  915. package/vendor/rocksdb/java/rocksjni/statisticsjni.cc +31 -0
  916. package/vendor/rocksdb/java/rocksjni/statisticsjni.h +34 -0
  917. package/vendor/rocksdb/java/rocksjni/table.cc +145 -0
  918. package/vendor/rocksdb/java/rocksjni/table_filter.cc +27 -0
  919. package/vendor/rocksdb/java/rocksjni/table_filter_jnicallback.cc +66 -0
  920. package/vendor/rocksdb/java/rocksjni/table_filter_jnicallback.h +36 -0
  921. package/vendor/rocksdb/java/rocksjni/testable_event_listener.cc +219 -0
  922. package/vendor/rocksdb/java/rocksjni/thread_status.cc +125 -0
  923. package/vendor/rocksdb/java/rocksjni/trace_writer.cc +24 -0
  924. package/vendor/rocksdb/java/rocksjni/trace_writer_jnicallback.cc +118 -0
  925. package/vendor/rocksdb/java/rocksjni/trace_writer_jnicallback.h +36 -0
  926. package/vendor/rocksdb/java/rocksjni/transaction.cc +1655 -0
  927. package/vendor/rocksdb/java/rocksjni/transaction_db.cc +451 -0
  928. package/vendor/rocksdb/java/rocksjni/transaction_db_options.cc +169 -0
  929. package/vendor/rocksdb/java/rocksjni/transaction_log.cc +80 -0
  930. package/vendor/rocksdb/java/rocksjni/transaction_notifier.cc +44 -0
  931. package/vendor/rocksdb/java/rocksjni/transaction_notifier_jnicallback.cc +42 -0
  932. package/vendor/rocksdb/java/rocksjni/transaction_notifier_jnicallback.h +42 -0
  933. package/vendor/rocksdb/java/rocksjni/transaction_options.cc +191 -0
  934. package/vendor/rocksdb/java/rocksjni/ttl.cc +212 -0
  935. package/vendor/rocksdb/java/rocksjni/wal_filter.cc +24 -0
  936. package/vendor/rocksdb/java/rocksjni/wal_filter_jnicallback.cc +139 -0
  937. package/vendor/rocksdb/java/rocksjni/wal_filter_jnicallback.h +42 -0
  938. package/vendor/rocksdb/java/rocksjni/write_batch.cc +676 -0
  939. package/vendor/rocksdb/java/rocksjni/write_batch_test.cc +199 -0
  940. package/vendor/rocksdb/java/rocksjni/write_batch_with_index.cc +953 -0
  941. package/vendor/rocksdb/java/rocksjni/write_buffer_manager.cc +47 -0
  942. package/vendor/rocksdb/java/rocksjni/writebatchhandlerjnicallback.cc +519 -0
  943. package/vendor/rocksdb/java/rocksjni/writebatchhandlerjnicallback.h +92 -0
  944. package/vendor/rocksdb/java/samples/src/main/java/OptimisticTransactionSample.java +184 -0
  945. package/vendor/rocksdb/java/samples/src/main/java/RocksDBColumnFamilySample.java +78 -0
  946. package/vendor/rocksdb/java/samples/src/main/java/RocksDBSample.java +295 -0
  947. package/vendor/rocksdb/java/samples/src/main/java/TransactionSample.java +183 -0
  948. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractCompactionFilter.java +59 -0
  949. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractCompactionFilterFactory.java +77 -0
  950. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractComparator.java +124 -0
  951. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractComparatorJniBridge.java +119 -0
  952. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractEventListener.java +334 -0
  953. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractImmutableNativeReference.java +65 -0
  954. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractMutableOptions.java +368 -0
  955. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractNativeReference.java +49 -0
  956. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractRocksIterator.java +146 -0
  957. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractSlice.java +191 -0
  958. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTableFilter.java +20 -0
  959. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTraceWriter.java +70 -0
  960. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractTransactionNotifier.java +54 -0
  961. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractWalFilter.java +49 -0
  962. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AbstractWriteBatch.java +203 -0
  963. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AccessHint.java +53 -0
  964. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AdvancedColumnFamilyOptionsInterface.java +463 -0
  965. package/vendor/rocksdb/java/src/main/java/org/rocksdb/AdvancedMutableColumnFamilyOptionsInterface.java +830 -0
  966. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackgroundErrorReason.java +46 -0
  967. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupEngine.java +259 -0
  968. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupEngineOptions.java +458 -0
  969. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BackupInfo.java +76 -0
  970. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BlockBasedTableConfig.java +951 -0
  971. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BloomFilter.java +73 -0
  972. package/vendor/rocksdb/java/src/main/java/org/rocksdb/BuiltinComparator.java +20 -0
  973. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ByteBufferGetStatus.java +50 -0
  974. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Cache.java +40 -0
  975. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CassandraCompactionFilter.java +20 -0
  976. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CassandraValueMergeOperator.java +25 -0
  977. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Checkpoint.java +62 -0
  978. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ChecksumType.java +45 -0
  979. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ClockCache.java +59 -0
  980. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyDescriptor.java +84 -0
  981. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyHandle.java +151 -0
  982. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyMetaData.java +70 -0
  983. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyOptions.java +1543 -0
  984. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ColumnFamilyOptionsInterface.java +536 -0
  985. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactRangeOptions.java +245 -0
  986. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionJobInfo.java +161 -0
  987. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionJobStats.java +295 -0
  988. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptions.java +121 -0
  989. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsFIFO.java +87 -0
  990. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionOptionsUniversal.java +273 -0
  991. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionPriority.java +81 -0
  992. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionReason.java +141 -0
  993. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionStopStyle.java +55 -0
  994. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompactionStyle.java +81 -0
  995. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ComparatorOptions.java +133 -0
  996. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ComparatorType.java +48 -0
  997. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompressionOptions.java +150 -0
  998. package/vendor/rocksdb/java/src/main/java/org/rocksdb/CompressionType.java +121 -0
  999. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiter.java +44 -0
  1000. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConcurrentTaskLimiterImpl.java +48 -0
  1001. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ConfigOptions.java +53 -0
  1002. package/vendor/rocksdb/java/src/main/java/org/rocksdb/DBOptions.java +1496 -0
  1003. package/vendor/rocksdb/java/src/main/java/org/rocksdb/DBOptionsInterface.java +1756 -0
  1004. package/vendor/rocksdb/java/src/main/java/org/rocksdb/DataBlockIndexType.java +32 -0
  1005. package/vendor/rocksdb/java/src/main/java/org/rocksdb/DbPath.java +47 -0
  1006. package/vendor/rocksdb/java/src/main/java/org/rocksdb/DirectSlice.java +136 -0
  1007. package/vendor/rocksdb/java/src/main/java/org/rocksdb/EncodingType.java +55 -0
  1008. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Env.java +167 -0
  1009. package/vendor/rocksdb/java/src/main/java/org/rocksdb/EnvOptions.java +366 -0
  1010. package/vendor/rocksdb/java/src/main/java/org/rocksdb/EventListener.java +335 -0
  1011. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Experimental.java +23 -0
  1012. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ExternalFileIngestionInfo.java +103 -0
  1013. package/vendor/rocksdb/java/src/main/java/org/rocksdb/FileOperationInfo.java +112 -0
  1014. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Filter.java +36 -0
  1015. package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushJobInfo.java +186 -0
  1016. package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushOptions.java +90 -0
  1017. package/vendor/rocksdb/java/src/main/java/org/rocksdb/FlushReason.java +53 -0
  1018. package/vendor/rocksdb/java/src/main/java/org/rocksdb/HashLinkedListMemTableConfig.java +174 -0
  1019. package/vendor/rocksdb/java/src/main/java/org/rocksdb/HashSkipListMemTableConfig.java +106 -0
  1020. package/vendor/rocksdb/java/src/main/java/org/rocksdb/HistogramData.java +75 -0
  1021. package/vendor/rocksdb/java/src/main/java/org/rocksdb/HistogramType.java +214 -0
  1022. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Holder.java +46 -0
  1023. package/vendor/rocksdb/java/src/main/java/org/rocksdb/IndexShorteningMode.java +60 -0
  1024. package/vendor/rocksdb/java/src/main/java/org/rocksdb/IndexType.java +55 -0
  1025. package/vendor/rocksdb/java/src/main/java/org/rocksdb/InfoLogLevel.java +49 -0
  1026. package/vendor/rocksdb/java/src/main/java/org/rocksdb/IngestExternalFileOptions.java +227 -0
  1027. package/vendor/rocksdb/java/src/main/java/org/rocksdb/KeyMayExist.java +35 -0
  1028. package/vendor/rocksdb/java/src/main/java/org/rocksdb/LRUCache.java +106 -0
  1029. package/vendor/rocksdb/java/src/main/java/org/rocksdb/LevelMetaData.java +56 -0
  1030. package/vendor/rocksdb/java/src/main/java/org/rocksdb/LiveFileMetaData.java +55 -0
  1031. package/vendor/rocksdb/java/src/main/java/org/rocksdb/LogFile.java +75 -0
  1032. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Logger.java +121 -0
  1033. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemTableConfig.java +29 -0
  1034. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemTableInfo.java +103 -0
  1035. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemoryUsageType.java +72 -0
  1036. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MemoryUtil.java +60 -0
  1037. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MergeOperator.java +18 -0
  1038. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptions.java +621 -0
  1039. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableColumnFamilyOptionsInterface.java +156 -0
  1040. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableDBOptions.java +292 -0
  1041. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableDBOptionsInterface.java +440 -0
  1042. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableOptionKey.java +16 -0
  1043. package/vendor/rocksdb/java/src/main/java/org/rocksdb/MutableOptionValue.java +368 -0
  1044. package/vendor/rocksdb/java/src/main/java/org/rocksdb/NativeComparatorWrapper.java +59 -0
  1045. package/vendor/rocksdb/java/src/main/java/org/rocksdb/NativeLibraryLoader.java +172 -0
  1046. package/vendor/rocksdb/java/src/main/java/org/rocksdb/OperationStage.java +59 -0
  1047. package/vendor/rocksdb/java/src/main/java/org/rocksdb/OperationType.java +55 -0
  1048. package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptimisticTransactionDB.java +224 -0
  1049. package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptimisticTransactionOptions.java +53 -0
  1050. package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptionString.java +261 -0
  1051. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Options.java +2574 -0
  1052. package/vendor/rocksdb/java/src/main/java/org/rocksdb/OptionsUtil.java +101 -0
  1053. package/vendor/rocksdb/java/src/main/java/org/rocksdb/PersistentCache.java +26 -0
  1054. package/vendor/rocksdb/java/src/main/java/org/rocksdb/PlainTableConfig.java +251 -0
  1055. package/vendor/rocksdb/java/src/main/java/org/rocksdb/PrepopulateBlobCache.java +117 -0
  1056. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Priority.java +49 -0
  1057. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Range.java +19 -0
  1058. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RateLimiter.java +227 -0
  1059. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RateLimiterMode.java +52 -0
  1060. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReadOptions.java +822 -0
  1061. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReadTier.java +49 -0
  1062. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RemoveEmptyValueCompactionFilter.java +18 -0
  1063. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RestoreOptions.java +32 -0
  1064. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ReusedSynchronisationType.java +65 -0
  1065. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksCallbackObject.java +73 -0
  1066. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksDB.java +4688 -0
  1067. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksDBException.java +44 -0
  1068. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksEnv.java +31 -0
  1069. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksIterator.java +140 -0
  1070. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksIteratorInterface.java +127 -0
  1071. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksMemEnv.java +31 -0
  1072. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksMutableObject.java +87 -0
  1073. package/vendor/rocksdb/java/src/main/java/org/rocksdb/RocksObject.java +45 -0
  1074. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SanityLevel.java +47 -0
  1075. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SizeApproximationFlag.java +31 -0
  1076. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SkipListMemTableConfig.java +51 -0
  1077. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Slice.java +135 -0
  1078. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Snapshot.java +41 -0
  1079. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileManager.java +249 -0
  1080. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileMetaData.java +162 -0
  1081. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileReader.java +82 -0
  1082. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileReaderIterator.java +140 -0
  1083. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstFileWriter.java +237 -0
  1084. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstPartitionerFactory.java +15 -0
  1085. package/vendor/rocksdb/java/src/main/java/org/rocksdb/SstPartitionerFixedPrefixFactory.java +19 -0
  1086. package/vendor/rocksdb/java/src/main/java/org/rocksdb/StateType.java +53 -0
  1087. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Statistics.java +153 -0
  1088. package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatisticsCollector.java +102 -0
  1089. package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatisticsCollectorCallback.java +32 -0
  1090. package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatsCollectorInput.java +35 -0
  1091. package/vendor/rocksdb/java/src/main/java/org/rocksdb/StatsLevel.java +65 -0
  1092. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Status.java +155 -0
  1093. package/vendor/rocksdb/java/src/main/java/org/rocksdb/StringAppendOperator.java +29 -0
  1094. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationBriefInfo.java +107 -0
  1095. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationInfo.java +86 -0
  1096. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileCreationReason.java +46 -0
  1097. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFileDeletionInfo.java +86 -0
  1098. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFilter.java +21 -0
  1099. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableFormatConfig.java +22 -0
  1100. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TableProperties.java +426 -0
  1101. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ThreadStatus.java +224 -0
  1102. package/vendor/rocksdb/java/src/main/java/org/rocksdb/ThreadType.java +65 -0
  1103. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TickerType.java +802 -0
  1104. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TimedEnv.java +30 -0
  1105. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TraceOptions.java +32 -0
  1106. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TraceWriter.java +36 -0
  1107. package/vendor/rocksdb/java/src/main/java/org/rocksdb/Transaction.java +2162 -0
  1108. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionDB.java +401 -0
  1109. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionDBOptions.java +216 -0
  1110. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionLogIterator.java +112 -0
  1111. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionOptions.java +189 -0
  1112. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionalDB.java +65 -0
  1113. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TransactionalOptions.java +31 -0
  1114. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TtlDB.java +242 -0
  1115. package/vendor/rocksdb/java/src/main/java/org/rocksdb/TxnDBWritePolicy.java +62 -0
  1116. package/vendor/rocksdb/java/src/main/java/org/rocksdb/UInt64AddOperator.java +19 -0
  1117. package/vendor/rocksdb/java/src/main/java/org/rocksdb/VectorMemTableConfig.java +46 -0
  1118. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WALRecoveryMode.java +82 -0
  1119. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WBWIRocksIterator.java +203 -0
  1120. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalFileType.java +55 -0
  1121. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalFilter.java +86 -0
  1122. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WalProcessingOption.java +54 -0
  1123. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatch.java +394 -0
  1124. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatchInterface.java +283 -0
  1125. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBatchWithIndex.java +358 -0
  1126. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteBufferManager.java +50 -0
  1127. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteOptions.java +255 -0
  1128. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteStallCondition.java +44 -0
  1129. package/vendor/rocksdb/java/src/main/java/org/rocksdb/WriteStallInfo.java +75 -0
  1130. package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/ByteUtil.java +52 -0
  1131. package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/BytewiseComparator.java +121 -0
  1132. package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/Environment.java +245 -0
  1133. package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/IntComparator.java +67 -0
  1134. package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/ReverseBytewiseComparator.java +88 -0
  1135. package/vendor/rocksdb/java/src/main/java/org/rocksdb/util/SizeUnit.java +16 -0
  1136. package/vendor/rocksdb/java/src/test/java/org/rocksdb/AbstractTransactionTest.java +979 -0
  1137. package/vendor/rocksdb/java/src/test/java/org/rocksdb/BackupEngineOptionsTest.java +297 -0
  1138. package/vendor/rocksdb/java/src/test/java/org/rocksdb/BackupEngineTest.java +261 -0
  1139. package/vendor/rocksdb/java/src/test/java/org/rocksdb/BlobOptionsTest.java +353 -0
  1140. package/vendor/rocksdb/java/src/test/java/org/rocksdb/BlockBasedTableConfigTest.java +415 -0
  1141. package/vendor/rocksdb/java/src/test/java/org/rocksdb/BuiltinComparatorTest.java +145 -0
  1142. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ByteBufferUnsupportedOperationTest.java +132 -0
  1143. package/vendor/rocksdb/java/src/test/java/org/rocksdb/BytewiseComparatorRegressionTest.java +132 -0
  1144. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CheckPointTest.java +82 -0
  1145. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ClockCacheTest.java +25 -0
  1146. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyOptionsTest.java +712 -0
  1147. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ColumnFamilyTest.java +562 -0
  1148. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactRangeOptionsTest.java +102 -0
  1149. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionFilterFactoryTest.java +61 -0
  1150. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionJobInfoTest.java +114 -0
  1151. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionJobStatsTest.java +196 -0
  1152. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsFIFOTest.java +35 -0
  1153. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsTest.java +52 -0
  1154. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionOptionsUniversalTest.java +80 -0
  1155. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionPriorityTest.java +31 -0
  1156. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompactionStopStyleTest.java +31 -0
  1157. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ComparatorOptionsTest.java +58 -0
  1158. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompressionOptionsTest.java +71 -0
  1159. package/vendor/rocksdb/java/src/test/java/org/rocksdb/CompressionTypesTest.java +25 -0
  1160. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ConcurrentTaskLimiterTest.java +56 -0
  1161. package/vendor/rocksdb/java/src/test/java/org/rocksdb/DBOptionsTest.java +902 -0
  1162. package/vendor/rocksdb/java/src/test/java/org/rocksdb/DefaultEnvTest.java +113 -0
  1163. package/vendor/rocksdb/java/src/test/java/org/rocksdb/DirectSliceTest.java +93 -0
  1164. package/vendor/rocksdb/java/src/test/java/org/rocksdb/EnvOptionsTest.java +145 -0
  1165. package/vendor/rocksdb/java/src/test/java/org/rocksdb/EventListenerTest.java +725 -0
  1166. package/vendor/rocksdb/java/src/test/java/org/rocksdb/FilterTest.java +39 -0
  1167. package/vendor/rocksdb/java/src/test/java/org/rocksdb/FlushOptionsTest.java +31 -0
  1168. package/vendor/rocksdb/java/src/test/java/org/rocksdb/FlushTest.java +49 -0
  1169. package/vendor/rocksdb/java/src/test/java/org/rocksdb/InfoLogLevelTest.java +109 -0
  1170. package/vendor/rocksdb/java/src/test/java/org/rocksdb/IngestExternalFileOptionsTest.java +107 -0
  1171. package/vendor/rocksdb/java/src/test/java/org/rocksdb/KeyMayExistTest.java +528 -0
  1172. package/vendor/rocksdb/java/src/test/java/org/rocksdb/LRUCacheTest.java +32 -0
  1173. package/vendor/rocksdb/java/src/test/java/org/rocksdb/LoggerTest.java +235 -0
  1174. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MemTableTest.java +108 -0
  1175. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MemoryUtilTest.java +136 -0
  1176. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MergeTest.java +465 -0
  1177. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MixedOptionsTest.java +85 -0
  1178. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiColumnRegressionTest.java +145 -0
  1179. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiGetManyKeysTest.java +241 -0
  1180. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MultiGetTest.java +530 -0
  1181. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableColumnFamilyOptionsTest.java +167 -0
  1182. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableDBOptionsTest.java +85 -0
  1183. package/vendor/rocksdb/java/src/test/java/org/rocksdb/MutableOptionsGetSetTest.java +429 -0
  1184. package/vendor/rocksdb/java/src/test/java/org/rocksdb/NativeComparatorWrapperTest.java +90 -0
  1185. package/vendor/rocksdb/java/src/test/java/org/rocksdb/NativeLibraryLoaderTest.java +41 -0
  1186. package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionDBTest.java +131 -0
  1187. package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionOptionsTest.java +38 -0
  1188. package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptimisticTransactionTest.java +446 -0
  1189. package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptionsTest.java +1488 -0
  1190. package/vendor/rocksdb/java/src/test/java/org/rocksdb/OptionsUtilTest.java +129 -0
  1191. package/vendor/rocksdb/java/src/test/java/org/rocksdb/PlainTableConfigTest.java +89 -0
  1192. package/vendor/rocksdb/java/src/test/java/org/rocksdb/PlatformRandomHelper.java +58 -0
  1193. package/vendor/rocksdb/java/src/test/java/org/rocksdb/PutMultiplePartsTest.java +164 -0
  1194. package/vendor/rocksdb/java/src/test/java/org/rocksdb/RateLimiterTest.java +65 -0
  1195. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ReadOnlyTest.java +222 -0
  1196. package/vendor/rocksdb/java/src/test/java/org/rocksdb/ReadOptionsTest.java +374 -0
  1197. package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksDBExceptionTest.java +115 -0
  1198. package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksDBTest.java +1692 -0
  1199. package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksIteratorTest.java +289 -0
  1200. package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksMemEnvTest.java +137 -0
  1201. package/vendor/rocksdb/java/src/test/java/org/rocksdb/RocksNativeLibraryResource.java +18 -0
  1202. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SecondaryDBTest.java +135 -0
  1203. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SliceTest.java +80 -0
  1204. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SnapshotTest.java +169 -0
  1205. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileManagerTest.java +66 -0
  1206. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileReaderTest.java +222 -0
  1207. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstFileWriterTest.java +239 -0
  1208. package/vendor/rocksdb/java/src/test/java/org/rocksdb/SstPartitionerTest.java +72 -0
  1209. package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatisticsCollectorTest.java +55 -0
  1210. package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatisticsTest.java +168 -0
  1211. package/vendor/rocksdb/java/src/test/java/org/rocksdb/StatsCallbackMock.java +19 -0
  1212. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TableFilterTest.java +106 -0
  1213. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TimedEnvTest.java +40 -0
  1214. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionDBOptionsTest.java +64 -0
  1215. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionDBTest.java +177 -0
  1216. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionLogIteratorTest.java +139 -0
  1217. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionOptionsTest.java +72 -0
  1218. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TransactionTest.java +488 -0
  1219. package/vendor/rocksdb/java/src/test/java/org/rocksdb/TtlDBTest.java +112 -0
  1220. package/vendor/rocksdb/java/src/test/java/org/rocksdb/Types.java +43 -0
  1221. package/vendor/rocksdb/java/src/test/java/org/rocksdb/VerifyChecksumsTest.java +213 -0
  1222. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WALRecoveryModeTest.java +22 -0
  1223. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WalFilterTest.java +165 -0
  1224. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchHandlerTest.java +76 -0
  1225. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchTest.java +528 -0
  1226. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchThreadedTest.java +101 -0
  1227. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteBatchWithIndexTest.java +1068 -0
  1228. package/vendor/rocksdb/java/src/test/java/org/rocksdb/WriteOptionsTest.java +75 -0
  1229. package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/RemoveEmptyValueCompactionFilterFactory.java +21 -0
  1230. package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/RocksJunitRunner.java +174 -0
  1231. package/vendor/rocksdb/java/src/test/java/org/rocksdb/test/TestableEventListener.java +23 -0
  1232. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/ByteBufferAllocator.java +16 -0
  1233. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/BytewiseComparatorIntTest.java +267 -0
  1234. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/BytewiseComparatorTest.java +531 -0
  1235. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/CapturingWriteBatchHandler.java +190 -0
  1236. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/DirectByteBufferAllocator.java +18 -0
  1237. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/EnvironmentTest.java +304 -0
  1238. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/HeapByteBufferAllocator.java +18 -0
  1239. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/IntComparatorTest.java +266 -0
  1240. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/JNIComparatorTest.java +180 -0
  1241. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/ReverseBytewiseComparatorIntTest.java +270 -0
  1242. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/SizeUnitTest.java +27 -0
  1243. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/TestUtil.java +72 -0
  1244. package/vendor/rocksdb/java/src/test/java/org/rocksdb/util/WriteBatchGetter.java +139 -0
  1245. package/vendor/rocksdb/java/understanding_options.md +79 -0
  1246. package/vendor/rocksdb/logging/auto_roll_logger.cc +368 -0
  1247. package/vendor/rocksdb/logging/auto_roll_logger.h +166 -0
  1248. package/vendor/rocksdb/logging/auto_roll_logger_test.cc +731 -0
  1249. package/vendor/rocksdb/logging/env_logger.h +195 -0
  1250. package/vendor/rocksdb/logging/env_logger_test.cc +163 -0
  1251. package/vendor/rocksdb/logging/event_logger.cc +68 -0
  1252. package/vendor/rocksdb/logging/event_logger.h +202 -0
  1253. package/vendor/rocksdb/logging/event_logger_test.cc +45 -0
  1254. package/vendor/rocksdb/logging/log_buffer.cc +91 -0
  1255. package/vendor/rocksdb/logging/log_buffer.h +57 -0
  1256. package/vendor/rocksdb/logging/logging.h +62 -0
  1257. package/vendor/rocksdb/memory/allocator.h +58 -0
  1258. package/vendor/rocksdb/memory/arena.cc +170 -0
  1259. package/vendor/rocksdb/memory/arena.h +135 -0
  1260. package/vendor/rocksdb/memory/arena_test.cc +295 -0
  1261. package/vendor/rocksdb/memory/concurrent_arena.cc +45 -0
  1262. package/vendor/rocksdb/memory/concurrent_arena.h +215 -0
  1263. package/vendor/rocksdb/memory/jemalloc_nodump_allocator.cc +303 -0
  1264. package/vendor/rocksdb/memory/jemalloc_nodump_allocator.h +99 -0
  1265. package/vendor/rocksdb/memory/memkind_kmem_allocator.cc +44 -0
  1266. package/vendor/rocksdb/memory/memkind_kmem_allocator.h +43 -0
  1267. package/vendor/rocksdb/memory/memory_allocator.cc +80 -0
  1268. package/vendor/rocksdb/memory/memory_allocator_impl.h +47 -0
  1269. package/vendor/rocksdb/memory/memory_allocator_test.cc +236 -0
  1270. package/vendor/rocksdb/memory/memory_usage.h +38 -0
  1271. package/vendor/rocksdb/memtable/alloc_tracker.cc +63 -0
  1272. package/vendor/rocksdb/memtable/hash_linklist_rep.cc +924 -0
  1273. package/vendor/rocksdb/memtable/hash_skiplist_rep.cc +391 -0
  1274. package/vendor/rocksdb/memtable/inlineskiplist.h +1051 -0
  1275. package/vendor/rocksdb/memtable/inlineskiplist_test.cc +665 -0
  1276. package/vendor/rocksdb/memtable/memtablerep_bench.cc +687 -0
  1277. package/vendor/rocksdb/memtable/skiplist.h +498 -0
  1278. package/vendor/rocksdb/memtable/skiplist_test.cc +388 -0
  1279. package/vendor/rocksdb/memtable/skiplistrep.cc +368 -0
  1280. package/vendor/rocksdb/memtable/stl_wrappers.h +33 -0
  1281. package/vendor/rocksdb/memtable/vectorrep.cc +307 -0
  1282. package/vendor/rocksdb/memtable/write_buffer_manager.cc +185 -0
  1283. package/vendor/rocksdb/memtable/write_buffer_manager_test.cc +304 -0
  1284. package/vendor/rocksdb/microbench/CMakeLists.txt +17 -0
  1285. package/vendor/rocksdb/microbench/README.md +60 -0
  1286. package/vendor/rocksdb/microbench/db_basic_bench.cc +1583 -0
  1287. package/vendor/rocksdb/microbench/ribbon_bench.cc +155 -0
  1288. package/vendor/rocksdb/monitoring/file_read_sample.h +23 -0
  1289. package/vendor/rocksdb/monitoring/histogram.cc +270 -0
  1290. package/vendor/rocksdb/monitoring/histogram.h +143 -0
  1291. package/vendor/rocksdb/monitoring/histogram_test.cc +254 -0
  1292. package/vendor/rocksdb/monitoring/histogram_windowing.cc +194 -0
  1293. package/vendor/rocksdb/monitoring/histogram_windowing.h +84 -0
  1294. package/vendor/rocksdb/monitoring/in_memory_stats_history.cc +50 -0
  1295. package/vendor/rocksdb/monitoring/in_memory_stats_history.h +74 -0
  1296. package/vendor/rocksdb/monitoring/instrumented_mutex.cc +90 -0
  1297. package/vendor/rocksdb/monitoring/instrumented_mutex.h +126 -0
  1298. package/vendor/rocksdb/monitoring/iostats_context.cc +78 -0
  1299. package/vendor/rocksdb/monitoring/iostats_context_imp.h +62 -0
  1300. package/vendor/rocksdb/monitoring/iostats_context_test.cc +31 -0
  1301. package/vendor/rocksdb/monitoring/perf_context.cc +313 -0
  1302. package/vendor/rocksdb/monitoring/perf_context_imp.h +96 -0
  1303. package/vendor/rocksdb/monitoring/perf_level.cc +23 -0
  1304. package/vendor/rocksdb/monitoring/perf_level_imp.h +14 -0
  1305. package/vendor/rocksdb/monitoring/perf_step_timer.h +77 -0
  1306. package/vendor/rocksdb/monitoring/persistent_stats_history.cc +170 -0
  1307. package/vendor/rocksdb/monitoring/persistent_stats_history.h +83 -0
  1308. package/vendor/rocksdb/monitoring/statistics.cc +534 -0
  1309. package/vendor/rocksdb/monitoring/statistics_impl.h +144 -0
  1310. package/vendor/rocksdb/monitoring/statistics_test.cc +88 -0
  1311. package/vendor/rocksdb/monitoring/stats_history_test.cc +662 -0
  1312. package/vendor/rocksdb/monitoring/thread_status_impl.cc +163 -0
  1313. package/vendor/rocksdb/monitoring/thread_status_updater.cc +328 -0
  1314. package/vendor/rocksdb/monitoring/thread_status_updater.h +226 -0
  1315. package/vendor/rocksdb/monitoring/thread_status_updater_debug.cc +43 -0
  1316. package/vendor/rocksdb/monitoring/thread_status_util.cc +208 -0
  1317. package/vendor/rocksdb/monitoring/thread_status_util.h +139 -0
  1318. package/vendor/rocksdb/monitoring/thread_status_util_debug.cc +46 -0
  1319. package/vendor/rocksdb/options/cf_options.cc +1196 -0
  1320. package/vendor/rocksdb/options/cf_options.h +347 -0
  1321. package/vendor/rocksdb/options/configurable.cc +712 -0
  1322. package/vendor/rocksdb/options/configurable_helper.h +185 -0
  1323. package/vendor/rocksdb/options/configurable_test.cc +861 -0
  1324. package/vendor/rocksdb/options/configurable_test.h +116 -0
  1325. package/vendor/rocksdb/options/customizable.cc +133 -0
  1326. package/vendor/rocksdb/options/customizable_test.cc +2116 -0
  1327. package/vendor/rocksdb/options/db_options.cc +1079 -0
  1328. package/vendor/rocksdb/options/db_options.h +152 -0
  1329. package/vendor/rocksdb/options/options.cc +692 -0
  1330. package/vendor/rocksdb/options/options_helper.cc +1424 -0
  1331. package/vendor/rocksdb/options/options_helper.h +116 -0
  1332. package/vendor/rocksdb/options/options_parser.cc +736 -0
  1333. package/vendor/rocksdb/options/options_parser.h +149 -0
  1334. package/vendor/rocksdb/options/options_settable_test.cc +655 -0
  1335. package/vendor/rocksdb/options/options_test.cc +5060 -0
  1336. package/vendor/rocksdb/plugin/README.md +43 -0
  1337. package/vendor/rocksdb/port/README +10 -0
  1338. package/vendor/rocksdb/port/jemalloc_helper.h +107 -0
  1339. package/vendor/rocksdb/port/lang.h +97 -0
  1340. package/vendor/rocksdb/port/likely.h +18 -0
  1341. package/vendor/rocksdb/port/malloc.h +17 -0
  1342. package/vendor/rocksdb/port/mmap.cc +98 -0
  1343. package/vendor/rocksdb/port/mmap.h +70 -0
  1344. package/vendor/rocksdb/port/port.h +21 -0
  1345. package/vendor/rocksdb/port/port_dirent.h +44 -0
  1346. package/vendor/rocksdb/port/port_example.h +101 -0
  1347. package/vendor/rocksdb/port/port_posix.cc +300 -0
  1348. package/vendor/rocksdb/port/port_posix.h +243 -0
  1349. package/vendor/rocksdb/port/stack_trace.cc +336 -0
  1350. package/vendor/rocksdb/port/stack_trace.h +31 -0
  1351. package/vendor/rocksdb/port/sys_time.h +63 -0
  1352. package/vendor/rocksdb/port/util_logger.h +18 -0
  1353. package/vendor/rocksdb/port/win/env_default.cc +45 -0
  1354. package/vendor/rocksdb/port/win/env_win.cc +1437 -0
  1355. package/vendor/rocksdb/port/win/env_win.h +305 -0
  1356. package/vendor/rocksdb/port/win/io_win.cc +1101 -0
  1357. package/vendor/rocksdb/port/win/io_win.h +508 -0
  1358. package/vendor/rocksdb/port/win/port_win.cc +303 -0
  1359. package/vendor/rocksdb/port/win/port_win.h +379 -0
  1360. package/vendor/rocksdb/port/win/win_jemalloc.cc +80 -0
  1361. package/vendor/rocksdb/port/win/win_logger.cc +192 -0
  1362. package/vendor/rocksdb/port/win/win_logger.h +64 -0
  1363. package/vendor/rocksdb/port/win/win_thread.cc +170 -0
  1364. package/vendor/rocksdb/port/win/win_thread.h +117 -0
  1365. package/vendor/rocksdb/port/win/xpress_win.cc +210 -0
  1366. package/vendor/rocksdb/port/win/xpress_win.h +26 -0
  1367. package/vendor/rocksdb/port/xpress.h +17 -0
  1368. package/vendor/rocksdb/rocksdb.pc.in +10 -0
  1369. package/vendor/rocksdb/src.mk +713 -0
  1370. package/vendor/rocksdb/table/adaptive/adaptive_table_factory.cc +125 -0
  1371. package/vendor/rocksdb/table/adaptive/adaptive_table_factory.h +56 -0
  1372. package/vendor/rocksdb/table/block_based/binary_search_index_reader.cc +73 -0
  1373. package/vendor/rocksdb/table/block_based/binary_search_index_reader.h +48 -0
  1374. package/vendor/rocksdb/table/block_based/block.cc +1291 -0
  1375. package/vendor/rocksdb/table/block_based/block.h +921 -0
  1376. package/vendor/rocksdb/table/block_based/block_based_table_builder.cc +2027 -0
  1377. package/vendor/rocksdb/table/block_based/block_based_table_builder.h +209 -0
  1378. package/vendor/rocksdb/table/block_based/block_based_table_factory.cc +962 -0
  1379. package/vendor/rocksdb/table/block_based/block_based_table_factory.h +102 -0
  1380. package/vendor/rocksdb/table/block_based/block_based_table_iterator.cc +500 -0
  1381. package/vendor/rocksdb/table/block_based/block_based_table_iterator.h +310 -0
  1382. package/vendor/rocksdb/table/block_based/block_based_table_reader.cc +3043 -0
  1383. package/vendor/rocksdb/table/block_based/block_based_table_reader.h +745 -0
  1384. package/vendor/rocksdb/table/block_based/block_based_table_reader_impl.h +203 -0
  1385. package/vendor/rocksdb/table/block_based/block_based_table_reader_sync_and_async.h +758 -0
  1386. package/vendor/rocksdb/table/block_based/block_based_table_reader_test.cc +567 -0
  1387. package/vendor/rocksdb/table/block_based/block_builder.cc +234 -0
  1388. package/vendor/rocksdb/table/block_based/block_builder.h +104 -0
  1389. package/vendor/rocksdb/table/block_based/block_cache.cc +106 -0
  1390. package/vendor/rocksdb/table/block_based/block_cache.h +140 -0
  1391. package/vendor/rocksdb/table/block_based/block_prefetcher.cc +120 -0
  1392. package/vendor/rocksdb/table/block_based/block_prefetcher.h +72 -0
  1393. package/vendor/rocksdb/table/block_based/block_prefix_index.cc +226 -0
  1394. package/vendor/rocksdb/table/block_based/block_prefix_index.h +70 -0
  1395. package/vendor/rocksdb/table/block_based/block_test.cc +1543 -0
  1396. package/vendor/rocksdb/table/block_based/block_type.h +34 -0
  1397. package/vendor/rocksdb/table/block_based/cachable_entry.h +244 -0
  1398. package/vendor/rocksdb/table/block_based/data_block_footer.cc +59 -0
  1399. package/vendor/rocksdb/table/block_based/data_block_footer.h +25 -0
  1400. package/vendor/rocksdb/table/block_based/data_block_hash_index.cc +94 -0
  1401. package/vendor/rocksdb/table/block_based/data_block_hash_index.h +137 -0
  1402. package/vendor/rocksdb/table/block_based/data_block_hash_index_test.cc +718 -0
  1403. package/vendor/rocksdb/table/block_based/filter_block.h +183 -0
  1404. package/vendor/rocksdb/table/block_based/filter_block_reader_common.cc +163 -0
  1405. package/vendor/rocksdb/table/block_based/filter_block_reader_common.h +76 -0
  1406. package/vendor/rocksdb/table/block_based/filter_policy.cc +1966 -0
  1407. package/vendor/rocksdb/table/block_based/filter_policy_internal.h +340 -0
  1408. package/vendor/rocksdb/table/block_based/flush_block_policy.cc +132 -0
  1409. package/vendor/rocksdb/table/block_based/flush_block_policy_impl.h +40 -0
  1410. package/vendor/rocksdb/table/block_based/full_filter_block.cc +290 -0
  1411. package/vendor/rocksdb/table/block_based/full_filter_block.h +147 -0
  1412. package/vendor/rocksdb/table/block_based/full_filter_block_test.cc +323 -0
  1413. package/vendor/rocksdb/table/block_based/hash_index_reader.cc +147 -0
  1414. package/vendor/rocksdb/table/block_based/hash_index_reader.h +49 -0
  1415. package/vendor/rocksdb/table/block_based/index_builder.cc +282 -0
  1416. package/vendor/rocksdb/table/block_based/index_builder.h +455 -0
  1417. package/vendor/rocksdb/table/block_based/index_reader_common.cc +57 -0
  1418. package/vendor/rocksdb/table/block_based/index_reader_common.h +85 -0
  1419. package/vendor/rocksdb/table/block_based/mock_block_based_table.h +62 -0
  1420. package/vendor/rocksdb/table/block_based/parsed_full_filter_block.cc +23 -0
  1421. package/vendor/rocksdb/table/block_based/parsed_full_filter_block.h +47 -0
  1422. package/vendor/rocksdb/table/block_based/partitioned_filter_block.cc +554 -0
  1423. package/vendor/rocksdb/table/block_based/partitioned_filter_block.h +182 -0
  1424. package/vendor/rocksdb/table/block_based/partitioned_filter_block_test.cc +436 -0
  1425. package/vendor/rocksdb/table/block_based/partitioned_index_iterator.cc +163 -0
  1426. package/vendor/rocksdb/table/block_based/partitioned_index_iterator.h +160 -0
  1427. package/vendor/rocksdb/table/block_based/partitioned_index_reader.cc +224 -0
  1428. package/vendor/rocksdb/table/block_based/partitioned_index_reader.h +56 -0
  1429. package/vendor/rocksdb/table/block_based/reader_common.cc +52 -0
  1430. package/vendor/rocksdb/table/block_based/reader_common.h +34 -0
  1431. package/vendor/rocksdb/table/block_based/uncompression_dict_reader.cc +126 -0
  1432. package/vendor/rocksdb/table/block_based/uncompression_dict_reader.h +61 -0
  1433. package/vendor/rocksdb/table/block_fetcher.cc +405 -0
  1434. package/vendor/rocksdb/table/block_fetcher.h +142 -0
  1435. package/vendor/rocksdb/table/block_fetcher_test.cc +520 -0
  1436. package/vendor/rocksdb/table/cleanable_test.cc +390 -0
  1437. package/vendor/rocksdb/table/compaction_merging_iterator.cc +370 -0
  1438. package/vendor/rocksdb/table/compaction_merging_iterator.h +44 -0
  1439. package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.cc +551 -0
  1440. package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder.h +136 -0
  1441. package/vendor/rocksdb/table/cuckoo/cuckoo_table_builder_test.cc +631 -0
  1442. package/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.cc +100 -0
  1443. package/vendor/rocksdb/table/cuckoo/cuckoo_table_factory.h +80 -0
  1444. package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.cc +412 -0
  1445. package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader.h +100 -0
  1446. package/vendor/rocksdb/table/cuckoo/cuckoo_table_reader_test.cc +574 -0
  1447. package/vendor/rocksdb/table/format.cc +573 -0
  1448. package/vendor/rocksdb/table/format.h +378 -0
  1449. package/vendor/rocksdb/table/get_context.cc +616 -0
  1450. package/vendor/rocksdb/table/get_context.h +245 -0
  1451. package/vendor/rocksdb/table/internal_iterator.h +224 -0
  1452. package/vendor/rocksdb/table/iter_heap.h +44 -0
  1453. package/vendor/rocksdb/table/iterator.cc +130 -0
  1454. package/vendor/rocksdb/table/iterator_wrapper.h +190 -0
  1455. package/vendor/rocksdb/table/merger_test.cc +182 -0
  1456. package/vendor/rocksdb/table/merging_iterator.cc +1725 -0
  1457. package/vendor/rocksdb/table/merging_iterator.h +97 -0
  1458. package/vendor/rocksdb/table/meta_blocks.cc +564 -0
  1459. package/vendor/rocksdb/table/meta_blocks.h +172 -0
  1460. package/vendor/rocksdb/table/mock_table.cc +346 -0
  1461. package/vendor/rocksdb/table/mock_table.h +94 -0
  1462. package/vendor/rocksdb/table/multiget_context.h +405 -0
  1463. package/vendor/rocksdb/table/persistent_cache_helper.cc +111 -0
  1464. package/vendor/rocksdb/table/persistent_cache_helper.h +46 -0
  1465. package/vendor/rocksdb/table/persistent_cache_options.h +34 -0
  1466. package/vendor/rocksdb/table/plain/plain_table_bloom.cc +78 -0
  1467. package/vendor/rocksdb/table/plain/plain_table_bloom.h +132 -0
  1468. package/vendor/rocksdb/table/plain/plain_table_builder.cc +335 -0
  1469. package/vendor/rocksdb/table/plain/plain_table_builder.h +152 -0
  1470. package/vendor/rocksdb/table/plain/plain_table_factory.cc +296 -0
  1471. package/vendor/rocksdb/table/plain/plain_table_factory.h +180 -0
  1472. package/vendor/rocksdb/table/plain/plain_table_index.cc +211 -0
  1473. package/vendor/rocksdb/table/plain/plain_table_index.h +246 -0
  1474. package/vendor/rocksdb/table/plain/plain_table_key_coding.cc +507 -0
  1475. package/vendor/rocksdb/table/plain/plain_table_key_coding.h +199 -0
  1476. package/vendor/rocksdb/table/plain/plain_table_reader.cc +771 -0
  1477. package/vendor/rocksdb/table/plain/plain_table_reader.h +243 -0
  1478. package/vendor/rocksdb/table/scoped_arena_iterator.h +57 -0
  1479. package/vendor/rocksdb/table/sst_file_dumper.cc +520 -0
  1480. package/vendor/rocksdb/table/sst_file_dumper.h +99 -0
  1481. package/vendor/rocksdb/table/sst_file_reader.cc +101 -0
  1482. package/vendor/rocksdb/table/sst_file_reader_test.cc +423 -0
  1483. package/vendor/rocksdb/table/sst_file_writer.cc +436 -0
  1484. package/vendor/rocksdb/table/sst_file_writer_collectors.h +95 -0
  1485. package/vendor/rocksdb/table/table_builder.h +228 -0
  1486. package/vendor/rocksdb/table/table_factory.cc +52 -0
  1487. package/vendor/rocksdb/table/table_properties.cc +351 -0
  1488. package/vendor/rocksdb/table/table_properties_internal.h +14 -0
  1489. package/vendor/rocksdb/table/table_reader.h +187 -0
  1490. package/vendor/rocksdb/table/table_reader_bench.cc +339 -0
  1491. package/vendor/rocksdb/table/table_test.cc +5882 -0
  1492. package/vendor/rocksdb/table/two_level_iterator.cc +220 -0
  1493. package/vendor/rocksdb/table/two_level_iterator.h +43 -0
  1494. package/vendor/rocksdb/table/unique_id.cc +223 -0
  1495. package/vendor/rocksdb/table/unique_id_impl.h +93 -0
  1496. package/vendor/rocksdb/test_util/mock_time_env.cc +38 -0
  1497. package/vendor/rocksdb/test_util/mock_time_env.h +78 -0
  1498. package/vendor/rocksdb/test_util/secondary_cache_test_util.cc +96 -0
  1499. package/vendor/rocksdb/test_util/secondary_cache_test_util.h +119 -0
  1500. package/vendor/rocksdb/test_util/sync_point.cc +82 -0
  1501. package/vendor/rocksdb/test_util/sync_point.h +180 -0
  1502. package/vendor/rocksdb/test_util/sync_point_impl.cc +152 -0
  1503. package/vendor/rocksdb/test_util/sync_point_impl.h +96 -0
  1504. package/vendor/rocksdb/test_util/testharness.cc +107 -0
  1505. package/vendor/rocksdb/test_util/testharness.h +124 -0
  1506. package/vendor/rocksdb/test_util/testutil.cc +722 -0
  1507. package/vendor/rocksdb/test_util/testutil.h +860 -0
  1508. package/vendor/rocksdb/test_util/testutil_test.cc +43 -0
  1509. package/vendor/rocksdb/test_util/transaction_test_util.cc +400 -0
  1510. package/vendor/rocksdb/test_util/transaction_test_util.h +147 -0
  1511. package/vendor/rocksdb/third-party/gcc/ppc-asm.h +390 -0
  1512. package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt +4 -0
  1513. package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest-all.cc +11394 -0
  1514. package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest.h +22115 -0
  1515. package/vendor/rocksdb/third-party/gtest-1.8.1/fused-src/gtest/gtest_main.cc +37 -0
  1516. package/vendor/rocksdb/thirdparty.inc +268 -0
  1517. package/vendor/rocksdb/tools/CMakeLists.txt +30 -0
  1518. package/vendor/rocksdb/tools/Dockerfile +5 -0
  1519. package/vendor/rocksdb/tools/advisor/README.md +96 -0
  1520. package/vendor/rocksdb/tools/advisor/advisor/__init__.py +0 -0
  1521. package/vendor/rocksdb/tools/advisor/advisor/bench_runner.py +39 -0
  1522. package/vendor/rocksdb/tools/advisor/advisor/config_optimizer_example.py +140 -0
  1523. package/vendor/rocksdb/tools/advisor/advisor/db_bench_runner.py +237 -0
  1524. package/vendor/rocksdb/tools/advisor/advisor/db_config_optimizer.py +293 -0
  1525. package/vendor/rocksdb/tools/advisor/advisor/db_log_parser.py +134 -0
  1526. package/vendor/rocksdb/tools/advisor/advisor/db_options_parser.py +348 -0
  1527. package/vendor/rocksdb/tools/advisor/advisor/db_stats_fetcher.py +346 -0
  1528. package/vendor/rocksdb/tools/advisor/advisor/db_timeseries_parser.py +203 -0
  1529. package/vendor/rocksdb/tools/advisor/advisor/ini_parser.py +76 -0
  1530. package/vendor/rocksdb/tools/advisor/advisor/rule_parser.py +510 -0
  1531. package/vendor/rocksdb/tools/advisor/advisor/rule_parser_example.py +98 -0
  1532. package/vendor/rocksdb/tools/advisor/advisor/rules.ini +214 -0
  1533. package/vendor/rocksdb/tools/advisor/test/__init__.py +0 -0
  1534. package/vendor/rocksdb/tools/advisor/test/input_files/LOG-0 +30 -0
  1535. package/vendor/rocksdb/tools/advisor/test/input_files/LOG-1 +25 -0
  1536. package/vendor/rocksdb/tools/advisor/test/input_files/OPTIONS-000005 +49 -0
  1537. package/vendor/rocksdb/tools/advisor/test/input_files/log_stats_parser_keys_ts +3 -0
  1538. package/vendor/rocksdb/tools/advisor/test/input_files/rules_err1.ini +56 -0
  1539. package/vendor/rocksdb/tools/advisor/test/input_files/rules_err2.ini +15 -0
  1540. package/vendor/rocksdb/tools/advisor/test/input_files/rules_err3.ini +15 -0
  1541. package/vendor/rocksdb/tools/advisor/test/input_files/rules_err4.ini +15 -0
  1542. package/vendor/rocksdb/tools/advisor/test/input_files/test_rules.ini +47 -0
  1543. package/vendor/rocksdb/tools/advisor/test/input_files/triggered_rules.ini +83 -0
  1544. package/vendor/rocksdb/tools/advisor/test/test_db_bench_runner.py +141 -0
  1545. package/vendor/rocksdb/tools/advisor/test/test_db_log_parser.py +96 -0
  1546. package/vendor/rocksdb/tools/advisor/test/test_db_options_parser.py +214 -0
  1547. package/vendor/rocksdb/tools/advisor/test/test_db_stats_fetcher.py +121 -0
  1548. package/vendor/rocksdb/tools/advisor/test/test_rule_parser.py +226 -0
  1549. package/vendor/rocksdb/tools/analyze_txn_stress_test.sh +77 -0
  1550. package/vendor/rocksdb/tools/auto_sanity_test.sh +93 -0
  1551. package/vendor/rocksdb/tools/backup_db.sh +15 -0
  1552. package/vendor/rocksdb/tools/benchmark.sh +1173 -0
  1553. package/vendor/rocksdb/tools/benchmark_ci.py +182 -0
  1554. package/vendor/rocksdb/tools/benchmark_compare.sh +342 -0
  1555. package/vendor/rocksdb/tools/benchmark_leveldb.sh +187 -0
  1556. package/vendor/rocksdb/tools/blob_dump.cc +103 -0
  1557. package/vendor/rocksdb/tools/block_cache_analyzer/__init__.py +2 -0
  1558. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim.py +2000 -0
  1559. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim.sh +156 -0
  1560. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_pysim_test.py +734 -0
  1561. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.cc +2314 -0
  1562. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer.h +397 -0
  1563. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_plot.py +729 -0
  1564. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_test.cc +791 -0
  1565. package/vendor/rocksdb/tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc +17 -0
  1566. package/vendor/rocksdb/tools/check_all_python.py +22 -0
  1567. package/vendor/rocksdb/tools/check_format_compatible.sh +379 -0
  1568. package/vendor/rocksdb/tools/db_bench.cc +21 -0
  1569. package/vendor/rocksdb/tools/db_bench_tool.cc +8604 -0
  1570. package/vendor/rocksdb/tools/db_bench_tool_test.cc +342 -0
  1571. package/vendor/rocksdb/tools/db_crashtest.py +1018 -0
  1572. package/vendor/rocksdb/tools/db_repl_stress.cc +132 -0
  1573. package/vendor/rocksdb/tools/db_sanity_test.cc +296 -0
  1574. package/vendor/rocksdb/tools/dbench_monitor +102 -0
  1575. package/vendor/rocksdb/tools/dump/db_dump_tool.cc +258 -0
  1576. package/vendor/rocksdb/tools/dump/rocksdb_dump.cc +60 -0
  1577. package/vendor/rocksdb/tools/dump/rocksdb_undump.cc +59 -0
  1578. package/vendor/rocksdb/tools/generate_random_db.sh +31 -0
  1579. package/vendor/rocksdb/tools/ingest_external_sst.sh +18 -0
  1580. package/vendor/rocksdb/tools/io_tracer_parser.cc +17 -0
  1581. package/vendor/rocksdb/tools/io_tracer_parser_test.cc +182 -0
  1582. package/vendor/rocksdb/tools/io_tracer_parser_tool.cc +142 -0
  1583. package/vendor/rocksdb/tools/io_tracer_parser_tool.h +38 -0
  1584. package/vendor/rocksdb/tools/ldb.cc +13 -0
  1585. package/vendor/rocksdb/tools/ldb_cmd.cc +4263 -0
  1586. package/vendor/rocksdb/tools/ldb_cmd_impl.h +744 -0
  1587. package/vendor/rocksdb/tools/ldb_cmd_test.cc +1216 -0
  1588. package/vendor/rocksdb/tools/ldb_test.py +955 -0
  1589. package/vendor/rocksdb/tools/ldb_tool.cc +182 -0
  1590. package/vendor/rocksdb/tools/pflag +217 -0
  1591. package/vendor/rocksdb/tools/reduce_levels_test.cc +212 -0
  1592. package/vendor/rocksdb/tools/regression_test.sh +525 -0
  1593. package/vendor/rocksdb/tools/restore_db.sh +15 -0
  1594. package/vendor/rocksdb/tools/rocksdb_dump_test.sh +9 -0
  1595. package/vendor/rocksdb/tools/run_blob_bench.sh +223 -0
  1596. package/vendor/rocksdb/tools/run_flash_bench.sh +359 -0
  1597. package/vendor/rocksdb/tools/run_leveldb.sh +175 -0
  1598. package/vendor/rocksdb/tools/sample-dump.dmp +0 -0
  1599. package/vendor/rocksdb/tools/simulated_hybrid_file_system.cc +243 -0
  1600. package/vendor/rocksdb/tools/simulated_hybrid_file_system.h +124 -0
  1601. package/vendor/rocksdb/tools/sst_dump.cc +12 -0
  1602. package/vendor/rocksdb/tools/sst_dump_test.cc +471 -0
  1603. package/vendor/rocksdb/tools/sst_dump_tool.cc +582 -0
  1604. package/vendor/rocksdb/tools/trace_analyzer.cc +17 -0
  1605. package/vendor/rocksdb/tools/trace_analyzer_test.cc +880 -0
  1606. package/vendor/rocksdb/tools/trace_analyzer_tool.cc +1929 -0
  1607. package/vendor/rocksdb/tools/trace_analyzer_tool.h +329 -0
  1608. package/vendor/rocksdb/tools/verify_random_db.sh +41 -0
  1609. package/vendor/rocksdb/tools/write_external_sst.sh +26 -0
  1610. package/vendor/rocksdb/tools/write_stress.cc +305 -0
  1611. package/vendor/rocksdb/tools/write_stress_runner.py +83 -0
  1612. package/vendor/rocksdb/trace_replay/block_cache_tracer.cc +509 -0
  1613. package/vendor/rocksdb/trace_replay/block_cache_tracer.h +239 -0
  1614. package/vendor/rocksdb/trace_replay/block_cache_tracer_test.cc +421 -0
  1615. package/vendor/rocksdb/trace_replay/io_tracer.cc +303 -0
  1616. package/vendor/rocksdb/trace_replay/io_tracer.h +185 -0
  1617. package/vendor/rocksdb/trace_replay/io_tracer_test.cc +353 -0
  1618. package/vendor/rocksdb/trace_replay/trace_record.cc +206 -0
  1619. package/vendor/rocksdb/trace_replay/trace_record_handler.cc +190 -0
  1620. package/vendor/rocksdb/trace_replay/trace_record_handler.h +46 -0
  1621. package/vendor/rocksdb/trace_replay/trace_record_result.cc +146 -0
  1622. package/vendor/rocksdb/trace_replay/trace_replay.cc +622 -0
  1623. package/vendor/rocksdb/trace_replay/trace_replay.h +183 -0
  1624. package/vendor/rocksdb/util/aligned_buffer.h +235 -0
  1625. package/vendor/rocksdb/util/async_file_reader.cc +81 -0
  1626. package/vendor/rocksdb/util/async_file_reader.h +144 -0
  1627. package/vendor/rocksdb/util/autovector.h +393 -0
  1628. package/vendor/rocksdb/util/autovector_test.cc +324 -0
  1629. package/vendor/rocksdb/util/bloom_impl.h +489 -0
  1630. package/vendor/rocksdb/util/bloom_test.cc +1175 -0
  1631. package/vendor/rocksdb/util/build_version.cc.in +79 -0
  1632. package/vendor/rocksdb/util/cast_util.h +42 -0
  1633. package/vendor/rocksdb/util/channel.h +69 -0
  1634. package/vendor/rocksdb/util/cleanable.cc +181 -0
  1635. package/vendor/rocksdb/util/coding.cc +90 -0
  1636. package/vendor/rocksdb/util/coding.h +389 -0
  1637. package/vendor/rocksdb/util/coding_lean.h +101 -0
  1638. package/vendor/rocksdb/util/coding_test.cc +217 -0
  1639. package/vendor/rocksdb/util/compaction_job_stats_impl.cc +92 -0
  1640. package/vendor/rocksdb/util/comparator.cc +383 -0
  1641. package/vendor/rocksdb/util/compression.cc +122 -0
  1642. package/vendor/rocksdb/util/compression.h +1795 -0
  1643. package/vendor/rocksdb/util/compression_context_cache.cc +106 -0
  1644. package/vendor/rocksdb/util/compression_context_cache.h +47 -0
  1645. package/vendor/rocksdb/util/concurrent_task_limiter_impl.cc +64 -0
  1646. package/vendor/rocksdb/util/concurrent_task_limiter_impl.h +67 -0
  1647. package/vendor/rocksdb/util/core_local.h +84 -0
  1648. package/vendor/rocksdb/util/coro_utils.h +112 -0
  1649. package/vendor/rocksdb/util/crc32c.cc +1292 -0
  1650. package/vendor/rocksdb/util/crc32c.h +56 -0
  1651. package/vendor/rocksdb/util/crc32c_arm64.cc +213 -0
  1652. package/vendor/rocksdb/util/crc32c_arm64.h +52 -0
  1653. package/vendor/rocksdb/util/crc32c_ppc.c +94 -0
  1654. package/vendor/rocksdb/util/crc32c_ppc.h +22 -0
  1655. package/vendor/rocksdb/util/crc32c_ppc_asm.S +756 -0
  1656. package/vendor/rocksdb/util/crc32c_ppc_constants.h +900 -0
  1657. package/vendor/rocksdb/util/crc32c_test.cc +213 -0
  1658. package/vendor/rocksdb/util/data_structure.cc +18 -0
  1659. package/vendor/rocksdb/util/defer.h +82 -0
  1660. package/vendor/rocksdb/util/defer_test.cc +51 -0
  1661. package/vendor/rocksdb/util/distributed_mutex.h +50 -0
  1662. package/vendor/rocksdb/util/duplicate_detector.h +69 -0
  1663. package/vendor/rocksdb/util/dynamic_bloom.cc +70 -0
  1664. package/vendor/rocksdb/util/dynamic_bloom.h +214 -0
  1665. package/vendor/rocksdb/util/dynamic_bloom_test.cc +325 -0
  1666. package/vendor/rocksdb/util/fastrange.h +114 -0
  1667. package/vendor/rocksdb/util/file_checksum_helper.cc +170 -0
  1668. package/vendor/rocksdb/util/file_checksum_helper.h +101 -0
  1669. package/vendor/rocksdb/util/file_reader_writer_test.cc +1058 -0
  1670. package/vendor/rocksdb/util/filelock_test.cc +148 -0
  1671. package/vendor/rocksdb/util/filter_bench.cc +840 -0
  1672. package/vendor/rocksdb/util/gflags_compat.h +29 -0
  1673. package/vendor/rocksdb/util/hash.cc +201 -0
  1674. package/vendor/rocksdb/util/hash.h +137 -0
  1675. package/vendor/rocksdb/util/hash128.h +26 -0
  1676. package/vendor/rocksdb/util/hash_containers.h +51 -0
  1677. package/vendor/rocksdb/util/hash_map.h +67 -0
  1678. package/vendor/rocksdb/util/hash_test.cc +853 -0
  1679. package/vendor/rocksdb/util/heap.h +174 -0
  1680. package/vendor/rocksdb/util/heap_test.cc +131 -0
  1681. package/vendor/rocksdb/util/kv_map.h +33 -0
  1682. package/vendor/rocksdb/util/log_write_bench.cc +88 -0
  1683. package/vendor/rocksdb/util/math.h +299 -0
  1684. package/vendor/rocksdb/util/math128.h +316 -0
  1685. package/vendor/rocksdb/util/murmurhash.cc +196 -0
  1686. package/vendor/rocksdb/util/murmurhash.h +43 -0
  1687. package/vendor/rocksdb/util/mutexlock.h +181 -0
  1688. package/vendor/rocksdb/util/ppc-opcode.h +27 -0
  1689. package/vendor/rocksdb/util/random.cc +63 -0
  1690. package/vendor/rocksdb/util/random.h +190 -0
  1691. package/vendor/rocksdb/util/random_test.cc +107 -0
  1692. package/vendor/rocksdb/util/rate_limiter.cc +376 -0
  1693. package/vendor/rocksdb/util/rate_limiter_impl.h +146 -0
  1694. package/vendor/rocksdb/util/rate_limiter_test.cc +520 -0
  1695. package/vendor/rocksdb/util/repeatable_thread.h +149 -0
  1696. package/vendor/rocksdb/util/repeatable_thread_test.cc +111 -0
  1697. package/vendor/rocksdb/util/ribbon_alg.h +1225 -0
  1698. package/vendor/rocksdb/util/ribbon_config.cc +506 -0
  1699. package/vendor/rocksdb/util/ribbon_config.h +182 -0
  1700. package/vendor/rocksdb/util/ribbon_impl.h +1137 -0
  1701. package/vendor/rocksdb/util/ribbon_test.cc +1308 -0
  1702. package/vendor/rocksdb/util/set_comparator.h +24 -0
  1703. package/vendor/rocksdb/util/single_thread_executor.h +56 -0
  1704. package/vendor/rocksdb/util/slice.cc +367 -0
  1705. package/vendor/rocksdb/util/slice_test.cc +252 -0
  1706. package/vendor/rocksdb/util/slice_transform_test.cc +159 -0
  1707. package/vendor/rocksdb/util/status.cc +162 -0
  1708. package/vendor/rocksdb/util/stderr_logger.cc +30 -0
  1709. package/vendor/rocksdb/util/stderr_logger.h +31 -0
  1710. package/vendor/rocksdb/util/stop_watch.h +136 -0
  1711. package/vendor/rocksdb/util/string_util.cc +502 -0
  1712. package/vendor/rocksdb/util/string_util.h +175 -0
  1713. package/vendor/rocksdb/util/thread_guard.h +41 -0
  1714. package/vendor/rocksdb/util/thread_list_test.cc +362 -0
  1715. package/vendor/rocksdb/util/thread_local.cc +521 -0
  1716. package/vendor/rocksdb/util/thread_local.h +100 -0
  1717. package/vendor/rocksdb/util/thread_local_test.cc +578 -0
  1718. package/vendor/rocksdb/util/thread_operation.h +113 -0
  1719. package/vendor/rocksdb/util/threadpool_imp.cc +551 -0
  1720. package/vendor/rocksdb/util/threadpool_imp.h +120 -0
  1721. package/vendor/rocksdb/util/timer.h +340 -0
  1722. package/vendor/rocksdb/util/timer_queue.h +231 -0
  1723. package/vendor/rocksdb/util/timer_queue_test.cc +73 -0
  1724. package/vendor/rocksdb/util/timer_test.cc +402 -0
  1725. package/vendor/rocksdb/util/udt_util.h +77 -0
  1726. package/vendor/rocksdb/util/user_comparator_wrapper.h +64 -0
  1727. package/vendor/rocksdb/util/vector_iterator.h +118 -0
  1728. package/vendor/rocksdb/util/work_queue.h +150 -0
  1729. package/vendor/rocksdb/util/work_queue_test.cc +272 -0
  1730. package/vendor/rocksdb/util/xxhash.cc +48 -0
  1731. package/vendor/rocksdb/util/xxhash.h +6360 -0
  1732. package/vendor/rocksdb/util/xxph3.h +1764 -0
  1733. package/vendor/rocksdb/utilities/agg_merge/agg_merge.cc +238 -0
  1734. package/vendor/rocksdb/utilities/agg_merge/agg_merge_impl.h +49 -0
  1735. package/vendor/rocksdb/utilities/agg_merge/agg_merge_test.cc +135 -0
  1736. package/vendor/rocksdb/utilities/agg_merge/test_agg_merge.cc +104 -0
  1737. package/vendor/rocksdb/utilities/agg_merge/test_agg_merge.h +47 -0
  1738. package/vendor/rocksdb/utilities/backup/backup_engine.cc +3355 -0
  1739. package/vendor/rocksdb/utilities/backup/backup_engine_impl.h +34 -0
  1740. package/vendor/rocksdb/utilities/backup/backup_engine_test.cc +4414 -0
  1741. package/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.cc +488 -0
  1742. package/vendor/rocksdb/utilities/blob_db/blob_compaction_filter.h +202 -0
  1743. package/vendor/rocksdb/utilities/blob_db/blob_db.cc +112 -0
  1744. package/vendor/rocksdb/utilities/blob_db/blob_db.h +264 -0
  1745. package/vendor/rocksdb/utilities/blob_db/blob_db_gc_stats.h +54 -0
  1746. package/vendor/rocksdb/utilities/blob_db/blob_db_impl.cc +2185 -0
  1747. package/vendor/rocksdb/utilities/blob_db/blob_db_impl.h +501 -0
  1748. package/vendor/rocksdb/utilities/blob_db/blob_db_impl_filesnapshot.cc +111 -0
  1749. package/vendor/rocksdb/utilities/blob_db/blob_db_iterator.h +148 -0
  1750. package/vendor/rocksdb/utilities/blob_db/blob_db_listener.h +69 -0
  1751. package/vendor/rocksdb/utilities/blob_db/blob_db_test.cc +2430 -0
  1752. package/vendor/rocksdb/utilities/blob_db/blob_dump_tool.cc +280 -0
  1753. package/vendor/rocksdb/utilities/blob_db/blob_dump_tool.h +56 -0
  1754. package/vendor/rocksdb/utilities/blob_db/blob_file.cc +316 -0
  1755. package/vendor/rocksdb/utilities/blob_db/blob_file.h +244 -0
  1756. package/vendor/rocksdb/utilities/cache_dump_load.cc +67 -0
  1757. package/vendor/rocksdb/utilities/cache_dump_load_impl.cc +369 -0
  1758. package/vendor/rocksdb/utilities/cache_dump_load_impl.h +356 -0
  1759. package/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.cc +106 -0
  1760. package/vendor/rocksdb/utilities/cassandra/cassandra_compaction_filter.h +57 -0
  1761. package/vendor/rocksdb/utilities/cassandra/cassandra_format_test.cc +377 -0
  1762. package/vendor/rocksdb/utilities/cassandra/cassandra_functional_test.cc +444 -0
  1763. package/vendor/rocksdb/utilities/cassandra/cassandra_options.h +41 -0
  1764. package/vendor/rocksdb/utilities/cassandra/cassandra_row_merge_test.cc +98 -0
  1765. package/vendor/rocksdb/utilities/cassandra/cassandra_serialize_test.cc +164 -0
  1766. package/vendor/rocksdb/utilities/cassandra/format.cc +367 -0
  1767. package/vendor/rocksdb/utilities/cassandra/format.h +183 -0
  1768. package/vendor/rocksdb/utilities/cassandra/merge_operator.cc +80 -0
  1769. package/vendor/rocksdb/utilities/cassandra/merge_operator.h +44 -0
  1770. package/vendor/rocksdb/utilities/cassandra/serialize.h +81 -0
  1771. package/vendor/rocksdb/utilities/cassandra/test_utils.cc +69 -0
  1772. package/vendor/rocksdb/utilities/cassandra/test_utils.h +42 -0
  1773. package/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.cc +470 -0
  1774. package/vendor/rocksdb/utilities/checkpoint/checkpoint_impl.h +64 -0
  1775. package/vendor/rocksdb/utilities/checkpoint/checkpoint_test.cc +988 -0
  1776. package/vendor/rocksdb/utilities/compaction_filters/layered_compaction_filter_base.h +41 -0
  1777. package/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc +24 -0
  1778. package/vendor/rocksdb/utilities/compaction_filters/remove_emptyvalue_compactionfilter.h +26 -0
  1779. package/vendor/rocksdb/utilities/compaction_filters.cc +52 -0
  1780. package/vendor/rocksdb/utilities/convenience/info_log_finder.cc +26 -0
  1781. package/vendor/rocksdb/utilities/counted_fs.cc +379 -0
  1782. package/vendor/rocksdb/utilities/counted_fs.h +158 -0
  1783. package/vendor/rocksdb/utilities/debug.cc +118 -0
  1784. package/vendor/rocksdb/utilities/env_mirror.cc +273 -0
  1785. package/vendor/rocksdb/utilities/env_mirror_test.cc +216 -0
  1786. package/vendor/rocksdb/utilities/env_timed.cc +181 -0
  1787. package/vendor/rocksdb/utilities/env_timed.h +95 -0
  1788. package/vendor/rocksdb/utilities/env_timed_test.cc +34 -0
  1789. package/vendor/rocksdb/utilities/fault_injection_env.cc +555 -0
  1790. package/vendor/rocksdb/utilities/fault_injection_env.h +258 -0
  1791. package/vendor/rocksdb/utilities/fault_injection_fs.cc +1071 -0
  1792. package/vendor/rocksdb/utilities/fault_injection_fs.h +593 -0
  1793. package/vendor/rocksdb/utilities/fault_injection_secondary_cache.cc +136 -0
  1794. package/vendor/rocksdb/utilities/fault_injection_secondary_cache.h +109 -0
  1795. package/vendor/rocksdb/utilities/leveldb_options/leveldb_options.cc +57 -0
  1796. package/vendor/rocksdb/utilities/memory/memory_test.cc +269 -0
  1797. package/vendor/rocksdb/utilities/memory/memory_util.cc +50 -0
  1798. package/vendor/rocksdb/utilities/memory_allocators.h +103 -0
  1799. package/vendor/rocksdb/utilities/merge_operators/bytesxor.cc +57 -0
  1800. package/vendor/rocksdb/utilities/merge_operators/bytesxor.h +40 -0
  1801. package/vendor/rocksdb/utilities/merge_operators/max.cc +64 -0
  1802. package/vendor/rocksdb/utilities/merge_operators/max_operator.h +35 -0
  1803. package/vendor/rocksdb/utilities/merge_operators/put.cc +74 -0
  1804. package/vendor/rocksdb/utilities/merge_operators/put_operator.h +56 -0
  1805. package/vendor/rocksdb/utilities/merge_operators/sortlist.cc +95 -0
  1806. package/vendor/rocksdb/utilities/merge_operators/sortlist.h +42 -0
  1807. package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.cc +76 -0
  1808. package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend.h +32 -0
  1809. package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.cc +130 -0
  1810. package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend2.h +52 -0
  1811. package/vendor/rocksdb/utilities/merge_operators/string_append/stringappend_test.cc +636 -0
  1812. package/vendor/rocksdb/utilities/merge_operators/uint64add.cc +56 -0
  1813. package/vendor/rocksdb/utilities/merge_operators/uint64add.h +35 -0
  1814. package/vendor/rocksdb/utilities/merge_operators.cc +115 -0
  1815. package/vendor/rocksdb/utilities/merge_operators.h +36 -0
  1816. package/vendor/rocksdb/utilities/object_registry.cc +381 -0
  1817. package/vendor/rocksdb/utilities/object_registry_test.cc +862 -0
  1818. package/vendor/rocksdb/utilities/option_change_migration/option_change_migration.cc +176 -0
  1819. package/vendor/rocksdb/utilities/option_change_migration/option_change_migration_test.cc +548 -0
  1820. package/vendor/rocksdb/utilities/options/options_util.cc +117 -0
  1821. package/vendor/rocksdb/utilities/options/options_util_test.cc +782 -0
  1822. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.cc +420 -0
  1823. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier.h +154 -0
  1824. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.cc +608 -0
  1825. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file.h +291 -0
  1826. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_file_buffer.h +127 -0
  1827. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.cc +84 -0
  1828. package/vendor/rocksdb/utilities/persistent_cache/block_cache_tier_metadata.h +122 -0
  1829. package/vendor/rocksdb/utilities/persistent_cache/hash_table.h +237 -0
  1830. package/vendor/rocksdb/utilities/persistent_cache/hash_table_bench.cc +310 -0
  1831. package/vendor/rocksdb/utilities/persistent_cache/hash_table_evictable.h +166 -0
  1832. package/vendor/rocksdb/utilities/persistent_cache/hash_table_test.cc +161 -0
  1833. package/vendor/rocksdb/utilities/persistent_cache/lrulist.h +172 -0
  1834. package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_bench.cc +355 -0
  1835. package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.cc +413 -0
  1836. package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_test.h +284 -0
  1837. package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.cc +165 -0
  1838. package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_tier.h +340 -0
  1839. package/vendor/rocksdb/utilities/persistent_cache/persistent_cache_util.h +67 -0
  1840. package/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.cc +138 -0
  1841. package/vendor/rocksdb/utilities/persistent_cache/volatile_tier_impl.h +139 -0
  1842. package/vendor/rocksdb/utilities/simulator_cache/cache_simulator.cc +287 -0
  1843. package/vendor/rocksdb/utilities/simulator_cache/cache_simulator.h +231 -0
  1844. package/vendor/rocksdb/utilities/simulator_cache/cache_simulator_test.cc +497 -0
  1845. package/vendor/rocksdb/utilities/simulator_cache/sim_cache.cc +372 -0
  1846. package/vendor/rocksdb/utilities/simulator_cache/sim_cache_test.cc +226 -0
  1847. package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.cc +221 -0
  1848. package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector.h +68 -0
  1849. package/vendor/rocksdb/utilities/table_properties_collectors/compact_on_deletion_collector_test.cc +238 -0
  1850. package/vendor/rocksdb/utilities/trace/file_trace_reader_writer.cc +133 -0
  1851. package/vendor/rocksdb/utilities/trace/file_trace_reader_writer.h +48 -0
  1852. package/vendor/rocksdb/utilities/trace/replayer_impl.cc +314 -0
  1853. package/vendor/rocksdb/utilities/trace/replayer_impl.h +84 -0
  1854. package/vendor/rocksdb/utilities/transactions/lock/lock_manager.cc +27 -0
  1855. package/vendor/rocksdb/utilities/transactions/lock/lock_manager.h +80 -0
  1856. package/vendor/rocksdb/utilities/transactions/lock/lock_tracker.h +207 -0
  1857. package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.cc +719 -0
  1858. package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager.h +222 -0
  1859. package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.cc +170 -0
  1860. package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_manager_test.h +324 -0
  1861. package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.cc +255 -0
  1862. package/vendor/rocksdb/utilities/transactions/lock/point/point_lock_tracker.h +97 -0
  1863. package/vendor/rocksdb/utilities/transactions/lock/range/range_lock_manager.h +34 -0
  1864. package/vendor/rocksdb/utilities/transactions/lock/range/range_locking_test.cc +448 -0
  1865. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.AGPLv3 +661 -0
  1866. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.APACHEv2 +174 -0
  1867. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/COPYING.GPLv2 +339 -0
  1868. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/README +13 -0
  1869. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/db.h +76 -0
  1870. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/comparator.h +138 -0
  1871. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/ft/ft-status.h +102 -0
  1872. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.cc +137 -0
  1873. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/concurrent_tree.h +174 -0
  1874. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.cc +220 -0
  1875. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/keyrange.h +141 -0
  1876. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.cc +525 -0
  1877. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/lock_request.h +255 -0
  1878. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.cc +1021 -0
  1879. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/locktree.h +580 -0
  1880. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/manager.cc +525 -0
  1881. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.cc +263 -0
  1882. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/range_buffer.h +178 -0
  1883. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.cc +518 -0
  1884. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/treenode.h +302 -0
  1885. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.cc +118 -0
  1886. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/txnid_set.h +92 -0
  1887. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc +211 -0
  1888. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.h +124 -0
  1889. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/memory.h +215 -0
  1890. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_assert_subst.h +39 -0
  1891. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_atomic.h +130 -0
  1892. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_external_pthread.h +83 -0
  1893. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_instrumentation.h +286 -0
  1894. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_portability.h +87 -0
  1895. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_pthread.h +520 -0
  1896. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_race_tools.h +179 -0
  1897. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/toku_time.h +197 -0
  1898. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/portability/txn_subst.h +27 -0
  1899. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/standalone_port.cc +130 -0
  1900. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.cc +151 -0
  1901. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/dbt.h +98 -0
  1902. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/growable_array.h +144 -0
  1903. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.cc +199 -0
  1904. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/memarena.h +141 -0
  1905. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt.h +794 -0
  1906. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/omt_impl.h +1295 -0
  1907. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/partitioned_counter.h +165 -0
  1908. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/lib/util/status.h +76 -0
  1909. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.cc +501 -0
  1910. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_manager.h +135 -0
  1911. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.cc +154 -0
  1912. package/vendor/rocksdb/utilities/transactions/lock/range/range_tree/range_tree_lock_tracker.h +146 -0
  1913. package/vendor/rocksdb/utilities/transactions/optimistic_transaction.cc +194 -0
  1914. package/vendor/rocksdb/utilities/transactions/optimistic_transaction.h +99 -0
  1915. package/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.cc +109 -0
  1916. package/vendor/rocksdb/utilities/transactions/optimistic_transaction_db_impl.h +86 -0
  1917. package/vendor/rocksdb/utilities/transactions/optimistic_transaction_test.cc +1479 -0
  1918. package/vendor/rocksdb/utilities/transactions/pessimistic_transaction.cc +1177 -0
  1919. package/vendor/rocksdb/utilities/transactions/pessimistic_transaction.h +311 -0
  1920. package/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.cc +780 -0
  1921. package/vendor/rocksdb/utilities/transactions/pessimistic_transaction_db.h +316 -0
  1922. package/vendor/rocksdb/utilities/transactions/snapshot_checker.cc +37 -0
  1923. package/vendor/rocksdb/utilities/transactions/timestamped_snapshot_test.cc +457 -0
  1924. package/vendor/rocksdb/utilities/transactions/transaction_base.cc +757 -0
  1925. package/vendor/rocksdb/utilities/transactions/transaction_base.h +382 -0
  1926. package/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.cc +133 -0
  1927. package/vendor/rocksdb/utilities/transactions/transaction_db_mutex_impl.h +24 -0
  1928. package/vendor/rocksdb/utilities/transactions/transaction_test.cc +6751 -0
  1929. package/vendor/rocksdb/utilities/transactions/transaction_test.h +578 -0
  1930. package/vendor/rocksdb/utilities/transactions/transaction_util.cc +204 -0
  1931. package/vendor/rocksdb/utilities/transactions/transaction_util.h +83 -0
  1932. package/vendor/rocksdb/utilities/transactions/write_committed_transaction_ts_test.cc +578 -0
  1933. package/vendor/rocksdb/utilities/transactions/write_prepared_transaction_test.cc +4066 -0
  1934. package/vendor/rocksdb/utilities/transactions/write_prepared_txn.cc +515 -0
  1935. package/vendor/rocksdb/utilities/transactions/write_prepared_txn.h +117 -0
  1936. package/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.cc +1038 -0
  1937. package/vendor/rocksdb/utilities/transactions/write_prepared_txn_db.h +1123 -0
  1938. package/vendor/rocksdb/utilities/transactions/write_unprepared_transaction_test.cc +779 -0
  1939. package/vendor/rocksdb/utilities/transactions/write_unprepared_txn.cc +1056 -0
  1940. package/vendor/rocksdb/utilities/transactions/write_unprepared_txn.h +339 -0
  1941. package/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.cc +476 -0
  1942. package/vendor/rocksdb/utilities/transactions/write_unprepared_txn_db.h +106 -0
  1943. package/vendor/rocksdb/utilities/ttl/db_ttl_impl.cc +617 -0
  1944. package/vendor/rocksdb/utilities/ttl/db_ttl_impl.h +243 -0
  1945. package/vendor/rocksdb/utilities/ttl/ttl_test.cc +913 -0
  1946. package/vendor/rocksdb/utilities/util_merge_operators_test.cc +100 -0
  1947. package/vendor/rocksdb/utilities/wal_filter.cc +22 -0
  1948. package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index.cc +694 -0
  1949. package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.cc +742 -0
  1950. package/vendor/rocksdb/utilities/write_batch_with_index/write_batch_with_index_internal.h +342 -0
  1951. 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&lt;byte[]&gt; 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&lt;N&gt;" - return the number of files at
3015
+ * level &lt;N&gt;, where &lt;N&gt; 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&lt;N&gt;" - return the number of files at
3048
+ * level &lt;N&gt;, where &lt;N&gt; 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
+ }