Find a file
Levi Tamasi 1551f1011a Refactor the blob file related logic in VersionBuilder (#6835)
Summary:
This patch is groundwork for an upcoming change to store the set of
linked SSTs in `BlobFileMetaData`. With the current code, a new
`BlobFileMetaData` object is created each time a `VersionEdit` touches
a certain blob file. This is fine as long as these objects are lightweight
and cheap to create; however, with the addition of the linked SST set, it would
be very inefficient since the set would have to be copied over and over again.
Note that this is the same kind of problem that `VersionBuilder` is solving
w/r/t `Version`s and files, and we can apply the same solution; that is, we can
accumulate the changes in a different mutable object, and apply the delta in
one shot when the changes are committed. The patch does exactly that by
adding a new `BlobFileMetaDataDelta` class to `VersionBuilder`. In addition,
it turns the existing `GetBlobFileMetaData` helper into `IsBlobFileInVersion`
(which is fine since that's the only thing the method's clients care about now),
and adds a couple of helper methods that can create a `BlobFileMetaData`
object from the `BlobFileMetaData` in the base (if applicable) and the delta
when the `Version` is saved.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/6835

Test Plan: `make check`

Reviewed By: riversand963

Differential Revision: D21505187

Pulled By: ltamasi

fbshipit-source-id: d81a48c5f2ca7b79d7124c935332a6bcf3d5d988
2020-05-19 10:00:04 -07:00
.circleci
.github/workflows Add Github Action for some basic sanity test of PR (#6761) 2020-04-30 19:22:45 -07:00
buckifier Fix buck target db_stress_lib in opt mode (#6847) 2020-05-16 21:48:20 -07:00
build_tools Add Github Action for some basic sanity test of PR (#6761) 2020-04-30 19:22:45 -07:00
cache fix typo (#6831) 2020-05-11 14:58:25 -07:00
cmake Add find_dependency() in cmake config file. (#6791) 2020-05-12 21:18:29 -07:00
coverage
db Refactor the blob file related logic in VersionBuilder (#6835) 2020-05-19 10:00:04 -07:00
db_stress_tool Mark dependencies as PRIVATE and fix missing dependencies in tools. (#6790) 2020-05-12 21:07:55 -07:00
docs
env Re-read the whole request in direct IO mode when IO uring returns partial result (#6853) 2020-05-18 17:25:57 -07:00
examples Add missing my_pid to fprintf in multi_process_example (#6731) 2020-05-08 20:49:33 -07:00
file Enable IO Uring in MultiGet in direct IO mode (#6815) 2020-05-14 23:26:26 -07:00
hdfs prototype status check enforcement (#6798) 2020-05-08 12:40:43 -07:00
include/rocksdb Trigger compaction in CompactOnDeletionCollector based on deletion ratio (#6806) 2020-05-18 08:42:05 -07:00
java
logging
memory
memtable
monitoring
options prototype status check enforcement (#6798) 2020-05-08 12:40:43 -07:00
port
table Enable IO Uring in MultiGet in direct IO mode (#6815) 2020-05-14 23:26:26 -07:00
test_util Enable IO Uring in MultiGet in direct IO mode (#6815) 2020-05-14 23:26:26 -07:00
third-party
tools Make options length longer for sst_dump_test (#6846) 2020-05-19 09:22:12 -07:00
trace_replay Fix multiple CF replay failure in db_bench replay (#6787) 2020-05-01 00:03:38 -07:00
util Add tests for compression failure in BlockBasedTableBuilder (#6709) 2020-05-12 09:27:35 -07:00
utilities Trigger compaction in CompactOnDeletionCollector based on deletion ratio (#6806) 2020-05-18 08:42:05 -07:00
.clang-format
.gitignore
.lgtm.yml
.travis.yml Use 'make all' in LITE Travis configuration (#6834) 2020-05-15 13:59:24 -07:00
.watchmanconfig
appveyor.yml
AUTHORS
CMakeLists.txt Enable IO Uring in MultiGet in direct IO mode (#6815) 2020-05-14 23:26:26 -07:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
COPYING
DEFAULT_OPTIONS_HISTORY.md
defs.bzl
DUMP_FORMAT.md
HISTORY.md sst_dump to reduce number of file reads (#6836) 2020-05-12 18:23:33 -07:00
INSTALL.md
issue_template.md
LANGUAGE-BINDINGS.md
LICENSE.Apache
LICENSE.leveldb
Makefile Enable IO Uring in MultiGet in direct IO mode (#6815) 2020-05-14 23:26:26 -07:00
README.md
ROCKSDB_LITE.md
src.mk Enable IO Uring in MultiGet in direct IO mode (#6815) 2020-05-14 23:26:26 -07:00
TARGETS Fix buck target db_stress_lib in opt mode (#6847) 2020-05-16 21:48:20 -07:00
thirdparty.inc
USERS.md Add YugabyteDB to USERS (#6786) 2020-05-06 10:28:29 -07:00
Vagrantfile
WINDOWS_PORT.md

RocksDB: A Persistent Key-Value Store for Flash and RAM Storage

Linux/Mac Build Status Windows Build status PPC64le Build Status

RocksDB is developed and maintained by Facebook Database Engineering Team. It is built on earlier work on LevelDB by Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)

This code is a library that forms the core building block for a fast key-value server, especially suited for storing data on flash drives. It has a Log-Structured-Merge-Database (LSM) design with flexible tradeoffs between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF) and Space-Amplification-Factor (SAF). It has multi-threaded compactions, making it especially suitable for storing multiple terabytes of data in a single database.

Start with example usage here: https://github.com/facebook/rocksdb/tree/master/examples

See the github wiki for more explanation.

The public interface is in include/. Callers should not include or rely on the details of any other header files in this package. Those internal APIs may be changed without warning.

Design discussions are conducted in https://www.facebook.com/groups/rocksdb.dev/ and https://rocksdb.slack.com/

License

RocksDB is dual-licensed under both the GPLv2 (found in the COPYING file in the root directory) and Apache 2.0 License (found in the LICENSE.Apache file in the root directory). You may select, at your option, one of the above-listed licenses.