Class MutationResults
Most results are cluster-local and cannot be merged in any meaningful way. A LeaseContext
refers to an entry in one space; a ChangeResult's counts describe what one space did. So the rule
is: the caller sees the primary cluster's result, because that is the cluster reads come from and
the one whose view the caller will observe next.
clear is the exception. It returns how many entries were removed, and with fan-out the honest
total is the sum across clusters - the proxy really did remove that many. This is a documented deviation
from single-space behaviour, and the reason count is classified as a read rather than being
summed the same way: counting the same replicated entry on every cluster would inflate the answer, while
removing it on every cluster genuinely is several removals.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanWhether atakefound nothing, so there is nothing for the other clusters to remove either.static Objectmerge(OperationKind kind, Object primaryResult, List<Object> otherResults, boolean sumClear) Merges the per-cluster results into the one the caller receives.
-
Method Details
-
merge
public static Object merge(OperationKind kind, Object primaryResult, List<Object> otherResults, boolean sumClear) Merges the per-cluster results into the one the caller receives.- Parameters:
kind- the operation kind, which decides the ruleprimaryResult- what the primary cluster returnedotherResults- what the remaining clusters returned, successes only
-
isMiss
Whether atakefound nothing, so there is nothing for the other clusters to remove either.Used by
takeFanOutOnMiss: by default a take that matched nothing on the primary does not issue removals elsewhere. Fanning out on a miss would turn a harmless no-op into a cross-cluster delete sweep - the entry might exist on another cluster precisely because it was written there and has not replicated back yet.
-