blob_fetcher.cc 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
  2. // This source code is licensed under both the GPLv2 (found in the
  3. // COPYING file in the root directory) and Apache 2.0 License
  4. // (found in the LICENSE.Apache file in the root directory).
  5. #include "db/blob/blob_fetcher.h"
  6. #include "db/version_set.h"
  7. namespace ROCKSDB_NAMESPACE {
  8. Status BlobFetcher::FetchBlob(const Slice& user_key,
  9. const Slice& blob_index_slice,
  10. FilePrefetchBuffer* prefetch_buffer,
  11. PinnableSlice* blob_value,
  12. uint64_t* bytes_read) const {
  13. assert(version_);
  14. return version_->GetBlob(read_options_, user_key, blob_index_slice,
  15. prefetch_buffer, blob_value, bytes_read);
  16. }
  17. Status BlobFetcher::FetchBlob(const Slice& user_key,
  18. const BlobIndex& blob_index,
  19. FilePrefetchBuffer* prefetch_buffer,
  20. PinnableSlice* blob_value,
  21. uint64_t* bytes_read) const {
  22. assert(version_);
  23. return version_->GetBlob(read_options_, user_key, blob_index, prefetch_buffer,
  24. blob_value, bytes_read);
  25. }
  26. } // namespace ROCKSDB_NAMESPACE