Skip to content

Commit

Permalink
add comment for merge operator
Browse files Browse the repository at this point in the history
Signed-off-by: tabokie <xy.tao@outlook.com>
  • Loading branch information
tabokie committed Feb 11, 2020
1 parent 7c3cb82 commit 89165f5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/blob_index_merge_operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ class BlobIndexMergeOperator : public MergeOperator {
public:
BlobIndexMergeOperator() = default;

// FullMergeV2 merges one base value with multiple merge operands and
// preserves latest value w.r.t. timestamp of original *put*. Each merge
// is the output of blob GC, and contains meta data including *put-ts* and
// *src-file*.
// Merge operation follows such rules:
// *. basic rule (keep base value): [Y][Z] ... [X](Y)(Z) => [X]
// a. same put (keep merge value): [Y] ... [X](Y)(X') => [X']
// we identify this case by checking *src-file* of merges against
// *blob-handle* of base.
// b. merge reorder (keep biggest put-ts): [A][B](B')(A') => [B']
// c. deletion (keep deletion marker): [delete](X)(Y) => [deletion marker]
bool FullMergeV2(const MergeOperationInput& merge_in,
MergeOperationOutput* merge_out) const override {
Status s;
Expand Down

0 comments on commit 89165f5

Please sign in to comment.