├── docs ├── CNAME ├── _includes │ ├── hero.html │ ├── doc_paging.html │ ├── nav │ │ ├── collection_nav_group_item.html │ │ └── collection_nav_group.html │ ├── plugins │ │ ├── button.html │ │ ├── all_share.html │ │ ├── plugin_row.html │ │ ├── google_share.html │ │ ├── iframe.html │ │ ├── ascii_cinema.html │ │ ├── github_star.html │ │ ├── github_watch.html │ │ ├── twitter_share.html │ │ ├── twitter_follow.html │ │ └── like_button.html │ ├── content │ │ ├── gridblocks.html │ │ └── items │ │ │ └── gridblock.html │ ├── ui │ │ └── button.html │ ├── katex_import.html │ ├── nav_search.html │ ├── header.html │ ├── home_header.html │ ├── doc.html │ └── blog_pagination.html ├── _data │ ├── powered_by.yml │ ├── powered_by_highlight.yml │ ├── nav_docs.yml │ ├── promo.yml │ └── nav.yml ├── _layouts │ ├── page.html │ ├── docs.html │ ├── post.html │ ├── redirect.html │ ├── plain.html │ ├── top-level.html │ ├── doc_page.html │ ├── blog.html │ ├── default.html │ ├── basic.html │ ├── blog_default.html │ ├── doc_default.html │ └── home.html ├── .gitignore ├── static │ ├── favicon.png │ ├── og_image.png │ ├── images │ │ ├── binaryseek.png │ │ ├── bloom_fp_vs_bpk.png │ │ ├── tree_example1.png │ │ ├── pcache-blockindex.jpg │ │ ├── pcache-fileindex.jpg │ │ ├── pcache-filelayout.jpg │ │ ├── pcache-readiopath.jpg │ │ ├── kv-checksum │ │ │ ├── WAL-read.png │ │ │ ├── WAL-write.png │ │ │ ├── WAL-fragment.png │ │ │ ├── Write-batch.png │ │ │ ├── Memtable-entry.png │ │ │ ├── Memtable-write.png │ │ │ ├── ProtInfo-Memtable.png │ │ │ ├── Writebatch-write.png │ │ │ ├── ProtInfo-Writebatch.png │ │ │ └── ProtInfo-Writebatch-to-Memtable.png │ │ ├── pcache-tieredstorage.jpg │ │ ├── pcache-writeiopath.jpg │ │ ├── compaction │ │ │ ├── full-range.png │ │ │ ├── l0-l1-contend.png │ │ │ ├── l1-l2-contend.png │ │ │ └── part-range-old.png │ │ ├── jni-ffi │ │ │ ├── jmh-result-fixed.png │ │ │ ├── jmh-result-select.png │ │ │ └── jmh-result-pinnable-vs-output-plot.png │ │ ├── asynchronous-io │ │ │ ├── mget_async.png │ │ │ └── scan_async.png │ │ ├── delrange │ │ │ ├── delrange_collapsed.png │ │ │ ├── delrange_key_schema.png │ │ │ ├── delrange_sst_blocks.png │ │ │ ├── delrange_uncollapsed.png │ │ │ └── delrange_write_path.png │ │ ├── dictcmp │ │ │ ├── dictcmp_raw_sampled.png │ │ │ ├── dictcmp_sst_blocks.png │ │ │ └── dictcmp_zstd_trained.png │ │ ├── rate-limiter │ │ │ ├── write-KBps-cdf.png │ │ │ ├── write-KBps-series.png │ │ │ └── auto-tuned-write-KBps-series.png │ │ ├── Resize-of-20140327_200754-300x225.jpg │ │ ├── rocksdb-secondary-cache │ │ │ ├── insert_flow.png │ │ │ ├── lookup_flow.png │ │ │ ├── arch_diagram.png │ │ │ ├── Mixgraph_hit_rate.png │ │ │ └── Mixgraph_throughput.png │ │ ├── data-block-hash-index │ │ │ ├── perf-cache-miss.png │ │ │ ├── perf-throughput.png │ │ │ ├── block-format-hash-index.png │ │ │ ├── block-format-binary-seek.png │ │ │ └── hash-index-data-structure.png │ │ ├── jni-get-benchmarks │ │ │ ├── optimization-graph.png │ │ │ ├── fig_1024_1_none_nopoolbig.png │ │ │ ├── fig_1024_1_copyout_nopoolbig.png │ │ │ └── fig_1024_1_none_nopoolsmall.png │ │ ├── align-compaction-output │ │ │ ├── file_cut_align.png │ │ │ ├── file_cut_normal.png │ │ │ ├── file_size_compare.png │ │ │ ├── write_amp_compare.png │ │ │ ├── file_cut_trival_move.png │ │ │ └── compaction_output_file_size_compare.png │ │ ├── lost-buffered-write-recovery │ │ │ ├── angry-cat.png │ │ │ ├── basic-setup.png │ │ │ ├── happy-cat.png │ │ │ ├── replay-extension.png │ │ │ ├── trace-extension.png │ │ │ └── test-fs-writable-file.png │ │ ├── integrated-blob-db │ │ │ ├── BlobDB_Benchmarks_RW_RO_Perf.png │ │ │ ├── BlobDB_Benchmarks_Write_Amp.png │ │ │ ├── BlobDB_Benchmarks_Write_Perf.png │ │ │ └── BlobDB_Benchmarks_Legacy_Vs_Integrated.png │ │ └── time-aware-tiered-storage │ │ │ ├── tiered_storage_design.png │ │ │ ├── tiered_storage_overview.png │ │ │ ├── tiered_storage_problem.png │ │ │ ├── compaction_moving_up_conflict.png │ │ │ └── per_key_placement_compaction.png │ └── fonts │ │ ├── LatoLatin-Black.woff │ │ ├── LatoLatin-Light.woff │ │ ├── LatoLatin-Black.woff2 │ │ ├── LatoLatin-Italic.woff │ │ ├── LatoLatin-Italic.woff2 │ │ ├── LatoLatin-Light.woff2 │ │ ├── LatoLatin-Regular.woff │ │ ├── LatoLatin-Regular.woff2 │ │ ├── LatoLatin-BlackItalic.woff │ │ └── LatoLatin-BlackItalic.woff2 ├── Gemfile ├── docs │ └── index.html ├── index.md ├── blog │ ├── index.html │ └── all.html ├── doc-type-examples │ ├── top-level-example.md │ ├── docs-hello-world.md │ └── 2016-04-07-blog-post-example.md ├── _posts │ ├── 2015-06-12-rocksdb-in-osquery.markdown │ ├── 2014-05-22-rocksdb-3-1-release.markdown │ ├── 2017-02-07-rocksdb-5-1-2-released.markdown │ ├── 2014-05-19-rocksdb-3-0-release.markdown │ ├── 2016-02-25-rocksdb-ama.markdown │ ├── 2015-04-22-integrating-rocksdb-with-mongodb-2.markdown │ └── 2017-06-29-rocksdb-5-5-1-released.markdown ├── _top-level │ └── support.md └── _sass │ ├── _blog.scss │ ├── _buttons.scss │ ├── _slideshow.scss │ ├── _promo.scss │ ├── _tables.scss │ └── _reset.scss ├── tools ├── advisor │ ├── advisor │ │ └── __init__.py │ └── test │ │ ├── __init__.py │ │ └── input_files │ │ ├── rules_err4.ini │ │ ├── rules_err2.ini │ │ ├── rules_err3.ini │ │ └── log_stats_parser_keys_ts ├── Dockerfile ├── sample-dump.dmp ├── block_cache_analyzer │ ├── __init__.py │ └── block_cache_trace_analyzer_tool.cc ├── backup_db.sh ├── restore_db.sh ├── ldb.cc ├── sst_dump.cc ├── rocksdb_dump_test.sh ├── ingest_external_sst.sh ├── trace_analyzer.cc ├── io_tracer_parser.cc ├── write_external_sst.sh ├── db_bench.cc ├── check_all_python.py ├── generate_random_db.sh └── CMakeLists.txt ├── unreleased_history ├── bug_fixes │ └── .gitkeep ├── new_features │ └── .gitkeep ├── behavior_changes │ └── .gitkeep ├── public_api_changes │ └── .gitkeep ├── performance_improvements │ └── .gitkeep └── add.sh ├── .lgtm.yml ├── fuzz ├── .gitignore └── proto │ └── db_operation.proto ├── examples ├── README.md └── .gitignore ├── .github ├── actions │ ├── pre-steps-macos │ │ └── action.yml │ ├── setup-folly │ │ └── action.yml │ ├── build-folly │ │ └── action.yml │ ├── install-gflags │ │ └── action.yml │ ├── install-gflags-on-macos │ │ └── action.yml │ ├── build-for-benchmarks │ │ └── action.yml │ ├── install-jdk8-on-macos │ │ └── action.yml │ ├── increase-max-open-files-on-macos │ │ └── action.yml │ ├── install-maven │ │ └── action.yml │ ├── post-benchmarks │ │ └── action.yml │ ├── setup-upstream │ │ └── action.yml │ ├── perform-benchmarks │ │ └── action.yml │ └── pre-steps │ │ └── action.yml └── workflows │ ├── benchmark-linux.yml │ └── nightly-candidate.yml ├── cloud ├── examples │ ├── README.md │ └── Makefile ├── LANGUAGE-BINDINGS.md ├── aws │ └── aws_file.h ├── purge.h └── benchmarks │ └── bulkload_seq.sh ├── .clang-format ├── .watchmanconfig ├── third-party └── gtest-1.8.1 │ └── fused-src │ └── gtest │ └── CMakeLists.txt ├── java ├── jmh │ ├── LICENSE-HEADER.txt │ └── README.md ├── src │ ├── main │ │ └── java │ │ │ └── org │ │ │ └── rocksdb │ │ │ ├── MutableOptionKey.java │ │ │ ├── AbstractTableFilter.java │ │ │ ├── Range.java │ │ │ ├── SstPartitionerFactory.java │ │ │ ├── util │ │ │ ├── SizeUnit.java │ │ │ └── BufferUtil.java │ │ │ ├── ExportImportFilesMetaData.java │ │ │ ├── BuiltinComparator.java │ │ │ ├── RemoveEmptyValueCompactionFilter.java │ │ │ ├── MergeOperator.java │ │ │ ├── TableFilter.java │ │ │ ├── DataBlockIndexType.java │ │ │ ├── SizeApproximationFlag.java │ │ │ ├── Experimental.java │ │ │ ├── UInt64AddOperator.java │ │ │ ├── CassandraCompactionFilter.java │ │ │ ├── SstPartitionerFixedPrefixFactory.java │ │ │ ├── TransactionalOptions.java │ │ │ ├── TableFormatConfig.java │ │ │ ├── TraceOptions.java │ │ │ ├── TraceWriter.java │ │ │ ├── ChecksumType.java │ │ │ └── LoggerInterface.java │ └── test │ │ └── java │ │ └── org │ │ └── rocksdb │ │ ├── util │ │ ├── ByteBufferAllocator.java │ │ ├── HeapByteBufferAllocator.java │ │ ├── DirectByteBufferAllocator.java │ │ └── SizeUnitTest.java │ │ ├── RocksNativeLibraryResource.java │ │ ├── StatsCallbackMock.java │ │ ├── WALRecoveryModeTest.java │ │ ├── ClockCacheTest.java │ │ ├── test │ │ ├── TestableEventListener.java │ │ └── RemoveEmptyValueCompactionFilterFactory.java │ │ ├── CompressionTypesTest.java │ │ ├── FlushOptionsTest.java │ │ └── CompactionPriorityTest.java ├── jdb_bench.sh ├── crossbuild │ └── build-linux.sh └── rocksjni │ ├── table_properties_collector_factory.h │ ├── export_import_files_metadatajni.cc │ ├── wal_filter.cc │ ├── snapshot.cc │ ├── trace_writer.cc │ ├── table_filter.cc │ ├── remove_emptyvalue_compactionfilterjni.cc │ ├── jnicallback.h │ ├── statisticsjni.cc │ ├── compaction_filter.cc │ ├── cassandra_compactionfilterjni.cc │ └── statisticsjni.h ├── buckifier ├── rocks_test_runner.sh └── check_buck_targets.sh ├── cmake ├── modules │ ├── CxxFlags.cmake │ ├── ReadVersion.cmake │ ├── Finduring.cmake │ ├── Findlz4.cmake │ ├── FindNUMA.cmake │ ├── Findzstd.cmake │ ├── Findgflags.cmake │ ├── FindSnappy.cmake │ ├── FindTBB.cmake │ └── FindJeMalloc.cmake └── RocksDBConfig.cmake.in ├── issue_template.md ├── rocksdb.pc.in ├── AUTHORS ├── include └── rocksdb │ ├── utilities │ ├── convenience.h │ ├── info_log_finder.h │ └── option_change_migration.h │ ├── db_bench_tool.h │ ├── db_stress_tool.h │ ├── rocksdb_namespace.h │ ├── cache_bench_tool.h │ ├── sst_dump_tool.h │ └── port_defs.h ├── port ├── README ├── malloc.h ├── xpress.h ├── likely.h ├── util_logger.h ├── port.h └── win │ └── xpress_win.h ├── cache ├── secondary_cache.cc ├── cache_entry_roles.h └── cache_bench.cc ├── monitoring ├── perf_level_imp.h ├── perf_level.cc └── file_read_sample.h ├── utilities ├── transactions │ ├── lock │ │ ├── range │ │ │ └── range_tree │ │ │ │ └── lib │ │ │ │ ├── README │ │ │ │ └── portability │ │ │ │ └── txn_subst.h │ │ └── lock_manager.cc │ └── transaction_db_mutex_impl.h ├── wal_filter.cc ├── compaction_filters │ ├── remove_emptyvalue_compactionfilter.h │ └── remove_emptyvalue_compactionfilter.cc └── convenience │ └── info_log_finder.cc ├── db ├── blob │ ├── blob_constants.h │ └── prefetch_buffer_collection.cc ├── db_info_dumper.h ├── malloc_stats.h ├── convenience_impl.h ├── wide │ └── wide_columns.cc ├── snapshot_impl.cc ├── write_callback.h ├── post_memtable_callback.h └── db_impl │ └── replication_codec.cc ├── table ├── table_properties_internal.h └── block_based │ ├── parsed_full_filter_block.cc │ └── data_block_footer.h ├── util ├── data_structure.cc ├── crc32c_ppc.h ├── overload.h ├── write_batch_util.cc ├── aligned_storage.h ├── hash128.h ├── set_comparator.h ├── kv_map.h └── gflags_compat.h ├── db_stress_tool ├── db_stress_stat.cc ├── CMakeLists.txt ├── db_stress_shared_state.cc ├── db_stress_driver.h └── db_stress.cc ├── DUMP_FORMAT.md ├── microbench └── CMakeLists.txt ├── CONTRIBUTING.md ├── PLUGINS.md ├── memtable └── stl_wrappers.h ├── common.mk └── Vagrantfile /docs/CNAME: -------------------------------------------------------------------------------- 1 | rocksdb.org -------------------------------------------------------------------------------- /docs/_includes/hero.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_includes/doc_paging.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/advisor/advisor/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tools/advisor/test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unreleased_history/bug_fixes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unreleased_history/new_features/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unreleased_history/behavior_changes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unreleased_history/public_api_changes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unreleased_history/performance_improvements/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_data/powered_by.yml: -------------------------------------------------------------------------------- 1 | # Fill in later if desired 2 | -------------------------------------------------------------------------------- /docs/_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: blog 3 | --- 4 | -------------------------------------------------------------------------------- /docs/_data/powered_by_highlight.yml: -------------------------------------------------------------------------------- 1 | # Fill in later if desired 2 | -------------------------------------------------------------------------------- /docs/_layouts/docs.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc_page 3 | --- 4 | 5 | {% include doc.html %} -------------------------------------------------------------------------------- /.lgtm.yml: -------------------------------------------------------------------------------- 1 | extraction: 2 | cpp: 3 | index: 4 | build_command: make static_lib 5 | -------------------------------------------------------------------------------- /docs/_data/nav_docs.yml: -------------------------------------------------------------------------------- 1 | - title: Quick Start 2 | items: 3 | - id: getting-started 4 | -------------------------------------------------------------------------------- /fuzz/.gitignore: -------------------------------------------------------------------------------- 1 | db_fuzzer 2 | db_map_fuzzer 3 | sst_file_writer_fuzzer 4 | 5 | proto/gen/* 6 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | _site/ 3 | *.swo 4 | *.swp 5 | _site 6 | .sass-cache 7 | *.psd 8 | *~ 9 | -------------------------------------------------------------------------------- /docs/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/favicon.png -------------------------------------------------------------------------------- /docs/static/og_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/og_image.png -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'github-pages', '~> 227' 3 | 4 | gem "webrick", "~> 1.7" 5 | -------------------------------------------------------------------------------- /tools/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:wheezy 2 | 3 | ADD ./ldb /rocksdb/tools/ldb 4 | 5 | CMD /rocksdb/tools/ldb 6 | -------------------------------------------------------------------------------- /docs/static/images/binaryseek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/binaryseek.png -------------------------------------------------------------------------------- /tools/sample-dump.dmp: -------------------------------------------------------------------------------- 1 | ROCKDUMP{}key0contentsofkey0key1contentsofkey1key2contentsofkey2 -------------------------------------------------------------------------------- /docs/docs/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: docs 3 | title: Docs 4 | layout: redirect 5 | destination: getting-started.html 6 | --- 7 | -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Black.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Black.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Light.woff -------------------------------------------------------------------------------- /docs/static/images/bloom_fp_vs_bpk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/bloom_fp_vs_bpk.png -------------------------------------------------------------------------------- /docs/static/images/tree_example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/tree_example1.png -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Black.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Black.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Italic.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Italic.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Light.woff2 -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Regular.woff -------------------------------------------------------------------------------- /docs/static/images/pcache-blockindex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/pcache-blockindex.jpg -------------------------------------------------------------------------------- /docs/static/images/pcache-fileindex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/pcache-fileindex.jpg -------------------------------------------------------------------------------- /docs/static/images/pcache-filelayout.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/pcache-filelayout.jpg -------------------------------------------------------------------------------- /docs/static/images/pcache-readiopath.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/pcache-readiopath.jpg -------------------------------------------------------------------------------- /docs/_layouts/post.html: -------------------------------------------------------------------------------- 1 | --- 2 | collection: blog 3 | layout: blog 4 | --- 5 | 6 |
7 | {% include post.html %} 8 |
-------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-Regular.woff2 -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/WAL-read.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/WAL-read.png -------------------------------------------------------------------------------- /docs/static/images/pcache-tieredstorage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/pcache-tieredstorage.jpg -------------------------------------------------------------------------------- /docs/static/images/pcache-writeiopath.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/pcache-writeiopath.jpg -------------------------------------------------------------------------------- /tools/block_cache_analyzer/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-BlackItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-BlackItalic.woff -------------------------------------------------------------------------------- /docs/static/fonts/LatoLatin-BlackItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/fonts/LatoLatin-BlackItalic.woff2 -------------------------------------------------------------------------------- /docs/static/images/compaction/full-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/compaction/full-range.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/WAL-write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/WAL-write.png -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | 1. Compile RocksDB first by executing `make static_lib` in parent dir 2 | 2. Compile all examples: `cd examples/; make all` 3 | -------------------------------------------------------------------------------- /docs/static/images/compaction/l0-l1-contend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/compaction/l0-l1-contend.png -------------------------------------------------------------------------------- /docs/static/images/compaction/l1-l2-contend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/compaction/l1-l2-contend.png -------------------------------------------------------------------------------- /docs/static/images/compaction/part-range-old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/compaction/part-range-old.png -------------------------------------------------------------------------------- /docs/static/images/jni-ffi/jmh-result-fixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-ffi/jmh-result-fixed.png -------------------------------------------------------------------------------- /docs/static/images/jni-ffi/jmh-result-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-ffi/jmh-result-select.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/WAL-fragment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/WAL-fragment.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/Write-batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/Write-batch.png -------------------------------------------------------------------------------- /.github/actions/pre-steps-macos/action.yml: -------------------------------------------------------------------------------- 1 | name: pre-steps-macos 2 | runs: 3 | using: composite 4 | steps: 5 | - uses: "./.github/actions/pre-steps" 6 | -------------------------------------------------------------------------------- /cloud/examples/README.md: -------------------------------------------------------------------------------- 1 | 1. Compile RocksDB first by executing `make -j8 static_lib` in parent dir 2 | 2. Compile all examples: `cd examples/; make all` 3 | -------------------------------------------------------------------------------- /docs/static/images/asynchronous-io/mget_async.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/asynchronous-io/mget_async.png -------------------------------------------------------------------------------- /docs/static/images/asynchronous-io/scan_async.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/asynchronous-io/scan_async.png -------------------------------------------------------------------------------- /docs/static/images/delrange/delrange_collapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/delrange/delrange_collapsed.png -------------------------------------------------------------------------------- /docs/static/images/dictcmp/dictcmp_raw_sampled.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/dictcmp/dictcmp_raw_sampled.png -------------------------------------------------------------------------------- /docs/static/images/dictcmp/dictcmp_sst_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/dictcmp/dictcmp_sst_blocks.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/Memtable-entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/Memtable-entry.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/Memtable-write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/Memtable-write.png -------------------------------------------------------------------------------- /docs/static/images/rate-limiter/write-KBps-cdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rate-limiter/write-KBps-cdf.png -------------------------------------------------------------------------------- /docs/_layouts/redirect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/static/images/delrange/delrange_key_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/delrange/delrange_key_schema.png -------------------------------------------------------------------------------- /docs/static/images/delrange/delrange_sst_blocks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/delrange/delrange_sst_blocks.png -------------------------------------------------------------------------------- /docs/static/images/delrange/delrange_uncollapsed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/delrange/delrange_uncollapsed.png -------------------------------------------------------------------------------- /docs/static/images/delrange/delrange_write_path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/delrange/delrange_write_path.png -------------------------------------------------------------------------------- /docs/static/images/dictcmp/dictcmp_zstd_trained.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/dictcmp/dictcmp_zstd_trained.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/ProtInfo-Memtable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/ProtInfo-Memtable.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/Writebatch-write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/Writebatch-write.png -------------------------------------------------------------------------------- /docs/static/images/rate-limiter/write-KBps-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rate-limiter/write-KBps-series.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/ProtInfo-Writebatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/ProtInfo-Writebatch.png -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | # Complete list of style options can be found at: 2 | # http://clang.llvm.org/docs/ClangFormatStyleOptions.html 3 | --- 4 | BasedOnStyle: Google 5 | ... 6 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | { 2 | "content_hash_warming": true, 3 | "content_hash_max_items": 333333, 4 | "hint_num_files_per_dir": 8, 5 | "fsevents_latency": 0.05 6 | } 7 | -------------------------------------------------------------------------------- /docs/_includes/nav/collection_nav_group_item.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/static/images/Resize-of-20140327_200754-300x225.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/Resize-of-20140327_200754-300x225.jpg -------------------------------------------------------------------------------- /docs/static/images/rocksdb-secondary-cache/insert_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rocksdb-secondary-cache/insert_flow.png -------------------------------------------------------------------------------- /docs/static/images/rocksdb-secondary-cache/lookup_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rocksdb-secondary-cache/lookup_flow.png -------------------------------------------------------------------------------- /docs/static/images/data-block-hash-index/perf-cache-miss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/data-block-hash-index/perf-cache-miss.png -------------------------------------------------------------------------------- /docs/static/images/data-block-hash-index/perf-throughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/data-block-hash-index/perf-throughput.png -------------------------------------------------------------------------------- /docs/static/images/jni-get-benchmarks/optimization-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-get-benchmarks/optimization-graph.png -------------------------------------------------------------------------------- /docs/static/images/rocksdb-secondary-cache/arch_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rocksdb-secondary-cache/arch_diagram.png -------------------------------------------------------------------------------- /docs/_includes/plugins/button.html: -------------------------------------------------------------------------------- 1 |
2 | {{ include.text }} 6 |
-------------------------------------------------------------------------------- /docs/static/images/align-compaction-output/file_cut_align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/align-compaction-output/file_cut_align.png -------------------------------------------------------------------------------- /docs/static/images/align-compaction-output/file_cut_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/align-compaction-output/file_cut_normal.png -------------------------------------------------------------------------------- /docs/static/images/lost-buffered-write-recovery/angry-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/lost-buffered-write-recovery/angry-cat.png -------------------------------------------------------------------------------- /docs/static/images/lost-buffered-write-recovery/basic-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/lost-buffered-write-recovery/basic-setup.png -------------------------------------------------------------------------------- /docs/static/images/lost-buffered-write-recovery/happy-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/lost-buffered-write-recovery/happy-cat.png -------------------------------------------------------------------------------- /docs/static/images/align-compaction-output/file_size_compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/align-compaction-output/file_size_compare.png -------------------------------------------------------------------------------- /docs/static/images/align-compaction-output/write_amp_compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/align-compaction-output/write_amp_compare.png -------------------------------------------------------------------------------- /docs/static/images/jni-ffi/jmh-result-pinnable-vs-output-plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-ffi/jmh-result-pinnable-vs-output-plot.png -------------------------------------------------------------------------------- /docs/static/images/rate-limiter/auto-tuned-write-KBps-series.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rate-limiter/auto-tuned-write-KBps-series.png -------------------------------------------------------------------------------- /docs/static/images/rocksdb-secondary-cache/Mixgraph_hit_rate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rocksdb-secondary-cache/Mixgraph_hit_rate.png -------------------------------------------------------------------------------- /docs/static/images/align-compaction-output/file_cut_trival_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/align-compaction-output/file_cut_trival_move.png -------------------------------------------------------------------------------- /docs/static/images/data-block-hash-index/block-format-hash-index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/data-block-hash-index/block-format-hash-index.png -------------------------------------------------------------------------------- /docs/static/images/jni-get-benchmarks/fig_1024_1_none_nopoolbig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-get-benchmarks/fig_1024_1_none_nopoolbig.png -------------------------------------------------------------------------------- /docs/static/images/kv-checksum/ProtInfo-Writebatch-to-Memtable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/kv-checksum/ProtInfo-Writebatch-to-Memtable.png -------------------------------------------------------------------------------- /docs/static/images/lost-buffered-write-recovery/replay-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/lost-buffered-write-recovery/replay-extension.png -------------------------------------------------------------------------------- /docs/static/images/lost-buffered-write-recovery/trace-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/lost-buffered-write-recovery/trace-extension.png -------------------------------------------------------------------------------- /docs/static/images/rocksdb-secondary-cache/Mixgraph_throughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/rocksdb-secondary-cache/Mixgraph_throughput.png -------------------------------------------------------------------------------- /.github/actions/setup-folly/action.yml: -------------------------------------------------------------------------------- 1 | name: setup-folly 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Checkout folly sources 6 | run: make checkout_folly 7 | shell: bash 8 | -------------------------------------------------------------------------------- /docs/static/images/data-block-hash-index/block-format-binary-seek.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/data-block-hash-index/block-format-binary-seek.png -------------------------------------------------------------------------------- /docs/static/images/data-block-hash-index/hash-index-data-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/data-block-hash-index/hash-index-data-structure.png -------------------------------------------------------------------------------- /docs/static/images/integrated-blob-db/BlobDB_Benchmarks_RW_RO_Perf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_RW_RO_Perf.png -------------------------------------------------------------------------------- /docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Amp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Amp.png -------------------------------------------------------------------------------- /docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Perf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Write_Perf.png -------------------------------------------------------------------------------- /docs/static/images/jni-get-benchmarks/fig_1024_1_copyout_nopoolbig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-get-benchmarks/fig_1024_1_copyout_nopoolbig.png -------------------------------------------------------------------------------- /docs/static/images/jni-get-benchmarks/fig_1024_1_none_nopoolsmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/jni-get-benchmarks/fig_1024_1_none_nopoolsmall.png -------------------------------------------------------------------------------- /docs/static/images/time-aware-tiered-storage/tiered_storage_design.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/time-aware-tiered-storage/tiered_storage_design.png -------------------------------------------------------------------------------- /.github/actions/build-folly/action.yml: -------------------------------------------------------------------------------- 1 | name: build-folly 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Build folly and dependencies 6 | run: make build_folly 7 | shell: bash 8 | -------------------------------------------------------------------------------- /docs/static/images/lost-buffered-write-recovery/test-fs-writable-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/lost-buffered-write-recovery/test-fs-writable-file.png -------------------------------------------------------------------------------- /docs/static/images/time-aware-tiered-storage/tiered_storage_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/time-aware-tiered-storage/tiered_storage_overview.png -------------------------------------------------------------------------------- /docs/static/images/time-aware-tiered-storage/tiered_storage_problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/time-aware-tiered-storage/tiered_storage_problem.png -------------------------------------------------------------------------------- /third-party/gtest-1.8.1/fused-src/gtest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(gtest gtest-all.cc) 2 | 3 | # Add dependency of gtest on thread library 4 | target_link_libraries(gtest ${CMAKE_THREAD_LIBS_INIT}) 5 | -------------------------------------------------------------------------------- /docs/_includes/plugins/all_share.html: -------------------------------------------------------------------------------- 1 |
2 | {% include plugins/like_button.html %}{% include plugins/twitter_share.html %}{% include plugins/google_share.html %} 3 |
-------------------------------------------------------------------------------- /docs/static/images/time-aware-tiered-storage/compaction_moving_up_conflict.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/time-aware-tiered-storage/compaction_moving_up_conflict.png -------------------------------------------------------------------------------- /docs/static/images/time-aware-tiered-storage/per_key_placement_compaction.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/time-aware-tiered-storage/per_key_placement_compaction.png -------------------------------------------------------------------------------- /docs/_includes/plugins/plugin_row.html: -------------------------------------------------------------------------------- 1 |
2 | {% for child in include.children %} 3 | {% include plugins/{{child.type}}.html href=child.href text=child.text %} 4 | {% endfor %} 5 |
-------------------------------------------------------------------------------- /docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Legacy_Vs_Integrated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/integrated-blob-db/BlobDB_Benchmarks_Legacy_Vs_Integrated.png -------------------------------------------------------------------------------- /docs/_includes/plugins/google_share.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/static/images/align-compaction-output/compaction_output_file_size_compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rockset/rocksdb-cloud/HEAD/docs/static/images/align-compaction-output/compaction_output_file_size_compare.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: home 3 | title: RocksDB | A persistent key-value store 4 | id: home 5 | --- 6 | 7 | ## Features 8 | 9 | {% include content/gridblocks.html data_source=site.data.features align="center" %} 10 | -------------------------------------------------------------------------------- /.github/actions/install-gflags/action.yml: -------------------------------------------------------------------------------- 1 | name: install-gflags 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Install gflags 6 | run: sudo apt-get update -y && sudo apt-get install -y libgflags-dev 7 | shell: bash 8 | -------------------------------------------------------------------------------- /docs/_layouts/plain.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 |
7 | {{ content }} 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /.github/actions/install-gflags-on-macos/action.yml: -------------------------------------------------------------------------------- 1 | name: install-gflags-on-macos 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Install gflags on macos 6 | run: HOMEBREW_NO_AUTO_UPDATE=1 brew install gflags 7 | shell: bash 8 | -------------------------------------------------------------------------------- /docs/_layouts/top-level.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 |
6 |
7 | {{ content }} 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /docs/_data/promo.yml: -------------------------------------------------------------------------------- 1 | # This file determines the list of promotional elements added to the header of \ 2 | # your site's homepage. Full list of plugins are shown 3 | 4 | - type: button 5 | href: docs/getting-started.html 6 | text: Get Started 7 | -------------------------------------------------------------------------------- /docs/_layouts/doc_page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc_default 3 | --- 4 | 5 |
6 |
7 | {{ content }} 8 |
9 |
10 | 11 | -------------------------------------------------------------------------------- /docs/blog/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: blog 3 | title: Blog 4 | layout: blog 5 | category: blog 6 | --- 7 | 8 |
9 | {% for page in site.posts %} 10 | {% include post.html truncate=true %} 11 | {% endfor %} 12 |
13 | -------------------------------------------------------------------------------- /.github/actions/build-for-benchmarks/action.yml: -------------------------------------------------------------------------------- 1 | name: build-for-benchmarks 2 | runs: 3 | using: composite 4 | steps: 5 | - uses: "./.github/actions/pre-steps" 6 | - name: Linux build for benchmarks 7 | run: make V=1 J=8 -j8 release 8 | shell: bash 9 | -------------------------------------------------------------------------------- /docs/_includes/content/gridblocks.html: -------------------------------------------------------------------------------- 1 |
2 | {% for item in {{include.data_source}} %} 3 | {% include content/items/gridblock.html item=item layout=include.layout imagealign=include.imagealign align=include.align %} 4 | {% endfor %} 5 |
-------------------------------------------------------------------------------- /docs/_includes/ui/button.html: -------------------------------------------------------------------------------- 1 | {{ include.button_text }} -------------------------------------------------------------------------------- /docs/_layouts/blog.html: -------------------------------------------------------------------------------- 1 | --- 2 | category: blog 3 | layout: blog_default 4 | --- 5 | 6 |
7 |
8 | {{ content }} 9 |
10 |
11 | 12 | -------------------------------------------------------------------------------- /docs/_includes/plugins/iframe.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | {% include plugins/button.html href=include.href text=include.text %} 6 |
-------------------------------------------------------------------------------- /docs/_includes/katex_import.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/_includes/plugins/ascii_cinema.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include nav.html alwayson=true %} 6 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /java/jmh/LICENSE-HEADER.txt: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /docs/_layouts/basic.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: doc_default 3 | --- 4 | 5 |
6 |
7 |
8 | {{ content }} 9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | c_simple_example 2 | column_families_example 3 | compact_files_example 4 | compaction_filter_example 5 | multi_processes_example 6 | optimistic_transaction_example 7 | options_file_example 8 | rocksdb_backup_restore_example 9 | simple_example 10 | transaction_example 11 | -------------------------------------------------------------------------------- /docs/doc-type-examples/top-level-example.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: top-level 3 | title: Support Example 4 | id: top-level-example 5 | category: top-level 6 | --- 7 | 8 | This is a static page disconnected from the blog or docs collections that can be added at a top-level (i.e., the same level as `index.md`). 9 | -------------------------------------------------------------------------------- /buckifier/rocks_test_runner.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # Create a tmp directory for the test to use 4 | TEST_DIR=$(mktemp -d /dev/shm/fbcode_rocksdb_XXXXXXX) 5 | # shellcheck disable=SC2068 6 | TEST_TMPDIR="$TEST_DIR" $@ && rm -rf "$TEST_DIR" 7 | -------------------------------------------------------------------------------- /cmake/modules/CxxFlags.cmake: -------------------------------------------------------------------------------- 1 | macro(get_cxx_std_flags FLAGS_VARIABLE) 2 | if( CMAKE_CXX_STANDARD_REQUIRED ) 3 | set(${FLAGS_VARIABLE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}) 4 | else() 5 | set(${FLAGS_VARIABLE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION}) 6 | endif() 7 | endmacro() 8 | -------------------------------------------------------------------------------- /.github/actions/install-jdk8-on-macos/action.yml: -------------------------------------------------------------------------------- 1 | name: install-jdk8-on-macos 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Install JDK 8 on macos 6 | run: |- 7 | HOMEBREW_NO_AUTO_UPDATE=1 brew tap bell-sw/liberica 8 | HOMEBREW_NO_AUTO_UPDATE=1 brew install --cask liberica-jdk8 9 | shell: bash 10 | -------------------------------------------------------------------------------- /cloud/LANGUAGE-BINDINGS.md: -------------------------------------------------------------------------------- 1 | This is the list of all known third-party language bindings for RocksDB-Cloud. If something is missing, please open a pull request to add it. 2 | 3 | * Java - https://github.com/facebook/rocksdb/tree/master/java 4 | * Erlang - https://gitlab.com/barrel-db/erlang-rocksdb/wikis/Getting-Started-with-Rocksdb-Cloud 5 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | > Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev 2 | 3 | ### Expected behavior 4 | 5 | ### Actual behavior 6 | 7 | ### Steps to reproduce the behavior 8 | -------------------------------------------------------------------------------- /rocksdb.pc.in: -------------------------------------------------------------------------------- 1 | prefix="@CMAKE_INSTALL_PREFIX@" 2 | includedir="${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" 3 | libdir="${prefix}/@CMAKE_INSTALL_LIBDIR@" 4 | 5 | Name: @PROJECT_NAME@ 6 | Description: @PROJECT_DESCRIPTION@ 7 | URL: @PROJECT_HOMEPAGE_URL@ 8 | Version: @PROJECT_VERSION@ 9 | Cflags: -I"${includedir}" 10 | Libs: -L"${libdir}" -lrocksdb 11 | -------------------------------------------------------------------------------- /.github/actions/increase-max-open-files-on-macos/action.yml: -------------------------------------------------------------------------------- 1 | name: increase-max-open-files-on-macos 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Increase max open files 6 | run: |- 7 | sudo sysctl -w kern.maxfiles=1048576 8 | sudo sysctl -w kern.maxfilesperproc=1048576 9 | sudo launchctl limit maxfiles 1048576 10 | shell: bash 11 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Facebook Inc. 2 | Facebook Engineering Team 3 | 4 | Google Inc. 5 | # Initial version authors: 6 | Jeffrey Dean 7 | Sanjay Ghemawat 8 | 9 | # Partial list of contributors: 10 | Kevin Regan 11 | Johan Bilien 12 | Matthew Von-Maszewski (Basho Technologies) 13 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/MutableOptionKey.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | package org.rocksdb; 3 | 4 | public interface MutableOptionKey { 5 | enum ValueType { 6 | DOUBLE, 7 | LONG, 8 | INT, 9 | BOOLEAN, 10 | INT_ARRAY, 11 | ENUM 12 | } 13 | 14 | String name(); 15 | ValueType getValueType(); 16 | } 17 | -------------------------------------------------------------------------------- /tools/backup_db.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # 4 | # 5 | 6 | if [ "$#" -lt 2 ]; then 7 | echo "usage: ${BASH_SOURCE[0]} " 8 | exit 1 9 | fi 10 | 11 | db_dir="$1" 12 | backup_dir="$2" 13 | 14 | echo "== Backing up DB $db_dir to $backup_dir" 15 | ./ldb backup --db="$db_dir" --backup_dir="$backup_dir" 16 | -------------------------------------------------------------------------------- /tools/restore_db.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # 4 | # 5 | 6 | if [ "$#" -lt 2 ]; then 7 | echo "usage: ${BASH_SOURCE[0]} " 8 | exit 1 9 | fi 10 | 11 | backup_dir="$1" 12 | db_dir="$2" 13 | 14 | echo "== Restoring latest from $backup_dir to $db_dir" 15 | ./ldb restore --db="$db_dir" --backup_dir="$backup_dir" 16 | -------------------------------------------------------------------------------- /docs/doc-type-examples/docs-hello-world.md: -------------------------------------------------------------------------------- 1 | --- 2 | docid: hello-world 3 | title: Hello, World! 4 | layout: docs 5 | permalink: /docs/hello-world.html 6 | --- 7 | 8 | Any local docs would go in the `_docs` directory. 9 | 10 | ## No documentation? 11 | 12 | If you have no documentation for your site, you can remove the entire `_docs` folder. Otherwise add markdown files in here. See CONTRIBUTING.md for details. 13 | -------------------------------------------------------------------------------- /include/rocksdb/utilities/convenience.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | // This file was moved to rocksdb/convenience.h" 9 | 10 | #include "rocksdb/convenience.h" 11 | -------------------------------------------------------------------------------- /cloud/aws/aws_file.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-present, Rockset, Inc. All rights reserved. 2 | // 3 | #pragma once 4 | #ifdef USE_AWS 5 | 6 | #include 7 | 8 | #include "rocksdb/rocksdb_namespace.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | inline Aws::String ToAwsString(const std::string& s) { 12 | return Aws::String(s.data(), s.size()); 13 | } 14 | 15 | } // namespace ROCKSDB_NAMESPACE 16 | 17 | #endif /* USE_AWS */ 18 | -------------------------------------------------------------------------------- /port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /tools/ldb.cc: -------------------------------------------------------------------------------- 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 | 7 | #include "rocksdb/ldb_tool.h" 8 | 9 | int main(int argc, char** argv) { 10 | ROCKSDB_NAMESPACE::LDBTool tool; 11 | tool.Run(argc, argv); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /tools/sst_dump.cc: -------------------------------------------------------------------------------- 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 | 7 | #include "rocksdb/sst_dump_tool.h" 8 | 9 | int main(int argc, char** argv) { 10 | ROCKSDB_NAMESPACE::SSTDumpTool tool; 11 | return tool.Run(argc, argv); 12 | } 13 | -------------------------------------------------------------------------------- /.github/actions/install-maven/action.yml: -------------------------------------------------------------------------------- 1 | name: install-maven 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Install Maven 6 | run: | 7 | wget --no-check-certificate https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz 8 | tar zxf apache-maven-3.9.6-bin.tar.gz 9 | echo "export M2_HOME=$(pwd)/apache-maven-3.9.6" >> $GITHUB_ENV 10 | echo "$(pwd)/apache-maven-3.9.6/bin" >> $GITHUB_PATH 11 | shell: bash 12 | -------------------------------------------------------------------------------- /cache/secondary_cache.cc: -------------------------------------------------------------------------------- 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 | #include "rocksdb/secondary_cache.h" 7 | 8 | #include "cache/cache_entry_roles.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | } // namespace ROCKSDB_NAMESPACE 13 | -------------------------------------------------------------------------------- /docs/_layouts/blog_default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include nav.html alwayson=true %} 6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /include/rocksdb/db_bench_tool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-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 | #pragma once 6 | 7 | #include "rocksdb/rocksdb_namespace.h" 8 | 9 | namespace ROCKSDB_NAMESPACE { 10 | int db_bench_tool(int argc, char** argv); 11 | } // namespace ROCKSDB_NAMESPACE 12 | -------------------------------------------------------------------------------- /tools/rocksdb_dump_test.sh: -------------------------------------------------------------------------------- 1 | # shellcheck disable=SC2148 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | TESTDIR=`mktemp -d ${TMPDIR:-/tmp}/rocksdb-dump-test.XXXXX` 4 | DUMPFILE="tools/sample-dump.dmp" 5 | 6 | # Verify that the sample dump file is undumpable and then redumpable. 7 | ./rocksdb_undump --dump_location=$DUMPFILE --db_path=$TESTDIR/db 8 | ./rocksdb_dump --anonymous --db_path=$TESTDIR/db --dump_location=$TESTDIR/dump 9 | cmp $DUMPFILE $TESTDIR/dump 10 | -------------------------------------------------------------------------------- /docs/_includes/plugins/github_star.html: -------------------------------------------------------------------------------- 1 |
2 | Star 3 |
4 | -------------------------------------------------------------------------------- /docs/_includes/plugins/github_watch.html: -------------------------------------------------------------------------------- 1 |
2 | Watch 3 |
4 | -------------------------------------------------------------------------------- /include/rocksdb/db_stress_tool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-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 | #pragma once 6 | 7 | #include "rocksdb/rocksdb_namespace.h" 8 | 9 | namespace ROCKSDB_NAMESPACE { 10 | int db_stress_tool(int argc, char** argv); 11 | } // namespace ROCKSDB_NAMESPACE 12 | -------------------------------------------------------------------------------- /tools/ingest_external_sst.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # 4 | # 5 | 6 | if [ "$#" -lt 2 ]; then 7 | echo "usage: $BASH_SOURCE " 8 | exit 1 9 | fi 10 | 11 | db_dir=$1 12 | external_sst_dir=$2 13 | 14 | for f in `find $external_sst_dir -name extern_sst*` 15 | do 16 | echo == Ingesting external SST file $f to DB at $db_dir 17 | ./ldb --db=$db_dir --create_if_missing ingest_extern_sst $f 18 | done 19 | -------------------------------------------------------------------------------- /docs/_layouts/doc_default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include nav.html alwayson=true %} 6 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /docs/_includes/nav_search.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /docs/blog/all.html: -------------------------------------------------------------------------------- 1 | --- 2 | id: all 3 | layout: blog 4 | category: blog 5 | --- 6 | 7 |
8 |
9 |

