#pragma once
#include <string>
-#include "db/dbformat.h"
-#include "db/merge_context.h"
+
#include "db/read_callback.h"
-#include "rocksdb/env.h"
-#include "rocksdb/statistics.h"
#include "rocksdb/types.h"
-#include "table/block_based/block.h"
namespace ROCKSDB_NAMESPACE {
+class BlobFetcher;
+class Comparator;
+class Logger;
class MergeContext;
+class MergeOperator;
+class PinnableWideColumns;
class PinnedIteratorsManager;
+class Statistics;
+class SystemClock;
+struct ParsedInternalKey;
// Data structure for accumulating statistics during a point lookup. At the
// end of the point lookup, the corresponding ticker stats are updated. This
// MultiGet stats.
uint64_t num_filter_read = 0;
uint64_t num_index_read = 0;
- uint64_t num_data_read = 0;
uint64_t num_sst_read = 0;
};
GetContext(const Comparator* ucmp, const MergeOperator* merge_operator,
Logger* logger, Statistics* statistics, GetState init_state,
const Slice& user_key, PinnableSlice* value,
- bool* value_found, MergeContext* merge_context, bool do_merge,
- SequenceNumber* max_covering_tombstone_seq, Env* env,
+ PinnableWideColumns* columns, bool* value_found,
+ MergeContext* merge_context, bool do_merge,
+ SequenceNumber* max_covering_tombstone_seq, SystemClock* clock,
SequenceNumber* seq = nullptr,
PinnedIteratorsManager* _pinned_iters_mgr = nullptr,
ReadCallback* callback = nullptr, bool* is_blob_index = nullptr,
- uint64_t tracing_get_id = 0);
+ uint64_t tracing_get_id = 0, BlobFetcher* blob_fetcher = nullptr);
GetContext(const Comparator* ucmp, const MergeOperator* merge_operator,
Logger* logger, Statistics* statistics, GetState init_state,
const Slice& user_key, PinnableSlice* value,
- std::string* timestamp, bool* value_found,
- MergeContext* merge_context, bool do_merge,
- SequenceNumber* max_covering_tombstone_seq, Env* env,
+ PinnableWideColumns* columns, std::string* timestamp,
+ bool* value_found, MergeContext* merge_context, bool do_merge,
+ SequenceNumber* max_covering_tombstone_seq, SystemClock* clock,
SequenceNumber* seq = nullptr,
PinnedIteratorsManager* _pinned_iters_mgr = nullptr,
ReadCallback* callback = nullptr, bool* is_blob_index = nullptr,
- uint64_t tracing_get_id = 0);
+ uint64_t tracing_get_id = 0, BlobFetcher* blob_fetcher = nullptr);
GetContext() = delete;
return max_covering_tombstone_seq_;
}
+ bool NeedTimestamp() { return timestamp_ != nullptr; }
+
+ void SetTimestampFromRangeTombstone(const Slice& timestamp) {
+ assert(timestamp_);
+ timestamp_->assign(timestamp.data(), timestamp.size());
+ ts_from_rangetombstone_ = true;
+ }
+
PinnedIteratorsManager* pinned_iters_mgr() { return pinned_iters_mgr_; }
// If a non-null string is passed, all the SaveValue calls will be
void push_operand(const Slice& value, Cleanable* value_pinner);
private:
+ void Merge(const Slice* value);
+ void MergeWithEntity(Slice entity);
+ bool GetBlobValue(const Slice& blob_index, PinnableSlice* blob_value);
+
const Comparator* ucmp_;
const MergeOperator* merge_operator_;
// the merge operations encountered;
GetState state_;
Slice user_key_;
PinnableSlice* pinnable_val_;
+ PinnableWideColumns* columns_;
std::string* timestamp_;
+ bool ts_from_rangetombstone_{false};
bool* value_found_; // Is value set correctly? Used by KeyMayExist
MergeContext* merge_context_;
SequenceNumber* max_covering_tombstone_seq_;
- Env* env_;
+ SystemClock* clock_;
// If a key is found, seq_ will be set to the SequenceNumber of most recent
// write to the key or kMaxSequenceNumber if unknown
SequenceNumber* seq_;
// Used for block cache tracing only. A tracing get id uniquely identifies a
// Get or a MultiGet.
const uint64_t tracing_get_id_;
+ BlobFetcher* blob_fetcher_;
};
// Call this to replay a log and bring the get_context up to date. The replay