Go to file
mrambacher 12f1137355 Add a SystemClock class to capture the time functions of an Env (#7858)
Summary:
Introduces and uses a SystemClock class to RocksDB.  This class contains the time-related functions of an Env and these functions can be redirected from the Env to the SystemClock.

Many of the places that used an Env (Timer, PerfStepTimer, RepeatableThread, RateLimiter, WriteController) for time-related functions have been changed to use SystemClock instead.  There are likely more places that can be changed, but this is a start to show what can/should be done.  Over time it would be nice to migrate most (if not all) of the uses of the time functions from the Env to the SystemClock.

There are several Env classes that implement these functions.  Most of these have not been converted yet to SystemClock implementations; that will come in a subsequent PR.  It would be good to unify many of the Mock Timer implementations, so that they behave similarly and be tested similarly (some override Sleep, some use a MockSleep, etc).

Additionally, this change will allow new methods to be introduced to the SystemClock (like https://github.com/facebook/rocksdb/issues/7101 WaitFor) in a consistent manner across a smaller number of classes.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7858

Reviewed By: pdillinger

Differential Revision: D26006406

Pulled By: mrambacher

fbshipit-source-id: ed10a8abbdab7ff2e23d69d85bd25b3e7e899e90
2021-01-25 22:09:11 -08:00
.circleci Small improvements to CircleCI Windows jobs (#7852) 2021-01-11 13:32:07 -08:00
.github/workflows
buckifier
build_tools Migrate away from Travis+Linux+amd64 (#7791) 2020-12-22 00:20:57 -08:00
cache Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
cmake
coverage
db Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
db_stress_tool Increase the txn lock timeout in stress test (#7823) 2020-12-30 20:31:35 -08:00
docs Update github-pages and dependencies (#7850) 2021-01-11 12:48:01 -08:00
env Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
examples
file Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
fuzz Update SstFileWriter fuzzer to iterate and check all key-value pairs (#7761) 2020-12-11 16:09:10 -08:00
hdfs
include/rocksdb Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
java Fixing Windows build using CMake (#7854) 2021-01-15 17:53:16 -08:00
logging Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
memory
memtable Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
monitoring Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
options Make StringEnv, StringSink, StringSource use FS classes (#7786) 2021-01-04 16:01:01 -08:00
port Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
table Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
test_util Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
third-party
tools Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
trace_replay Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
util Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
utilities Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
.clang-format
.gitignore
.lgtm.yml
.travis.yml Cleanup Travis CI config (#7848) 2021-01-11 10:30:28 -08:00
.watchmanconfig
AUTHORS
CMakeLists.txt Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
CODE_OF_CONDUCT.md
CONTRIBUTING.md
COPYING
DEFAULT_OPTIONS_HISTORY.md
DUMP_FORMAT.md
HISTORY.md Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
INSTALL.md
LANGUAGE-BINDINGS.md
LICENSE.Apache
LICENSE.leveldb
Makefile Update the versions of the test dependencies used for RocksJava (#7805) 2021-01-13 16:01:38 -08:00
README.md
ROCKSDB_LITE.md
TARGETS Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
USERS.md Add Apache Doris to USERS (#7865) 2021-01-19 15:31:56 -08:00
Vagrantfile
WINDOWS_PORT.md
appveyor.yml
defs.bzl
issue_template.md
src.mk Add a SystemClock class to capture the time functions of an Env (#7858) 2021-01-25 22:09:11 -08:00
thirdparty.inc

README.md

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

CircleCI Status TravisCI Status Appveyor 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.