mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-25 22:44:05 +00:00
Add class comment for BlockFetcher
Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5337 Differential Revision: D15482289 Pulled By: ltamasi fbshipit-source-id: 8639ca78c1b8dfcc337a742d4d81d5752f12545f
This commit is contained in:
parent
2095ae8858
commit
40aa520a51
|
@ -13,14 +13,28 @@
|
|||
#include "util/memory_allocator.h"
|
||||
|
||||
namespace rocksdb {
|
||||
|
||||
// Retrieves a single block of a given file. Utilizes the prefetch buffer and/or
|
||||
// persistent cache provided (if any) to try to avoid reading from the file
|
||||
// directly. Note that both the prefetch buffer and the persistent cache are
|
||||
// optional; also, note that the persistent cache may be configured to store either
|
||||
// compressed or uncompressed blocks.
|
||||
//
|
||||
// If the retrieved block is compressed and the do_uncompress flag is set,
|
||||
// BlockFetcher uncompresses the block (using the uncompression dictionary,
|
||||
// if provided, to prime the compression algorithm), and returns the resulting
|
||||
// uncompressed block data. Otherwise, it returns the original block.
|
||||
//
|
||||
// Two read options affect the behavior of BlockFetcher: if verify_checksums is
|
||||
// true, the checksum of the (original) block is checked; if fill_cache is true,
|
||||
// the block is added to the persistent cache if needed.
|
||||
//
|
||||
// Memory for uncompressed and compressed blocks is allocated as needed
|
||||
// using memory_allocator and memory_allocator_compressed, respectively
|
||||
// (if provided; otherwise, the default allocator is used).
|
||||
|
||||
class BlockFetcher {
|
||||
public:
|
||||
// Read the block identified by "handle" from "file".
|
||||
// The only relevant option is options.verify_checksums for now.
|
||||
// On failure return non-OK.
|
||||
// On success fill *result and return OK - caller owns *result
|
||||
// @param uncompression_dict Data for presetting the compression library's
|
||||
// dictionary.
|
||||
BlockFetcher(RandomAccessFileReader* file,
|
||||
FilePrefetchBuffer* prefetch_buffer, const Footer& footer,
|
||||
const ReadOptions& read_options, const BlockHandle& handle,
|
||||
|
|
Loading…
Reference in a new issue