-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable blob caching for MultiGetBlob in RocksDB (#10272)
Summary: - [x] Enabled blob caching for MultiGetBlob in RocksDB - [x] Refactored MultiGetBlob logic and interface in RocksDB - [x] Cleaned up Version::MultiGetBlob() and moved 'blob'-related code snippets into BlobSource - [x] Add End-to-end test cases in db_blob_basic_test and also add unit tests in blob_source_test This task is a part of #10156 Pull Request resolved: #10272 Reviewed By: ltamasi Differential Revision: D37558112 Pulled By: gangliao fbshipit-source-id: a73a6a94ffdee0024d5b2a39e6d1c1a7d38664db
- Loading branch information
1 parent
20754b3
commit 056e08d
Showing
11 changed files
with
756 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) Meta Platforms, Inc. and affiliates. | ||
// This source code is 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). | ||
|
||
#pragma once | ||
|
||
#include <cinttypes> | ||
|
||
#include "rocksdb/compression_type.h" | ||
#include "rocksdb/slice.h" | ||
#include "rocksdb/status.h" | ||
#include "util/autovector.h" | ||
|
||
namespace ROCKSDB_NAMESPACE { | ||
|
||
// A read Blob request structure for use in BlobSource::MultiGetBlob and | ||
// BlobFileReader::MultiGetBlob. | ||
struct BlobReadRequest { | ||
// User key to lookup the paired blob | ||
const Slice* user_key = nullptr; | ||
|
||
// File offset in bytes | ||
uint64_t offset = 0; | ||
|
||
// Length to read in bytes | ||
size_t len = 0; | ||
|
||
// Blob compression type | ||
CompressionType compression = kNoCompression; | ||
|
||
// Output parameter set by MultiGetBlob() to point to the data buffer, and | ||
// the number of valid bytes | ||
PinnableSlice* result = nullptr; | ||
|
||
// Status of read | ||
Status* status = nullptr; | ||
|
||
BlobReadRequest(const Slice& _user_key, uint64_t _offset, size_t _len, | ||
CompressionType _compression, PinnableSlice* _result, | ||
Status* _status) | ||
: user_key(&_user_key), | ||
offset(_offset), | ||
len(_len), | ||
compression(_compression), | ||
result(_result), | ||
status(_status) {} | ||
|
||
BlobReadRequest() = default; | ||
BlobReadRequest(const BlobReadRequest& other) = default; | ||
BlobReadRequest& operator=(const BlobReadRequest& other) = default; | ||
}; | ||
|
||
using BlobFileReadRequests = | ||
std::tuple<uint64_t /* file_number */, uint64_t /* file_size */, | ||
autovector<BlobReadRequest>>; | ||
|
||
} // namespace ROCKSDB_NAMESPACE |
Oops, something went wrong.