rocksdb/table/block_based
Yanqin Jin 340ed4fac7 Add support for timestamp in Get/Put (#5079)
Summary:
It's useful to be able to (optionally) associate key-value pairs with user-provided timestamps. This PR is an early effort towards this goal and continues the work of facebook#4942. A suite of new unit tests exist in DBBasicTestWithTimestampWithParam. Support for timestamp requires the user to provide timestamp as a slice in `ReadOptions` and `WriteOptions`. All timestamps of the same database must share the same length, format, etc. The format of the timestamp is the same throughout the same database, and the user is responsible for providing a comparator function (Comparator) to order the <key, timestamp> tuples. Once created, the format and length of the timestamp cannot change (at least for now).

Test plan (on devserver):
```
$COMPILE_WITH_ASAN=1 make -j32 all
$./db_basic_test --gtest_filter=Timestamp/DBBasicTestWithTimestampWithParam.PutAndGet/*
$make check
```
All tests must pass.

We also run the following db_bench tests to verify whether there is regression on Get/Put while timestamp is not enabled.
```
$TEST_TMPDIR=/dev/shm ./db_bench -benchmarks=fillseq,readrandom -num=1000000
$TEST_TMPDIR=/dev/shm ./db_bench -benchmarks=fillrandom -num=1000000
```
Repeat for 6 times for both versions.

Results are as follows:
```
|        | readrandom | fillrandom |
| master | 16.77 MB/s | 47.05 MB/s |
| PR5079 | 16.44 MB/s | 47.03 MB/s |
```
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5079

Differential Revision: D15132946

Pulled By: riversand963

fbshipit-source-id: 833a0d657eac21182f0f206c910a6438154c742c
2019-06-05 23:10:47 -07:00
..
block_based_filter_block_test.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block_based_filter_block.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_based_filter_block.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_based_table_builder.cc Add support for timestamp in Get/Put (#5079) 2019-06-05 23:10:47 -07:00
block_based_table_builder.h Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block_based_table_factory.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block_based_table_factory.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_based_table_reader.cc Add support for timestamp in Get/Put (#5079) 2019-06-05 23:10:47 -07:00
block_based_table_reader.h Make GetEntryFromCache a member function. (#5394) 2019-06-03 12:34:59 -07:00
block_builder.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_builder.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_prefix_index.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block_prefix_index.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
block_test.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
block.cc Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
block.h Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
cachable_entry.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_footer.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_footer.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_hash_index_test.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
data_block_hash_index.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
data_block_hash_index.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
filter_block.h Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
flush_block_policy.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
flush_block_policy.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
full_filter_block_test.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
full_filter_block.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
full_filter_block.h Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
index_builder.cc Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00
index_builder.h Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
partitioned_filter_block_test.cc Move some logging related files to logging/ (#5387) 2019-05-31 17:23:59 -07:00
partitioned_filter_block.cc Organizing rocksdb/table directory by format 2019-05-30 14:51:11 -07:00
partitioned_filter_block.h Move some memory related files from util/ to memory/ (#5382) 2019-05-30 17:44:09 -07:00