Class MutationResults

java.lang.Object
org.openspaces.core.multicluster.internal.routing.MutationResults

public final class MutationResults extends Object
Decides what a fanned-out mutation returns, now that there is more than one answer to choose from.

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 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 rule
      primaryResult - what the primary cluster returned
      otherResults - what the remaining clusters returned, successes only
    • isMiss

      public static boolean isMiss(Object result)
      Whether a take found 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.