All Posts

10 | {% for post in site.posts %} 11 | {% assign author = site.data.authors[post.author] %} 12 |

13 | 14 | {{ post.title }} 15 | 16 | on {{ post.date | date: "%B %e, %Y" }} by {{ author.display_name }} 17 |

18 | {% endfor %} 19 |
20 |
21 | -------------------------------------------------------------------------------- /java/jdb_bench.sh: -------------------------------------------------------------------------------- 1 | # shellcheck disable=SC2148 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | PLATFORM=64 4 | if [ `getconf LONG_BIT` != "64" ] 5 | then 6 | PLATFORM=32 7 | fi 8 | 9 | ROCKS_JAR=`find target -name rocksdbjni*.jar` 10 | 11 | echo "Running benchmark in $PLATFORM-Bit mode." 12 | # shellcheck disable=SC2068 13 | java -server -d$PLATFORM -XX:NewSize=4m -XX:+AggressiveOpts -Djava.library.path=target -cp "${ROCKS_JAR}:benchmark/target/classes" org.rocksdb.benchmark.DbBenchmark $@ 14 | -------------------------------------------------------------------------------- /monitoring/perf_level_imp.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | #include "port/port.h" 8 | #include "rocksdb/perf_level.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | extern thread_local PerfLevel perf_level; 13 | 14 | } // namespace ROCKSDB_NAMESPACE 15 | -------------------------------------------------------------------------------- /tools/advisor/test/input_files/rules_err4.ini: -------------------------------------------------------------------------------- 1 | [Rule "normal-rule"] 2 | suggestions=inc-bg-flush 3 | conditions=missing-source 4 | 5 | [Condition "normal-condition"] 6 | source=LOG 7 | regex=Stopping writes because we have \d+ immutable memtables \(waiting for flush\), max_write_buffer_number is set to \d+ 8 | 9 | [Suggestion "inc-bg-flush"] 10 | option=DBOptions.max_background_flushes 11 | action=increase 12 | 13 | [Suggestion] # missing section name 14 | option=CFOptions.max_write_buffer_number 15 | action=increase 16 | -------------------------------------------------------------------------------- /tools/advisor/test/input_files/rules_err2.ini: -------------------------------------------------------------------------------- 1 | [Rule "normal-rule"] 2 | suggestions=inc-bg-flush:inc-write-buffer 3 | conditions=missing-source 4 | 5 | [Condition "missing-source"] 6 | source= 7 | regex=Stopping writes because we have \d+ immutable memtables \(waiting for flush\), max_write_buffer_number is set to \d+ 8 | 9 | [Suggestion "inc-bg-flush"] 10 | option=DBOptions.max_background_flushes 11 | action=increase 12 | 13 | [Suggestion "inc-write-buffer"] 14 | option=CFOptions.max_write_buffer_number 15 | action=increase 16 | -------------------------------------------------------------------------------- /tools/advisor/test/input_files/rules_err3.ini: -------------------------------------------------------------------------------- 1 | [Rule "normal-rule"] 2 | suggestions=missing-action:inc-write-buffer 3 | conditions=missing-source 4 | 5 | [Condition "normal-condition"] 6 | source=LOG 7 | regex=Stopping writes because we have \d+ immutable memtables \(waiting for flush\), max_write_buffer_number is set to \d+ 8 | 9 | [Suggestion "missing-action"] 10 | option=DBOptions.max_background_flushes 11 | action= 12 | 13 | [Suggestion "inc-write-buffer"] 14 | option=CFOptions.max_write_buffer_number 15 | action=increase 16 | -------------------------------------------------------------------------------- /utilities/transactions/lock/range/range_tree/lib/README: -------------------------------------------------------------------------------- 1 | The files in this directory originally come from 2 | https://github.com/percona/PerconaFT/. 3 | 4 | This directory only includes the "locktree" part of PerconaFT, and its 5 | dependencies. 6 | 7 | The following modifications were made: 8 | - Make locktree usable outside of PerconaFT library 9 | - Add shared read-only lock support 10 | 11 | The files named *_subst.* are substitutes of the PerconaFT's files, they 12 | contain replacements of PerconaFT's functionality. 13 | 14 | -------------------------------------------------------------------------------- /db/blob/blob_constants.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | #include 9 | 10 | #include "rocksdb/rocksdb_namespace.h" 11 | 12 | namespace ROCKSDB_NAMESPACE { 13 | 14 | constexpr uint64_t kInvalidBlobFileNumber = 0; 15 | 16 | } // namespace ROCKSDB_NAMESPACE 17 | -------------------------------------------------------------------------------- /include/rocksdb/rocksdb_namespace.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | // For testing purposes 9 | #if ROCKSDB_NAMESPACE == 42 10 | #undef ROCKSDB_NAMESPACE 11 | #endif 12 | 13 | // Normal logic 14 | #ifndef ROCKSDB_NAMESPACE 15 | #define ROCKSDB_NAMESPACE rocksdb 16 | #endif 17 | -------------------------------------------------------------------------------- /table/table_properties_internal.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | #include "rocksdb/table_properties.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | #ifndef NDEBUG 12 | void TEST_SetRandomTableProperties(TableProperties* props); 13 | #endif 14 | } // namespace ROCKSDB_NAMESPACE 15 | -------------------------------------------------------------------------------- /include/rocksdb/cache_bench_tool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-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 | #pragma once 6 | 7 | #include "rocksdb/rocksdb_namespace.h" 8 | #include "rocksdb/status.h" 9 | #include "rocksdb/types.h" 10 | 11 | namespace ROCKSDB_NAMESPACE { 12 | 13 | int cache_bench_tool(int argc, char** argv); 14 | } // namespace ROCKSDB_NAMESPACE 15 | -------------------------------------------------------------------------------- /util/data_structure.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 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 | #include "rocksdb/data_structure.h" 7 | 8 | #include "util/math.h" 9 | 10 | namespace ROCKSDB_NAMESPACE::detail { 11 | 12 | int CountTrailingZeroBitsForSmallEnumSet(uint64_t v) { 13 | return CountTrailingZeroBits(v); 14 | } 15 | 16 | } // namespace ROCKSDB_NAMESPACE::detail 17 | -------------------------------------------------------------------------------- /cmake/modules/ReadVersion.cmake: -------------------------------------------------------------------------------- 1 | # Read rocksdb version from version.h header file. 2 | 3 | function(get_rocksdb_version version_var) 4 | file(READ "${CMAKE_CURRENT_SOURCE_DIR}/include/rocksdb/version.h" version_header_file) 5 | foreach(component MAJOR MINOR PATCH) 6 | string(REGEX MATCH "#define ROCKSDB_${component} ([0-9]+)" _ ${version_header_file}) 7 | set(ROCKSDB_VERSION_${component} ${CMAKE_MATCH_1}) 8 | endforeach() 9 | set(${version_var} "${ROCKSDB_VERSION_MAJOR}.${ROCKSDB_VERSION_MINOR}.${ROCKSDB_VERSION_PATCH}" PARENT_SCOPE) 10 | endfunction() 11 | -------------------------------------------------------------------------------- /docs/_includes/plugins/twitter_share.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 12 | -------------------------------------------------------------------------------- /include/rocksdb/sst_dump_tool.h: -------------------------------------------------------------------------------- 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 | #pragma once 6 | 7 | #include "rocksdb/options.h" 8 | 9 | namespace ROCKSDB_NAMESPACE { 10 | 11 | class SSTDumpTool { 12 | public: 13 | int Run(int argc, char const* const* argv, Options options = Options()); 14 | }; 15 | 16 | } // namespace ROCKSDB_NAMESPACE 17 | 18 | -------------------------------------------------------------------------------- /docs/_includes/plugins/twitter_follow.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | -------------------------------------------------------------------------------- /docs/_posts/2015-06-12-rocksdb-in-osquery.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: RocksDB in osquery 3 | layout: post 4 | author: icanadi 5 | category: lgalanis 6 | redirect_from: 7 | - /blog/1997/rocksdb-in-osquery/ 8 | --- 9 | 10 | Check out [this](https://code.facebook.com/posts/1411870269134471/how-rocksdb-is-used-in-osquery/) blog post by [Mike Arpaia](https://www.facebook.com/mike.arpaia) and [Ted Reed](https://www.facebook.com/treeded) about how osquery leverages RocksDB to build an embedded pub-sub system. This article is a great read and contains insights on how to properly use RocksDB. 11 | -------------------------------------------------------------------------------- /.github/workflows/benchmark-linux.yml: -------------------------------------------------------------------------------- 1 | name: facebook/rocksdb/benchmark-linux 2 | on: workflow_dispatch 3 | jobs: 4 | # FIXME: when this job is fixed, it should be given a cron schedule like 5 | # schedule: 6 | # - cron: 0 * * * * 7 | # workflow_dispatch: 8 | benchmark-linux: 9 | if: ${{ github.repository_owner == 'facebook' }} 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4.1.0 13 | - uses: "./.github/actions/build-for-benchmarks" 14 | - uses: "./.github/actions/perform-benchmarks" 15 | - uses: "./.github/actions/post-benchmarks" 16 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/AbstractTableFilter.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | package org.rocksdb; 3 | 4 | /** 5 | * Base class for Table Filters. 6 | */ 7 | public abstract class AbstractTableFilter 8 | extends RocksCallbackObject implements TableFilter { 9 | 10 | protected AbstractTableFilter() { 11 | super(); 12 | } 13 | 14 | @Override 15 | protected long initializeNative(final long... nativeParameterHandles) { 16 | return createNewTableFilter(); 17 | } 18 | 19 | private native long createNewTableFilter(); 20 | } 21 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/Range.java: -------------------------------------------------------------------------------- 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 | /** 9 | * Range from start to limit. 10 | */ 11 | public class Range { 12 | final Slice start; 13 | final Slice limit; 14 | 15 | public Range(final Slice start, final Slice limit) { 16 | this.start = start; 17 | this.limit = limit; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /db_stress_tool/db_stress_stat.cc: -------------------------------------------------------------------------------- 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 | #ifdef GFLAGS 7 | 8 | #include "db_stress_tool/db_stress_stat.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | std::shared_ptr dbstats; 13 | std::shared_ptr dbstats_secondaries; 14 | 15 | } // namespace ROCKSDB_NAMESPACE 16 | 17 | #endif // GFLAGS 18 | -------------------------------------------------------------------------------- /java/crossbuild/build-linux.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # install all required packages for rocksdb 4 | sudo apt-get update 5 | sudo apt-get -y install git make gcc g++ libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev default-jdk 6 | 7 | # set java home so we can build rocksdb jars 8 | export JAVA_HOME=$(echo /usr/lib/jvm/java-7-openjdk*) 9 | cd /rocksdb 10 | make jclean clean 11 | make -j 4 rocksdbjavastatic 12 | cp /rocksdb/java/target/librocksdbjni-* /rocksdb-build 13 | cp /rocksdb/java/target/rocksdbjni-* /rocksdb-build 14 | sudo shutdown -h now 15 | 16 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/util/ByteBufferAllocator.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | package org.rocksdb.util; 8 | 9 | import java.nio.ByteBuffer; 10 | 11 | public interface ByteBufferAllocator { 12 | ByteBuffer allocate(int capacity); 13 | 14 | ByteBufferAllocator DIRECT = new DirectByteBufferAllocator(); 15 | ByteBufferAllocator HEAP = new HeapByteBufferAllocator(); 16 | } 17 | -------------------------------------------------------------------------------- /tools/trace_analyzer.cc: -------------------------------------------------------------------------------- 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 | #ifndef GFLAGS 7 | #include 8 | int main() { 9 | fprintf(stderr, "Please install gflags to run rocksdb tools\n"); 10 | return 1; 11 | } 12 | #else 13 | #include "tools/trace_analyzer_tool.h" 14 | int main(int argc, char** argv) { 15 | return ROCKSDB_NAMESPACE::trace_analyzer_tool(argc, argv); 16 | } 17 | #endif 18 | -------------------------------------------------------------------------------- /db/db_info_dumper.h: -------------------------------------------------------------------------------- 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 | #pragma once 6 | 7 | #include 8 | 9 | #include "options/db_options.h" 10 | 11 | namespace ROCKSDB_NAMESPACE { 12 | void DumpDBFileSummary(const ImmutableDBOptions& options, 13 | const std::string& dbname, 14 | const std::string& session_id = ""); 15 | } // namespace ROCKSDB_NAMESPACE 16 | -------------------------------------------------------------------------------- /db_stress_tool/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(db_stress${ARTIFACT_SUFFIX} 2 | batched_ops_stress.cc 3 | cf_consistency_stress.cc 4 | db_stress.cc 5 | db_stress_common.cc 6 | db_stress_driver.cc 7 | db_stress_gflags.cc 8 | db_stress_listener.cc 9 | db_stress_shared_state.cc 10 | db_stress_stat.cc 11 | db_stress_test_base.cc 12 | db_stress_wide_merge_operator.cc 13 | db_stress_tool.cc 14 | expected_state.cc 15 | expected_value.cc 16 | multi_ops_txns_stress.cc 17 | no_batched_ops_stress.cc) 18 | target_link_libraries(db_stress${ARTIFACT_SUFFIX} ${ROCKSDB_LIB} ${THIRDPARTY_LIBS}) 19 | list(APPEND tool_deps db_stress) 20 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/SstPartitionerFactory.java: -------------------------------------------------------------------------------- 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 | /** 9 | * Handle to factory for SstPartitioner. It is used in {@link ColumnFamilyOptions} 10 | */ 11 | public abstract class SstPartitionerFactory extends RocksObject { 12 | protected SstPartitionerFactory(final long nativeHandle) { 13 | super(nativeHandle); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/util/SizeUnit.java: -------------------------------------------------------------------------------- 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.util; 7 | 8 | public class SizeUnit { 9 | public static final long KB = 1024L; 10 | public static final long MB = KB * KB; 11 | public static final long GB = KB * MB; 12 | public static final long TB = KB * GB; 13 | public static final long PB = KB * TB; 14 | 15 | private SizeUnit() {} 16 | } 17 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/RocksNativeLibraryResource.java: -------------------------------------------------------------------------------- 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 org.junit.rules.ExternalResource; 9 | 10 | /** 11 | * Resource to load the RocksDB JNI library. 12 | */ 13 | public class RocksNativeLibraryResource extends ExternalResource { 14 | @Override 15 | protected void before() { 16 | RocksDB.loadLibrary(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /tools/io_tracer_parser.cc: -------------------------------------------------------------------------------- 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 | #ifndef GFLAGS 7 | #include 8 | int main() { 9 | fprintf(stderr, "Please install gflags to run rocksdb tools\n"); 10 | return 1; 11 | } 12 | #else // GFLAGS 13 | #include "tools/io_tracer_parser_tool.h" 14 | int main(int argc, char** argv) { 15 | return ROCKSDB_NAMESPACE::io_tracer_parser(argc, argv); 16 | } 17 | #endif // GFLAGS 18 | -------------------------------------------------------------------------------- /util/crc32c_ppc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | // Copyright (c) 2017 International Business Machines Corp. 3 | // All rights reserved. 4 | // This source code is licensed under both the GPLv2 (found in the 5 | // COPYING file in the root directory) and Apache 2.0 License 6 | // (found in the LICENSE.Apache file in the root directory). 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | uint32_t crc32c_ppc(uint32_t crc, unsigned char const *buffer, size_t len); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/util/HeapByteBufferAllocator.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | package org.rocksdb.util; 8 | 9 | import java.nio.ByteBuffer; 10 | 11 | public final class HeapByteBufferAllocator implements ByteBufferAllocator { 12 | HeapByteBufferAllocator(){}; 13 | 14 | @Override 15 | public ByteBuffer allocate(final int capacity) { 16 | return ByteBuffer.allocate(capacity); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/workflows/nightly-candidate.yml: -------------------------------------------------------------------------------- 1 | name: facebook/rocksdb/nightly 2 | on: workflow_dispatch 3 | jobs: 4 | # These jobs would be in nightly but are failing or otherwise broken for 5 | # some reason. 6 | build-linux-arm-test-full: 7 | if: ${{ github.repository_owner == 'facebook' }} 8 | runs-on: 9 | labels: arm64large 10 | container: 11 | image: ubuntu-2004:202111-02 12 | options: --shm-size=16gb 13 | steps: 14 | - uses: actions/checkout@v4.1.0 15 | - uses: "./.github/actions/pre-steps" 16 | - uses: "./.github/actions/install-gflags" 17 | - run: make V=1 J=4 -j4 check 18 | - uses: "./.github/actions/post-steps" 19 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/util/DirectByteBufferAllocator.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | package org.rocksdb.util; 8 | 9 | import java.nio.ByteBuffer; 10 | 11 | public final class DirectByteBufferAllocator implements ByteBufferAllocator { 12 | DirectByteBufferAllocator(){}; 13 | 14 | @Override 15 | public ByteBuffer allocate(final int capacity) { 16 | return ByteBuffer.allocateDirect(capacity); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/ExportImportFilesMetaData.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | package org.rocksdb; 8 | 9 | /** 10 | * The metadata that describes a column family. 11 | */ 12 | public class ExportImportFilesMetaData extends RocksObject { 13 | ExportImportFilesMetaData(final long nativeHandle) { 14 | super(nativeHandle); 15 | } 16 | 17 | @Override protected native void disposeInternal(final long handle); 18 | } 19 | -------------------------------------------------------------------------------- /cache/cache_entry_roles.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 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 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | #include "rocksdb/cache.h" 12 | 13 | namespace ROCKSDB_NAMESPACE { 14 | 15 | extern std::array 16 | kCacheEntryRoleToCamelString; 17 | extern std::array 18 | kCacheEntryRoleToHyphenString; 19 | 20 | } // namespace ROCKSDB_NAMESPACE 21 | -------------------------------------------------------------------------------- /tools/write_external_sst.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # 4 | # 5 | 6 | if [ "$#" -lt 3 ]; then 7 | echo "usage: $BASH_SOURCE " 8 | exit 1 9 | fi 10 | 11 | input_data_dir=$1 12 | db_dir=$2 13 | extern_sst_dir=$3 14 | rm -rf $db_dir 15 | mkdir -p $extern_sst_dir 16 | 17 | set -e 18 | 19 | n=0 20 | 21 | for f in `find $input_data_dir -name sorted_data*` 22 | do 23 | echo == Writing external SST file $f to $extern_sst_dir/extern_sst${n} 24 | ./ldb --db=$db_dir --create_if_missing write_extern_sst $extern_sst_dir/extern_sst${n} < $f 25 | let "n = n + 1" 26 | done 27 | -------------------------------------------------------------------------------- /docs/_includes/plugins/like_button.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /include/rocksdb/utilities/info_log_finder.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | #include "rocksdb/db.h" 12 | #include "rocksdb/options.h" 13 | 14 | namespace ROCKSDB_NAMESPACE { 15 | 16 | // This function can be used to list the Information logs, 17 | // given the db pointer. 18 | Status GetInfoLogList(DB* db, std::vector* info_log_list); 19 | } // namespace ROCKSDB_NAMESPACE 20 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/util/BufferUtil.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | package org.rocksdb.util; 8 | 9 | public class BufferUtil { 10 | public static void CheckBounds(final int offset, final int len, final int size) { 11 | if ((offset | len | (offset + len) | (size - (offset + len))) < 0) { 12 | throw new IndexOutOfBoundsException( 13 | String.format("offset(%d), len(%d), size(%d)", offset, len, size)); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs/_posts/2014-05-22-rocksdb-3-1-release.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: RocksDB 3.1 release 3 | layout: post 4 | author: icanadi 5 | category: blog 6 | redirect_from: 7 | - /blog/575/rocksdb-3-1-release/ 8 | --- 9 | 10 | Check out the new release on [Github](https://github.com/facebook/rocksdb/releases/tag/rocksdb-3.1)! 11 | 12 | New features in RocksDB 3.1: 13 | 14 | * [Materialized hash index](https://github.com/facebook/rocksdb/commit/0b3d03d026a7248e438341264b4c6df339edc1d7) 15 | 16 | 17 | * [FIFO compaction style](https://github.com/facebook/rocksdb/wiki/FIFO-compaction-style) 18 | 19 | 20 | We released 3.1 so fast after 3.0 because one of our internal customers needed materialized hash index. 21 | -------------------------------------------------------------------------------- /docs/_top-level/support.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: top-level 3 | title: Support 4 | id: support 5 | category: support 6 | --- 7 | 8 | ## Need help? 9 | 10 | Do not hesitate to ask questions if you are having trouble with RocksDB. 11 | 12 | ### GitHub issues 13 | 14 | Use [GitHub issues](https://github.com/facebook/rocksdb/issues) to report bugs, issues and feature requests for the RocksDB codebase. 15 | 16 | ### Facebook Group 17 | 18 | Use the [RocksDB Facebook group](https://www.facebook.com/groups/rocksdb.dev/) for general questions and discussion about RocksDB. 19 | 20 | ### FAQ 21 | 22 | Check out a list of [commonly asked questions](https://github.com/facebook/rocksdb/wiki/RocksDB-FAQ) about RocksDB. 23 | -------------------------------------------------------------------------------- /.github/actions/post-benchmarks/action.yml: -------------------------------------------------------------------------------- 1 | name: post-benchmarks 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Upload Benchmark Results artifact 6 | uses: actions/upload-artifact@v4.0.0 7 | with: 8 | name: benchmark-results 9 | path: "${{ runner.temp }}/benchmark-results/**" 10 | if-no-files-found: error 11 | - name: Send benchmark report to visualisation 12 | run: |- 13 | set +e 14 | set +o pipefail 15 | ./build_tools/benchmark_log_tool.py --tsvfile ${{ runner.temp }}/benchmark-results/report.tsv --esdocument https://search-rocksdb-bench-k2izhptfeap2hjfxteolsgsynm.us-west-2.es.amazonaws.com/bench_test3_rix/_doc 16 | true 17 | shell: bash 18 | -------------------------------------------------------------------------------- /.github/actions/setup-upstream/action.yml: -------------------------------------------------------------------------------- 1 | name: build-folly 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Fix repo ownership 6 | # Needed in some cases, as safe.directory setting doesn't take effect 7 | # under env -i 8 | run: chown `whoami` . || true 9 | shell: bash 10 | - name: Set upstream 11 | run: git remote add upstream https://github.com/facebook/rocksdb.git 12 | shell: bash 13 | - name: Fetch upstream 14 | run: git fetch upstream 15 | shell: bash 16 | - name: Git status 17 | # NOTE: some old branch builds under check_format_compatible.sh invoke 18 | # git under env -i 19 | run: git status && git remote -v && env -i git branch 20 | shell: bash 21 | -------------------------------------------------------------------------------- /tools/block_cache_analyzer/block_cache_trace_analyzer_tool.cc: -------------------------------------------------------------------------------- 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 | #ifndef GFLAGS 7 | #include 8 | int main() { 9 | fprintf(stderr, "Please install gflags to run rocksdb tools\n"); 10 | return 1; 11 | } 12 | #else // GFLAGS 13 | #include "tools/block_cache_analyzer/block_cache_trace_analyzer.h" 14 | int main(int argc, char** argv) { 15 | return ROCKSDB_NAMESPACE::block_cache_trace_analyzer_tool(argc, argv); 16 | } 17 | #endif // GFLAGS 18 | -------------------------------------------------------------------------------- /db/malloc_stats.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #pragma once 11 | 12 | 13 | #include 14 | 15 | #include "rocksdb/rocksdb_namespace.h" 16 | 17 | namespace ROCKSDB_NAMESPACE { 18 | 19 | void DumpMallocStats(std::string*); 20 | 21 | } 22 | 23 | -------------------------------------------------------------------------------- /port/malloc.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | #pragma once 10 | 11 | #ifdef ROCKSDB_MALLOC_USABLE_SIZE 12 | #ifdef OS_FREEBSD 13 | #include 14 | #else 15 | #include 16 | #endif // OS_FREEBSD 17 | #endif // ROCKSDB_MALLOC_USABLE_SIZE 18 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/BuiltinComparator.java: -------------------------------------------------------------------------------- 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 | /** 9 | * Builtin RocksDB comparators 10 | * 11 | *
    12 | *
  1. BYTEWISE_COMPARATOR - Sorts all keys in ascending bytewise 13 | * order.
  2. 14 | *
  3. REVERSE_BYTEWISE_COMPARATOR - Sorts all keys in descending bytewise 15 | * order
  4. 16 | *
