Class TxDecisionMaker.PutIfAbsentDecisionMaker<K,V>

java.lang.Object
org.h2.mvstore.MVMap.DecisionMaker<VersionedValue<V>>
org.h2.mvstore.tx.TxDecisionMaker<K,V>
org.h2.mvstore.tx.TxDecisionMaker.PutIfAbsentDecisionMaker<K,V>
Enclosing class:
TxDecisionMaker<K,V>

public static final class TxDecisionMaker.PutIfAbsentDecisionMaker<K,V> extends TxDecisionMaker<K,V>
  • Field Details

    • oldValueSupplier

      private final Function<K,V> oldValueSupplier
  • Constructor Details

    • PutIfAbsentDecisionMaker

      PutIfAbsentDecisionMaker(int mapId, Transaction transaction, Function<K,V> oldValueSupplier)
  • Method Details

    • decide

      public MVMap.Decision decide(VersionedValue<V> existingValue, VersionedValue<V> providedValue)
      Description copied from class: MVMap.DecisionMaker
      Makes a decision about how to proceed with the update.
      Overrides:
      decide in class TxDecisionMaker<K,V>
      Parameters:
      existingValue - value currently exists in the map
      providedValue - original input value
      Returns:
      PUT if a new value need to replace existing one or a new value to be inserted if there is none REMOVE if existing value should be deleted ABORT if update operation should be aborted or repeated later REPEAT if update operation should be repeated immediately
    • getValueInSnapshot

      private V getValueInSnapshot()