rocksdb/env
akankshamahajan 5cb2d09d47 Refactor FilePrefetchBuffer code (#12097)
Summary:
Summary - Refactor FilePrefetchBuffer code
- Implementation:
FilePrefetchBuffer maintains a deque of free buffers (free_bufs_) of size num_buffers_ and buffers (bufs_) which contains the prefetched data. Whenever a buffer is consumed or is outdated (w.r.t. to requested offset), that buffer is cleared and returned to free_bufs_.

 If a buffer is available in free_bufs_, it's moved to bufs_ and is sent for prefetching. num_buffers_ defines how many buffers are maintained that contains prefetched data.
If num_buffers_ == 1, it's a sequential read flow. Read API will be called on that one buffer whenever the data is requested and is not in the buffer.
If num_buffers_ > 1, then the data is prefetched asynchronosuly in the buffers whenever the data is consumed from the buffers and that buffer is freed.
If num_buffers > 1, then requested data can be overlapping between 2 buffers. To return the continuous buffer overlap_bufs_ is used. The requested data is copied from 2 buffers to the overlap_bufs_ and overlap_bufs_ is returned to
the caller.

- Merged Sync and Async code flow into one in FilePrefetchBuffer.

Test Plan -
- Crash test passed
- Unit tests
- Pending - Benchmarks

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

Reviewed By: ajkr

Differential Revision: D51759552

Pulled By: akankshamahajan15

fbshipit-source-id: 69a352945affac2ed22be96048d55863e0168ad5
2024-01-05 09:29:01 -08:00
..
composite_env.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
composite_env_wrapper.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
emulated_clock.h Make SystemClock into a Customizable Class (#8636) 2021-09-21 09:23:48 -07:00
env.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
env_basic_test.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
env_chroot.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
env_chroot.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
env_encryption.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
env_encryption_ctr.h remove duplicate comments in EncryptedEnv (#11549) 2023-06-27 11:55:37 -07:00
env_posix.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
env_test.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
file_system.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
file_system_tracer.cc Provide support for IOTracing for ReadAsync API (#9833) 2022-05-25 19:47:03 -07:00
file_system_tracer.h Provide support for IOTracing for ReadAsync API (#9833) 2022-05-25 19:47:03 -07:00
fs_posix.cc Refactor FilePrefetchBuffer code (#12097) 2024-01-05 09:29:01 -08:00
fs_readonly.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
fs_remap.cc Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
fs_remap.h Remove RocksDB LITE (#11147) 2023-01-27 13:14:19 -08:00
io_posix.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
io_posix.h Fix build on FreeBSD (#11218) (#12078) 2023-11-20 10:11:16 -08:00
io_posix_test.cc Print stack traces on frozen tests in CI (#10828) 2022-10-18 00:35:35 -07:00
mock_env.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
mock_env.h Run clang-format on env/ folder (#10859) 2022-10-24 17:54:14 -07:00
mock_env_test.cc internal_repo_rocksdb (4372117296613874540) (#12117) 2023-12-04 11:17:32 -08:00
unique_id_gen.cc Fix windows build errors (rdtsc and fnptr) (#12008) 2023-10-24 16:20:37 -07:00
unique_id_gen.h Internal API for generating semi-random salt (#11331) 2023-06-21 11:32:49 -07:00