rocksdb/db/blob
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
..
blob_constants.h
blob_contents.cc
blob_contents.h Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
blob_counting_iterator.h
blob_counting_iterator_test.cc
blob_fetcher.cc
blob_fetcher.h
blob_file_addition.cc
blob_file_addition.h
blob_file_addition_test.cc
blob_file_builder.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_file_builder.h Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_file_builder_test.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_file_cache.cc
blob_file_cache.h
blob_file_cache_test.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_file_completion_callback.h
blob_file_garbage.cc
blob_file_garbage.h
blob_file_garbage_test.cc
blob_file_meta.cc
blob_file_meta.h
blob_file_reader.cc Support compressed and local flash secondary cache stacking (#11812) 2023-09-21 20:30:53 -07:00
blob_file_reader.h
blob_file_reader_test.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_garbage_meter.cc
blob_garbage_meter.h
blob_garbage_meter_test.cc
blob_index.h
blob_log_format.cc
blob_log_format.h
blob_log_sequential_reader.cc
blob_log_sequential_reader.h
blob_log_writer.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_log_writer.h Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
blob_read_request.h
blob_source.cc
blob_source.h
blob_source_test.cc Group SST write in flush, compaction and db open with new stats (#11910) 2023-12-29 15:29:23 -08:00
db_blob_basic_test.cc Enforce status checking after Valid() returns false for IteratorWrapper (#11975) 2023-10-18 09:38:38 -07:00
db_blob_compaction_test.cc
db_blob_corruption_test.cc
db_blob_index_test.cc
prefetch_buffer_collection.cc Refactor FilePrefetchBuffer code (#12097) 2024-01-05 09:29:01 -08:00
prefetch_buffer_collection.h