17 | */ 18 | public enum BuiltinComparator { 19 | BYTEWISE_COMPARATOR, REVERSE_BYTEWISE_COMPARATOR 20 | } 21 | -------------------------------------------------------------------------------- /monitoring/perf_level.cc: -------------------------------------------------------------------------------- 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 | 7 | #include 8 | 9 | #include "monitoring/perf_level_imp.h" 10 | 11 | namespace ROCKSDB_NAMESPACE { 12 | 13 | thread_local PerfLevel perf_level = kEnableCount; 14 | 15 | void SetPerfLevel(PerfLevel level) { 16 | assert(level > kUninitialized); 17 | assert(level < kOutOfBounds); 18 | perf_level = level; 19 | } 20 | 21 | PerfLevel GetPerfLevel() { return perf_level; } 22 | 23 | } // namespace ROCKSDB_NAMESPACE 24 | -------------------------------------------------------------------------------- /include/rocksdb/port_defs.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 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 | // This file includes the common definitions used in the port/, 7 | // the public API (this directory), and other directories 8 | 9 | #pragma once 10 | 11 | #include "rocksdb/rocksdb_namespace.h" 12 | 13 | namespace ROCKSDB_NAMESPACE { 14 | 15 | namespace port { 16 | class CondVar; 17 | } 18 | 19 | enum class CpuPriority { 20 | kIdle = 0, 21 | kLow = 1, 22 | kNormal = 2, 23 | kHigh = 3, 24 | }; 25 | 26 | } // namespace ROCKSDB_NAMESPACE 27 | -------------------------------------------------------------------------------- /docs/_layouts/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 |
5 |
6 | Support Ukraine 🇺🇦 7 | 8 | Help Provide Humanitarian Aid to Ukraine 9 | 10 | . 11 |
12 |
13 | 14 | {% include nav.html alwayson=true %} 15 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /port/xpress.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #pragma once 11 | 12 | // Xpress on Windows is implemeted using Win API 13 | #if defined(ROCKSDB_PLATFORM_POSIX) 14 | #error "Xpress compression not implemented" 15 | #elif defined(OS_WIN) 16 | #include "port/win/xpress_win.h" 17 | #endif 18 | -------------------------------------------------------------------------------- /tools/advisor/test/input_files/log_stats_parser_keys_ts: -------------------------------------------------------------------------------- 1 | rocksdb.number.block.decompressed.count: 1530896335 88.0, 1530896361 788338.0, 1530896387 1539256.0, 1530896414 2255696.0, 1530896440 3009325.0, 1530896466 3767183.0, 1530896492 4529775.0, 1530896518 5297809.0, 1530896545 6033802.0, 1530896570 6794129.0 2 | rocksdb.db.get.micros.p50: 1530896335 295.5, 1530896361 16.561841, 1530896387 16.20677, 1530896414 16.31508, 1530896440 16.346602, 1530896466 16.284669, 1530896492 16.16005, 1530896518 16.069096, 1530896545 16.028746, 1530896570 15.9638 3 | rocksdb.manifest.file.sync.micros.p99: 1530896335 649.0, 1530896361 835.0, 1530896387 1435.0, 1530896414 9938.0, 1530896440 9938.0, 1530896466 9938.0, 1530896492 9938.0, 1530896518 1882.0, 1530896545 1837.0, 1530896570 1792.0 4 | -------------------------------------------------------------------------------- /docs/_posts/2017-02-07-rocksdb-5-1-2-released.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: RocksDB 5.1.2 Released! 3 | layout: post 4 | author: maysamyabandeh 5 | category: blog 6 | --- 7 | 8 | ### Public API Change 9 | * Support dynamically change `delete_obsolete_files_period_micros` option via SetDBOptions(). 10 | * Added EventListener::OnExternalFileIngested which will be called when IngestExternalFile() add a file successfully. 11 | * BackupEngine::Open and BackupEngineReadOnly::Open now always return error statuses matching those of the backup Env. 12 | 13 | ### Bug Fixes 14 | * Fix the bug that if 2PC is enabled, checkpoints may loss some recent transactions. 15 | * When file copying is needed when creating checkpoints or bulk loading files, fsync the file after the file copying. 16 | -------------------------------------------------------------------------------- /port/likely.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #pragma once 11 | 12 | #if defined(__GNUC__) && __GNUC__ >= 4 13 | #define LIKELY(x) (__builtin_expect((x), 1)) 14 | #define UNLIKELY(x) (__builtin_expect((x), 0)) 15 | #else 16 | #define LIKELY(x) (x) 17 | #define UNLIKELY(x) (x) 18 | #endif 19 | -------------------------------------------------------------------------------- /docs/_includes/nav/collection_nav_group.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/doc-type-examples/2016-04-07-blog-post-example.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Blog Post Example 3 | layout: post 4 | author: exampleauthor 5 | category: blog 6 | --- 7 | 8 | Any local blog posts would go in the `_posts` directory. 9 | 10 | This is an example blog post introduction, try to keep it short and about a paragraph long, to encourage people to click through to read the entire post. 11 | 12 | 13 | 14 | Everything below the `` tag will only show on the actual blog post page, not on the `/blog/` index. 15 | 16 | Author is defined in `_data/authors.yml` 17 | 18 | 19 | ## No posts? 20 | 21 | If you have no blog for your site, you can remove the entire `_posts` folder. Otherwise add markdown files in here. See CONTRIBUTING.md for details. 22 | -------------------------------------------------------------------------------- /db/convenience_impl.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | #include "rocksdb/db.h" 8 | 9 | namespace ROCKSDB_NAMESPACE { 10 | Status VerifySstFileChecksumInternal(const Options& options, 11 | const EnvOptions& env_options, 12 | const ReadOptions& read_options, 13 | const std::string& file_path, 14 | const SequenceNumber& largest_seqno = 0); 15 | } // namespace ROCKSDB_NAMESPACE 16 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/RemoveEmptyValueCompactionFilter.java: -------------------------------------------------------------------------------- 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 | /** 9 | * Just a Java wrapper around EmptyValueCompactionFilter implemented in C++ 10 | */ 11 | public class RemoveEmptyValueCompactionFilter 12 | extends AbstractCompactionFilter { 13 | public RemoveEmptyValueCompactionFilter() { 14 | super(createNewRemoveEmptyValueCompactionFilter0()); 15 | } 16 | 17 | private static native long createNewRemoveEmptyValueCompactionFilter0(); 18 | } 19 | -------------------------------------------------------------------------------- /db/wide/wide_columns.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 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 | #include "rocksdb/wide_columns.h" 7 | 8 | #include "db/wide/wide_column_serialization.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | const Slice kDefaultWideColumnName; 13 | 14 | const WideColumns kNoWideColumns; 15 | const AttributeGroups kNoAttributeGroups; 16 | 17 | Status PinnableWideColumns::CreateIndexForWideColumns() { 18 | Slice value_copy = value_; 19 | 20 | return WideColumnSerialization::Deserialize(value_copy, columns_); 21 | } 22 | 23 | } // namespace ROCKSDB_NAMESPACE 24 | -------------------------------------------------------------------------------- /db_stress_tool/db_stress_shared_state.cc: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | // 10 | 11 | #ifdef GFLAGS 12 | #include "db_stress_tool/db_stress_shared_state.h" 13 | 14 | namespace ROCKSDB_NAMESPACE { 15 | thread_local bool SharedState::ignore_read_error; 16 | } // namespace ROCKSDB_NAMESPACE 17 | #endif // GFLAGS 18 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/MergeOperator.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | // Copyright (c) 2014, Vlad Balan (vlad.gm@gmail.com). All rights reserved. 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | package org.rocksdb; 8 | 9 | /** 10 | * MergeOperator holds an operator to be applied when compacting 11 | * two merge operands held under the same key in order to obtain a single 12 | * value. 13 | */ 14 | public abstract class MergeOperator extends RocksObject { 15 | protected MergeOperator(final long nativeHandle) { 16 | super(nativeHandle); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/StatsCallbackMock.java: -------------------------------------------------------------------------------- 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 | public class StatsCallbackMock implements StatisticsCollectorCallback { 9 | public int tickerCallbackCount = 0; 10 | public int histCallbackCount = 0; 11 | 12 | public void tickerCallback(final TickerType tickerType, final long tickerCount) { 13 | tickerCallbackCount++; 14 | } 15 | 16 | public void histogramCallback(final HistogramType histType, final HistogramData histData) { 17 | histCallbackCount++; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /java/rocksjni/table_properties_collector_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | // 7 | #include "rocksdb/table_properties.h" 8 | #include "rocksdb/utilities/table_properties_collectors.h" 9 | 10 | #ifndef ROCKSDB_TABLE_PROPERTIES_COLLECTOR_FACTORY_H 11 | #define ROCKSDB_TABLE_PROPERTIES_COLLECTOR_FACTORY_H 12 | 13 | struct TablePropertiesCollectorFactoriesJniWrapper { 14 | std::shared_ptr 15 | table_properties_collector_factories; 16 | }; 17 | #endif // ROCKSDB_TABLE_PROPERTIES_COLLECTOR_FACTORY_H 18 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/WALRecoveryModeTest.java: -------------------------------------------------------------------------------- 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 org.junit.Test; 9 | 10 | import static org.assertj.core.api.Assertions.assertThat; 11 | 12 | 13 | public class WALRecoveryModeTest { 14 | 15 | @Test 16 | public void getWALRecoveryMode() { 17 | for (final WALRecoveryMode walRecoveryMode : WALRecoveryMode.values()) { 18 | assertThat(WALRecoveryMode.getWALRecoveryMode(walRecoveryMode.getValue())) 19 | .isEqualTo(walRecoveryMode); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/ClockCacheTest.java: -------------------------------------------------------------------------------- 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 org.junit.Test; 9 | 10 | public class ClockCacheTest { 11 | 12 | static { 13 | RocksDB.loadLibrary(); 14 | } 15 | 16 | @Test 17 | public void newClockCache() { 18 | final long capacity = 1000; 19 | final int numShardBits = 16; 20 | final boolean strictCapacityLimit = true; 21 | try (final Cache ignored = new ClockCache(capacity, numShardBits, strictCapacityLimit)) { 22 | //no op 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs/_posts/2014-05-19-rocksdb-3-0-release.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: RocksDB 3.0 release 3 | layout: post 4 | author: icanadi 5 | category: blog 6 | redirect_from: 7 | - /blog/557/rocksdb-3-0-release/ 8 | --- 9 | 10 | Check out new RocksDB release on [Github](https://github.com/facebook/rocksdb/releases/tag/3.0.fb)! 11 | 12 | New features in RocksDB 3.0: 13 | 14 | * [Column Family support](https://github.com/facebook/rocksdb/wiki/Column-Families) 15 | 16 | 17 | * [Ability to chose different checksum function](https://github.com/facebook/rocksdb/commit/0afc8bc29a5800e3212388c327c750d32e31f3d6) 18 | 19 | 20 | * Deprecated ReadOptions::prefix_seek and ReadOptions::prefix 21 | 22 | 23 | 24 | Check out the full [change log](https://github.com/facebook/rocksdb/blob/3.0.fb/HISTORY.md). 25 | -------------------------------------------------------------------------------- /util/overload.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 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 | #pragma once 7 | 8 | #include "rocksdb/rocksdb_namespace.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | // A helper template that can combine multiple functors into a single one to be 13 | // used with std::visit for example. It also works with lambdas, since it 14 | // comes with an explicit deduction guide. 15 | template 16 | struct overload : Ts... { 17 | using Ts::operator()...; 18 | }; 19 | 20 | template 21 | overload(Ts...) -> overload; 22 | 23 | } // namespace ROCKSDB_NAMESPACE 24 | -------------------------------------------------------------------------------- /.github/actions/perform-benchmarks/action.yml: -------------------------------------------------------------------------------- 1 | name: perform-benchmarks 2 | runs: 3 | using: composite 4 | steps: 5 | - name: Test low-variance benchmarks 6 | run: "./tools/benchmark_ci.py --db_dir ${{ runner.temp }}/rocksdb-benchmark-datadir --output_dir ${{ runner.temp }}/benchmark-results --num_keys 20000000" 7 | env: 8 | LD_LIBRARY_PATH: "/usr/local/lib" 9 | DURATION_RO: 300 10 | DURATION_RW: 500 11 | NUM_THREADS: 1 12 | MAX_BACKGROUND_JOBS: 4 13 | CI_TESTS_ONLY: 'true' 14 | WRITE_BUFFER_SIZE_MB: 16 15 | TARGET_FILE_SIZE_BASE_MB: 16 16 | MAX_BYTES_FOR_LEVEL_BASE_MB: 64 17 | COMPRESSION_TYPE: none 18 | CACHE_INDEX_AND_FILTER_BLOCKS: 1 19 | MIN_LEVEL_TO_COMPRESS: 3 20 | CACHE_SIZE_MB: 10240 21 | MB_WRITE_PER_SEC: 2 22 | shell: bash 23 | -------------------------------------------------------------------------------- /DUMP_FORMAT.md: -------------------------------------------------------------------------------- 1 | ## RocksDB dump format 2 | 3 | The version 1 RocksDB dump format is fairly simple: 4 | 5 | 1) The dump starts with the magic 8 byte identifier "ROCKDUMP" 6 | 7 | 2) The magic is followed by an 8 byte big-endian version which is 0x00000001. 8 | 9 | 3) Next are arbitrarily sized chunks of bytes prepended by 4 byte little endian number indicating how large each chunk is. 10 | 11 | 4) The first chunk is special and is a json string indicating some things about the creation of this dump. It contains the following keys: 12 | * database-path: The path of the database this dump was created from. 13 | * hostname: The hostname of the machine where the dump was created. 14 | * creation-time: Unix seconds since epoc when this dump was created. 15 | 16 | 5) Following the info dump the slices paired into are key/value pairs. 17 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/TableFilter.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | package org.rocksdb; 3 | 4 | /** 5 | * Filter for iterating a table. 6 | */ 7 | public interface TableFilter { 8 | 9 | /** 10 | * A callback to determine whether relevant keys for this scan exist in a 11 | * given table based on the table's properties. The callback is passed the 12 | * properties of each table during iteration. If the callback returns false, 13 | * the table will not be scanned. This option only affects Iterators and has 14 | * no impact on point lookups. 15 | * 16 | * @param tableProperties the table properties. 17 | * 18 | * @return true if the table should be scanned, false otherwise. 19 | */ 20 | boolean filter(final TableProperties tableProperties); 21 | } 22 | -------------------------------------------------------------------------------- /port/util_logger.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #pragma once 11 | 12 | // Include the appropriate platform specific file below. If you are 13 | // porting to a new platform, see "port_example.h" for documentation 14 | // of what the new port_.h file must provide. 15 | 16 | #if defined(OS_WIN) 17 | #include "port/win/win_logger.h" 18 | #endif 19 | -------------------------------------------------------------------------------- /docs/_posts/2016-02-25-rocksdb-ama.markdown: -------------------------------------------------------------------------------- 1 | --- 2 | title: RocksDB AMA 3 | layout: post 4 | author: yhchiang 5 | category: blog 6 | redirect_from: 7 | - /blog/3065/rocksdb-ama/ 8 | --- 9 | 10 | RocksDB developers are doing a Reddit Ask-Me-Anything now at 10AM – 11AM PDT! We welcome you to stop by and ask any RocksDB related questions, including existing / upcoming features, tuning tips, or database design. 11 | 12 | Here are some enhancements that we'd like to focus on over the next six months: 13 | 14 | * 2-Phase Commit 15 | * Lua support in some custom functions 16 | * Backup and repair tools 17 | * Direct I/O to bypass OS cache 18 | * RocksDB Java API 19 | 20 | [https://www.reddit.com/r/IAmA/comments/47k1si/we_are_rocksdb_developers_ask_us_anything/](https://www.reddit.com/r/IAmA/comments/47k1si/we_are_rocksdb_developers_ask_us_anything/) 21 | -------------------------------------------------------------------------------- /fuzz/proto/db_operation.proto: -------------------------------------------------------------------------------- 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 | // Defines database operations. 7 | // Each operation is a key-value pair and an operation type. 8 | 9 | syntax = "proto2"; 10 | 11 | enum OpType { 12 | PUT = 0; 13 | MERGE = 1; 14 | DELETE = 2; 15 | DELETE_RANGE = 3; 16 | } 17 | 18 | message DBOperation { 19 | required string key = 1; 20 | // value is ignored for DELETE. 21 | // [key, value] is the range for DELETE_RANGE. 22 | optional string value = 2; 23 | required OpType type = 3; 24 | } 25 | 26 | message DBOperations { 27 | repeated DBOperation operations = 1; 28 | } 29 | -------------------------------------------------------------------------------- /tools/db_bench.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #ifndef GFLAGS 11 | #include 12 | int main() { 13 | fprintf(stderr, "Please install gflags to run rocksdb tools\n"); 14 | return 1; 15 | } 16 | #else 17 | #include "rocksdb/db_bench_tool.h" 18 | int main(int argc, char** argv) { 19 | return ROCKSDB_NAMESPACE::db_bench_tool(argc, argv); 20 | } 21 | #endif // GFLAGS 22 | -------------------------------------------------------------------------------- /cache/cache_bench.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | #ifndef GFLAGS 10 | #include 11 | int main() { 12 | fprintf(stderr, "Please install gflags to run rocksdb tools\n"); 13 | return 1; 14 | } 15 | #else 16 | #include "rocksdb/cache_bench_tool.h" 17 | int main(int argc, char** argv) { 18 | return ROCKSDB_NAMESPACE::cache_bench_tool(argc, argv); 19 | } 20 | #endif // GFLAGS 21 | -------------------------------------------------------------------------------- /db/snapshot_impl.cc: -------------------------------------------------------------------------------- 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 | #include "rocksdb/db.h" 7 | #include "rocksdb/snapshot.h" 8 | 9 | namespace ROCKSDB_NAMESPACE { 10 | 11 | ManagedSnapshot::ManagedSnapshot(DB* db) 12 | : db_(db), snapshot_(db->GetSnapshot()) {} 13 | 14 | ManagedSnapshot::ManagedSnapshot(DB* db, const Snapshot* _snapshot) 15 | : db_(db), snapshot_(_snapshot) {} 16 | 17 | ManagedSnapshot::~ManagedSnapshot() { 18 | if (snapshot_) { 19 | db_->ReleaseSnapshot(snapshot_); 20 | } 21 | } 22 | 23 | const Snapshot* ManagedSnapshot::snapshot() { return snapshot_; } 24 | 25 | } // namespace ROCKSDB_NAMESPACE 26 | -------------------------------------------------------------------------------- /db_stress_tool/db_stress_driver.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #include "db_stress_tool/db_stress_shared_state.h" 11 | #ifdef GFLAGS 12 | #pragma once 13 | #include "db_stress_tool/db_stress_test_base.h" 14 | namespace ROCKSDB_NAMESPACE { 15 | void ThreadBody(void* /*thread_state*/); 16 | bool RunStressTest(SharedState*); 17 | } // namespace ROCKSDB_NAMESPACE 18 | #endif // GFLAGS 19 | -------------------------------------------------------------------------------- /microbench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_package(benchmark REQUIRED) 2 | find_package(Threads REQUIRED) 3 | 4 | file(GLOB_RECURSE ALL_BENCH_CPP *.cc) 5 | foreach(ONE_BENCH_CPP ${ALL_BENCH_CPP}) 6 | get_filename_component(TARGET_NAME ${ONE_BENCH_CPP} NAME_WE) 7 | add_executable(${TARGET_NAME} ${ONE_BENCH_CPP}) 8 | target_link_libraries(${TARGET_NAME} ${ROCKSDB_LIB} benchmark::benchmark 9 | ${CMAKE_THREAD_LIBS_INIT}) 10 | # run benchmark like a test, if added, the benchmark tests could be run by `ctest -R Bench_` 11 | # add_test(Bench_${TARGET_NAME} ${TARGET_NAME}) 12 | list(APPEND ALL_BENCH_TARGETS ${TARGET_NAME}) 13 | endforeach() 14 | add_custom_target(microbench DEPENDS ${ALL_BENCH_TARGETS}) 15 | add_custom_target(run_microbench 16 | COMMAND for t in ${ALL_BENCH_TARGETS}\; do \.\/$$t \|\| exit 1\; done 17 | DEPENDS ${ALL_BENCH_TARGETS}) 18 | -------------------------------------------------------------------------------- /util/write_batch_util.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | #include "util/write_batch_util.h" 8 | 9 | namespace ROCKSDB_NAMESPACE { 10 | 11 | Status CollectColumnFamilyIdsFromWriteBatch( 12 | const WriteBatch& batch, std::vector* column_family_ids) { 13 | assert(column_family_ids != nullptr); 14 | column_family_ids->clear(); 15 | ColumnFamilyCollector handler; 16 | Status s = batch.Iterate(&handler); 17 | if (s.ok()) { 18 | for (const auto& cf : handler.column_families()) { 19 | column_family_ids->push_back(cf); 20 | } 21 | } 22 | return s; 23 | } 24 | 25 | } // namespace ROCKSDB_NAMESPACE 26 | -------------------------------------------------------------------------------- /cmake/modules/Finduring.cmake: -------------------------------------------------------------------------------- 1 | # - Find liburing 2 | # 3 | # uring_INCLUDE_DIR - Where to find liburing.h 4 | # uring_LIBRARIES - List of libraries when using uring. 5 | # uring_FOUND - True if uring found. 6 | 7 | find_path(uring_INCLUDE_DIR 8 | NAMES liburing.h) 9 | find_library(uring_LIBRARIES 10 | NAMES liburing.a liburing) 11 | 12 | include(FindPackageHandleStandardArgs) 13 | find_package_handle_standard_args(uring 14 | DEFAULT_MSG uring_LIBRARIES uring_INCLUDE_DIR) 15 | 16 | mark_as_advanced( 17 | uring_INCLUDE_DIR 18 | uring_LIBRARIES) 19 | 20 | if(uring_FOUND AND NOT TARGET uring::uring) 21 | add_library(uring::uring UNKNOWN IMPORTED) 22 | set_target_properties(uring::uring PROPERTIES 23 | INTERFACE_INCLUDE_DIRECTORIES "${uring_INCLUDE_DIR}" 24 | IMPORTED_LINK_INTERFACE_LANGUAGES "C" 25 | IMPORTED_LOCATION "${uring_LIBRARIES}") 26 | endif() 27 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/DataBlockIndexType.java: -------------------------------------------------------------------------------- 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 | 9 | /** 10 | * DataBlockIndexType used in conjunction with BlockBasedTable. 11 | */ 12 | public enum DataBlockIndexType { 13 | /** 14 | * traditional block type 15 | */ 16 | kDataBlockBinarySearch((byte)0x0), 17 | 18 | /** 19 | * additional hash index 20 | */ 21 | kDataBlockBinaryAndHash((byte)0x1); 22 | 23 | private final byte value; 24 | 25 | DataBlockIndexType(final byte value) { 26 | this.value = value; 27 | } 28 | 29 | byte getValue() { 30 | return value; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/SizeApproximationFlag.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | package org.rocksdb; 3 | 4 | import java.util.List; 5 | 6 | /** 7 | * Flags for 8 | * {@link RocksDB#getApproximateSizes(ColumnFamilyHandle, List, SizeApproximationFlag...)} 9 | * that specify whether memtable stats should be included, 10 | * or file stats approximation or both. 11 | */ 12 | public enum SizeApproximationFlag { 13 | NONE((byte)0x0), 14 | INCLUDE_MEMTABLES((byte)0x1), 15 | INCLUDE_FILES((byte)0x2); 16 | 17 | private final byte value; 18 | 19 | SizeApproximationFlag(final byte value) { 20 | this.value = value; 21 | } 22 | 23 | /** 24 | * Get the internal byte representation. 25 | * 26 | * @return the internal representation. 27 | */ 28 | byte getValue() { 29 | return value; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/test/TestableEventListener.java: -------------------------------------------------------------------------------- 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 | package org.rocksdb.test; 6 | 7 | import org.rocksdb.AbstractEventListener; 8 | 9 | public class TestableEventListener extends AbstractEventListener { 10 | public TestableEventListener() { 11 | super(); 12 | } 13 | 14 | public TestableEventListener(final EnabledEventCallback... enabledEventCallbacks) { 15 | super(enabledEventCallbacks); 16 | } 17 | 18 | public void invokeAllCallbacks() { 19 | invokeAllCallbacks(nativeHandle_); 20 | } 21 | 22 | private static native void invokeAllCallbacks(final long handle); 23 | } 24 | -------------------------------------------------------------------------------- /docs/_data/nav.yml: -------------------------------------------------------------------------------- 1 | - title: Docs 2 | href: /docs/ 3 | category: docs 4 | 5 | - title: GitHub 6 | href: https://github.com/facebook/rocksdb/ 7 | category: external 8 | 9 | - title: API (C++) 10 | href: https://github.com/facebook/rocksdb/tree/main/include/rocksdb 11 | category: external 12 | 13 | - title: API (Java) 14 | href: https://github.com/facebook/rocksdb/tree/main/java/src/main/java/org/rocksdb 15 | category: external 16 | 17 | - title: Support 18 | href: /support.html 19 | category: support 20 | 21 | - title: Blog 22 | href: /blog/ 23 | category: blog 24 | 25 | - title: Facebook 26 | href: https://www.facebook.com/groups/rocksdb.dev/ 27 | category: external 28 | 29 | # Use external for external links not associated with the paths of the current site. 30 | # If a category is external, site urls, for example, are not prepended to the href, etc.. 31 | -------------------------------------------------------------------------------- /util/aligned_storage.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | #pragma once 10 | 11 | #include 12 | 13 | #include "rocksdb/rocksdb_namespace.h" 14 | 15 | namespace ROCKSDB_NAMESPACE { 16 | 17 | template 18 | struct aligned_storage { 19 | struct type { 20 | alignas(Align) unsigned char data[sizeof(T)]; 21 | }; 22 | }; 23 | 24 | } // namespace ROCKSDB_NAMESPACE 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to RocksDB-Cloud 2 | 3 | ## Code of Conduct 4 | The code of conduct is described in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md) 5 | 6 | ## Contributor License Agreement ("CLA") 7 | 8 | In order to accept your pull request, we need you to submit a CLA. You 9 | only need to do this once, so if you've done this for another Rockset 10 | open source project, you're good to go. If you are submitting a pull 11 | request for the first time, just let us know that you have completed 12 | the CLA and we can cross-check with your GitHub username. The CLA 13 | is precisely the same CLA as used by github.com/facebook/rocksdb. 14 | 15 | Please download the CLA from https://goo.gl/qZpjvu, print it on 16 | paper, sign it and scan it into a pdf file. Then create a new issue at 17 | https://github.com/rockset/rocksdb-cloud/issues/new and attach your 18 | scanned pdf file to that issue. 19 | -------------------------------------------------------------------------------- /cmake/modules/Findlz4.cmake: -------------------------------------------------------------------------------- 1 | # - Find Lz4 2 | # Find the lz4 compression library and includes 3 | # 4 | # lz4_INCLUDE_DIRS - where to find lz4.h, etc. 5 | # lz4_LIBRARIES - List of libraries when using lz4. 6 | # lz4_FOUND - True if lz4 found. 7 | 8 | find_path(lz4_INCLUDE_DIRS 9 | NAMES lz4.h 10 | HINTS ${lz4_ROOT_DIR}/include) 11 | 12 | find_library(lz4_LIBRARIES 13 | NAMES lz4 14 | HINTS ${lz4_ROOT_DIR}/lib) 15 | 16 | include(FindPackageHandleStandardArgs) 17 | find_package_handle_standard_args(lz4 DEFAULT_MSG lz4_LIBRARIES lz4_INCLUDE_DIRS) 18 | 19 | mark_as_advanced( 20 | lz4_LIBRARIES 21 | lz4_INCLUDE_DIRS) 22 | 23 | if(lz4_FOUND AND NOT (TARGET lz4::lz4)) 24 | add_library(lz4::lz4 UNKNOWN IMPORTED) 25 | set_target_properties(lz4::lz4 26 | PROPERTIES 27 | IMPORTED_LOCATION ${lz4_LIBRARIES} 28 | INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIRS}) 29 | endif() 30 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/Experimental.java: -------------------------------------------------------------------------------- 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 java.lang.annotation.ElementType; 9 | import java.lang.annotation.Documented; 10 | import java.lang.annotation.Retention; 11 | import java.lang.annotation.RetentionPolicy; 12 | import java.lang.annotation.Target; 13 | 14 | /** 15 | * Marks a feature as experimental, meaning that it is likely 16 | * to change or even be removed/re-engineered in the future 17 | */ 18 | @Documented 19 | @Retention(RetentionPolicy.SOURCE) 20 | @Target({ElementType.TYPE, ElementType.METHOD}) 21 | public @interface Experimental { 22 | String value(); 23 | } 24 | -------------------------------------------------------------------------------- /java/rocksjni/export_import_files_metadatajni.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Meta Platforms, Inc. and affiliates. 2 | // 3 | // This source code is licensed under both the GPLv2 (found in the 4 | // COPYING file in the root directory) and Apache 2.0 License 5 | // (found in the LICENSE.Apache file in the root directory). 6 | 7 | #include "include/org_rocksdb_ExportImportFilesMetaData.h" 8 | #include "include/org_rocksdb_LiveFileMetaData.h" 9 | #include "rocksjni/portal.h" 10 | 11 | /* 12 | * Class: org_rocksdb_ExportImportFilesMetaData 13 | * Method: disposeInternal 14 | * Signature: (J)V 15 | */ 16 | void Java_org_rocksdb_ExportImportFilesMetaData_disposeInternal( 17 | JNIEnv* /*env*/, jobject /*jopt*/, jlong jhandle) { 18 | auto* metadata = 19 | reinterpret_cast(jhandle); 20 | assert(metadata != nullptr); 21 | delete metadata; 22 | } 23 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/UInt64AddOperator.java: -------------------------------------------------------------------------------- 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 | /** 9 | * Uint64AddOperator is a merge operator that accumlates a long 10 | * integer value. 11 | */ 12 | public class UInt64AddOperator extends MergeOperator { 13 | public UInt64AddOperator() { 14 | super(newSharedUInt64AddOperator()); 15 | } 16 | 17 | private static native long newSharedUInt64AddOperator(); 18 | @Override 19 | protected final void disposeInternal(final long handle) { 20 | disposeInternalJni(handle); 21 | } 22 | private static native void disposeInternalJni(final long handle); 23 | } 24 | -------------------------------------------------------------------------------- /utilities/wal_filter.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 5 | 6 | #include "rocksdb/wal_filter.h" 7 | 8 | #include 9 | 10 | #include "rocksdb/convenience.h" 11 | #include "rocksdb/options.h" 12 | #include "rocksdb/utilities/customizable_util.h" 13 | 14 | namespace ROCKSDB_NAMESPACE { 15 | Status WalFilter::CreateFromString(const ConfigOptions& config_options, 16 | const std::string& value, 17 | WalFilter** filter) { 18 | Status s = LoadStaticObject(config_options, value, filter); 19 | return s; 20 | } 21 | 22 | } // namespace ROCKSDB_NAMESPACE 23 | -------------------------------------------------------------------------------- /docs/_includes/header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 | 5 |

