Update comments about MergeOperator::AllowSingleOperand

Summary:
Updated comments around AllowSingleOperand.
Reason: A couple of users were confused and encountered issues due to no overriding PartialMerge with AllowSingleOperand=true.

I'll also look into modifying the default merge operator implementation so that overriding PartialMerge is not mandatory when AllowSingleOp=true.
Closes https://github.com/facebook/rocksdb/pull/3659

Differential Revision: D7422691

Pulled By: sagar0

fbshipit-source-id: 3d075a6ced0120f5d65cb7ae5412936f1862f342
main
Sagar Vemuri 7 years ago committed by Facebook Github Bot
parent d687670256
commit 90c542347a
  1. 6
      include/rocksdb/merge_operator.h

@ -185,9 +185,9 @@ class MergeOperator {
// Determines whether the MergeOperator can be called with just a single
// merge operand.
// Override and return true for allowing a single operand. FullMergeV2 and
// PartialMerge/PartialMergeMulti should be implemented accordingly to handle
// a single operand.
// Override and return true for allowing a single operand. Both FullMergeV2
// and PartialMerge/PartialMergeMulti should be overridden and implemented
// correctly to handle a single operand.
virtual bool AllowSingleOperand() const { return false; }
// Allows to control when to invoke a full merge during Get.

Loading…
Cancel
Save