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
This commit is contained in:
Sagar Vemuri 2018-03-27 16:57:32 -07:00 committed by Facebook Github Bot
parent d687670256
commit 90c542347a

View File

@ -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.