{{ site.title }}

6 |

{{ site.tagline }}

7 | 8 |
9 |

{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ site.description }}{% endif %}

10 |
11 |
12 | {% for promo in site.data.promo %} 13 | {% include plugins/{{promo.type}}.html button_href=promo.href button_text=promo.text %} 14 |
15 | {% endfor %} 16 |
17 |
18 |
19 |
20 | -------------------------------------------------------------------------------- /cloud/purge.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 Rockset 2 | 3 | #pragma once 4 | 5 | #ifndef ROCKSDB_LITE 6 | #include 7 | 8 | #include "rocksdb/status.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | class CloudFileSystemImpl; 13 | class Logger; 14 | 15 | // 16 | // Purges all unneeded files in a storage bucket 17 | // 18 | class Purge { 19 | public: 20 | // The bucket name is specified when the CloudFileSystem was created. 21 | Purge(CloudFileSystemImpl* fs, std::shared_ptr info_log); 22 | 23 | virtual ~Purge(); 24 | 25 | // Remove any un-needed files from the storage bucket 26 | virtual Status PurgeObsoleteFiles(); 27 | 28 | // Remove any dbids that do not have backing files in S3 29 | virtual Status PurgeObsoleteDbid(); 30 | 31 | private: 32 | CloudFileSystemImpl* cfs_; 33 | std::shared_ptr info_log_; 34 | }; 35 | } // namespace ROCKSDB_NAMESPACE 36 | #endif // ROCKSDB_LITE 37 | -------------------------------------------------------------------------------- /cmake/modules/FindNUMA.cmake: -------------------------------------------------------------------------------- 1 | # - Find NUMA 2 | # Find the NUMA library and includes 3 | # 4 | # NUMA_INCLUDE_DIRS - where to find numa.h, etc. 5 | # NUMA_LIBRARIES - List of libraries when using NUMA. 6 | # NUMA_FOUND - True if NUMA found. 7 | 8 | find_path(NUMA_INCLUDE_DIRS 9 | NAMES numa.h numaif.h 10 | HINTS ${NUMA_ROOT_DIR}/include) 11 | 12 | find_library(NUMA_LIBRARIES 13 | NAMES numa 14 | HINTS ${NUMA_ROOT_DIR}/lib) 15 | 16 | include(FindPackageHandleStandardArgs) 17 | find_package_handle_standard_args(NUMA DEFAULT_MSG NUMA_LIBRARIES NUMA_INCLUDE_DIRS) 18 | 19 | mark_as_advanced( 20 | NUMA_LIBRARIES 21 | NUMA_INCLUDE_DIRS) 22 | 23 | if(NUMA_FOUND AND NOT (TARGET NUMA::NUMA)) 24 | add_library (NUMA::NUMA UNKNOWN IMPORTED) 25 | set_target_properties(NUMA::NUMA 26 | PROPERTIES 27 | IMPORTED_LOCATION ${NUMA_LIBRARIES} 28 | INTERFACE_INCLUDE_DIRECTORIES ${NUMA_INCLUDE_DIRS}) 29 | endif() 30 | -------------------------------------------------------------------------------- /docs/_includes/home_header.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

{{ site.tagline }}

6 |
7 |

{% if page.excerpt %}{{ page.excerpt | strip_html }}{% else %}{{ site.description }}{% endif %}

8 |
9 |
10 | {% for promo in site.data.promo %} 11 |
12 | {% include plugins/{{promo.type}}.html href=promo.href text=promo.text children=promo.children %} 13 |
14 | {% endfor %} 15 |
16 |
17 | 20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /port/port.h: -------------------------------------------------------------------------------- 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 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 7 | // Use of this source code is governed by a BSD-style license that can be 8 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | // Include the appropriate platform specific file below. If you are 15 | // porting to a new platform, see "port_example.h" for documentation 16 | // of what the new port_.h file must provide. 17 | #if defined(ROCKSDB_PLATFORM_POSIX) 18 | #include "port/port_posix.h" 19 | #elif defined(OS_WIN) 20 | #include "port/win/port_win.h" 21 | #endif 22 | -------------------------------------------------------------------------------- /cmake/modules/Findzstd.cmake: -------------------------------------------------------------------------------- 1 | # - Find zstd 2 | # Find the zstd compression library and includes 3 | # 4 | # ZSTD_INCLUDE_DIRS - where to find zstd.h, etc. 5 | # ZSTD_LIBRARIES - List of libraries when using zstd. 6 | # ZSTD_FOUND - True if zstd found. 7 | 8 | find_path(ZSTD_INCLUDE_DIRS 9 | NAMES zstd.h 10 | HINTS ${zstd_ROOT_DIR}/include) 11 | 12 | find_library(ZSTD_LIBRARIES 13 | NAMES zstd 14 | HINTS ${zstd_ROOT_DIR}/lib) 15 | 16 | include(FindPackageHandleStandardArgs) 17 | find_package_handle_standard_args(zstd DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIRS) 18 | 19 | mark_as_advanced( 20 | ZSTD_LIBRARIES 21 | ZSTD_INCLUDE_DIRS) 22 | 23 | if(ZSTD_FOUND AND NOT (TARGET zstd::zstd)) 24 | add_library (zstd::zstd UNKNOWN IMPORTED) 25 | set_target_properties(zstd::zstd 26 | PROPERTIES 27 | IMPORTED_LOCATION ${ZSTD_LIBRARIES} 28 | INTERFACE_INCLUDE_DIRECTORIES ${ZSTD_INCLUDE_DIRS}) 29 | endif() 30 | -------------------------------------------------------------------------------- /java/src/main/java/org/rocksdb/CassandraCompactionFilter.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-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 | /** 9 | * Just a Java wrapper around CassandraCompactionFilter implemented in C++ 10 | */ 11 | public class CassandraCompactionFilter 12 | extends AbstractCompactionFilter { 13 | public CassandraCompactionFilter( 14 | final boolean purgeTtlOnExpiration, final int gcGracePeriodInSeconds) { 15 | super(createNewCassandraCompactionFilter0(purgeTtlOnExpiration, gcGracePeriodInSeconds)); 16 | } 17 | 18 | private static native long createNewCassandraCompactionFilter0( 19 | boolean purgeTtlOnExpiration, int gcGracePeriodInSeconds); 20 | } 21 | -------------------------------------------------------------------------------- /buckifier/check_buck_targets.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # If clang_format_diff.py command is not specfied, we assume we are able to 4 | # access directly without any path. 5 | 6 | TGT_DIFF=`git diff TARGETS | head -n 1` 7 | 8 | if [ ! -z "$TGT_DIFF" ] 9 | then 10 | echo "TARGETS file has uncommitted changes. Skip this check." 11 | exit 0 12 | fi 13 | 14 | echo Backup original TARGETS file. 15 | 16 | cp TARGETS TARGETS.bkp 17 | 18 | ${PYTHON:-python3} buckifier/buckify_rocksdb.py 19 | 20 | TGT_DIFF=`git diff TARGETS | head -n 1` 21 | 22 | if [ -z "$TGT_DIFF" ] 23 | then 24 | mv TARGETS.bkp TARGETS 25 | exit 0 26 | else 27 | echo "Please run '${PYTHON:-python3} buckifier/buckify_rocksdb.py' to update TARGETS file." 28 | echo "Do not manually update TARGETS file." 29 | ${PYTHON:-python3} --version 30 | mv TARGETS.bkp TARGETS 31 | exit 1 32 | fi 33 | -------------------------------------------------------------------------------- /utilities/transactions/transaction_db_mutex_impl.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | #include "rocksdb/utilities/transaction_db_mutex.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | class TransactionDBMutex; 13 | class TransactionDBCondVar; 14 | 15 | // Default implementation of TransactionDBMutexFactory. May be overridden 16 | // by TransactionDBOptions.custom_mutex_factory. 17 | class TransactionDBMutexFactoryImpl : public TransactionDBMutexFactory { 18 | public: 19 | std::shared_ptr AllocateMutex() override; 20 | std::shared_ptr AllocateCondVar() override; 21 | }; 22 | 23 | } // namespace ROCKSDB_NAMESPACE 24 | 25 | -------------------------------------------------------------------------------- /db/write_callback.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | 8 | #include "rocksdb/status.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | 12 | class DB; 13 | 14 | class WriteCallback { 15 | public: 16 | virtual ~WriteCallback() {} 17 | 18 | // Will be called while on the write thread before the write executes. If 19 | // this function returns a non-OK status, the write will be aborted and this 20 | // status will be returned to the caller of DB::Write(). 21 | virtual Status Callback(DB* db) = 0; 22 | 23 | // return true if writes with this callback can be batched with other writes 24 | virtual bool AllowWriteBatching() = 0; 25 | }; 26 | 27 | } // namespace ROCKSDB_NAMESPACE 28 | -------------------------------------------------------------------------------- /java/src/test/java/org/rocksdb/test/RemoveEmptyValueCompactionFilterFactory.java: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 2 | package org.rocksdb.test; 3 | 4 | import org.rocksdb.AbstractCompactionFilter; 5 | import org.rocksdb.AbstractCompactionFilterFactory; 6 | import org.rocksdb.RemoveEmptyValueCompactionFilter; 7 | 8 | /** 9 | * Simple CompactionFilterFactory class used in tests. Generates RemoveEmptyValueCompactionFilters. 10 | */ 11 | public class RemoveEmptyValueCompactionFilterFactory extends AbstractCompactionFilterFactory { 12 | @Override 13 | public RemoveEmptyValueCompactionFilter createCompactionFilter(final AbstractCompactionFilter.Context context) { 14 | return new RemoveEmptyValueCompactionFilter(); 15 | } 16 | 17 | @Override 18 | public String name() { 19 | return "RemoveEmptyValueCompactionFilterFactory"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /monitoring/file_read_sample.h: -------------------------------------------------------------------------------- 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 | #pragma once 7 | #include "db/version_edit.h" 8 | #include "util/random.h" 9 | 10 | namespace ROCKSDB_NAMESPACE { 11 | static const uint32_t kFileReadSampleRate = 1024; 12 | bool should_sample_file_read(); 13 | void sample_file_read_inc(FileMetaData*); 14 | 15 | inline bool should_sample_file_read() { 16 | return (Random::GetTLSInstance()->Next() % kFileReadSampleRate == 307); 17 | } 18 | 19 | inline void sample_file_read_inc(FileMetaData* meta) { 20 | meta->stats.num_reads_sampled.fetch_add(kFileReadSampleRate, 21 | std::memory_order_relaxed); 22 | } 23 | } // namespace ROCKSDB_NAMESPACE 24 | -------------------------------------------------------------------------------- /util/hash128.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) Facebook, Inc. and its affiliates. 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 | #pragma once 7 | 8 | // 128-bit hash gets it own header so that more popular hash.h doesn't 9 | // depend on math128.h 10 | 11 | #include "rocksdb/slice.h" 12 | #include "util/math128.h" 13 | 14 | namespace ROCKSDB_NAMESPACE { 15 | 16 | // Stable/persistent 128-bit hash for non-cryptographic applications. 17 | Unsigned128 Hash128(const char* data, size_t n, uint64_t seed); 18 | 19 | // Specific optimization without seed (same as seed = 0) 20 | Unsigned128 Hash128(const char* data, size_t n); 21 | 22 | inline Unsigned128 GetSliceHash128(const Slice& key) { 23 | return Hash128(key.data(), key.size()); 24 | } 25 | 26 | } // namespace ROCKSDB_NAMESPACE 27 | -------------------------------------------------------------------------------- /cmake/modules/Findgflags.cmake: -------------------------------------------------------------------------------- 1 | # - Find gflags library 2 | # Find the gflags includes and library 3 | # 4 | # GFLAGS_INCLUDE_DIR - where to find gflags.h. 5 | # GFLAGS_LIBRARIES - List of libraries when using gflags. 6 | # gflags_FOUND - True if gflags found. 7 | 8 | find_path(GFLAGS_INCLUDE_DIR 9 | NAMES gflags/gflags.h) 10 | 11 | find_library(GFLAGS_LIBRARIES 12 | NAMES gflags) 13 | 14 | include(FindPackageHandleStandardArgs) 15 | find_package_handle_standard_args(gflags 16 | DEFAULT_MSG GFLAGS_LIBRARIES GFLAGS_INCLUDE_DIR) 17 | 18 | mark_as_advanced( 19 | GFLAGS_LIBRARIES 20 | GFLAGS_INCLUDE_DIR) 21 | 22 | if(gflags_FOUND AND NOT (TARGET gflags::gflags)) 23 | add_library(gflags::gflags UNKNOWN IMPORTED) 24 | set_target_properties(gflags::gflags 25 | PROPERTIES 26 | IMPORTED_LOCATION ${GFLAGS_LIBRARIES} 27 | INTERFACE_INCLUDE_DIRECTORIES ${GFLAGS_INCLUDE_DIR} 28 | IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") 29 | endif() 30 | -------------------------------------------------------------------------------- /db/blob/prefetch_buffer_collection.cc: -------------------------------------------------------------------------------- 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 | #include "db/blob/prefetch_buffer_collection.h" 7 | 8 | namespace ROCKSDB_NAMESPACE { 9 | 10 | FilePrefetchBuffer* PrefetchBufferCollection::GetOrCreatePrefetchBuffer( 11 | uint64_t file_number) { 12 | auto& prefetch_buffer = prefetch_buffers_[file_number]; 13 | if (!prefetch_buffer) { 14 | ReadaheadParams readahead_params; 15 | readahead_params.initial_readahead_size = readahead_size_; 16 | readahead_params.max_readahead_size = readahead_size_; 17 | prefetch_buffer.reset(new FilePrefetchBuffer(readahead_params)); 18 | } 19 | 20 | return prefetch_buffer.get(); 21 | } 22 | 23 | } // namespace ROCKSDB_NAMESPACE 24 | -------------------------------------------------------------------------------- /tools/check_all_python.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | import glob 4 | 5 | # Checks that all python files in the repository are at least free of syntax 6 | # errors. This provides a minimal pre-/post-commit check for python file 7 | # modifications. 8 | 9 | filenames = [] 10 | # Avoid scanning all of ./ because there might be other external repos 11 | # linked in. 12 | for base in ["buckifier", "build_tools", "coverage", "tools"]: 13 | # Clean this up when we finally upgrade to Python 3 14 | for suff in ["*", "*/*", "*/*/*"]: 15 | filenames += glob.glob(base + "/" + suff + ".py") 16 | 17 | for filename in filenames: 18 | source = open(filename, "r").read() + "\n" 19 | # Parses and syntax checks the file, throwing on error. (No pyc written.) 20 | _ = compile(source, filename, "exec") 21 | 22 | print("No syntax errors in {0} .py files".format(len(filenames))) 23 | -------------------------------------------------------------------------------- /tools/generate_random_db.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. 3 | # 4 | # A shell script to load some pre generated data file to a DB using ldb tool 5 | # ./ldb needs to be avaible to be executed. 6 | # 7 | # Usage: