Package org.h2.mvstore.tx
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>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.h2.mvstore.tx.TxDecisionMaker
TxDecisionMaker.LockDecisionMaker<K,V>, TxDecisionMaker.PutIfAbsentDecisionMaker<K,V>, TxDecisionMaker.RepeatableReadLockDecisionMaker<K,V>
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Function<K,V>
oldValueSupplier
-
Fields inherited from class org.h2.mvstore.tx.TxDecisionMaker
key
-
Fields inherited from class org.h2.mvstore.MVMap.DecisionMaker
DEFAULT, PUT, REMOVE
-
-
Constructor Summary
Constructors Constructor Description PutIfAbsentDecisionMaker(int mapId, Transaction transaction, java.util.function.Function<K,V> oldValueSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MVMap.Decision
decide(VersionedValue<V> existingValue, VersionedValue<V> providedValue)
Makes a decision about how to proceed with the update.private V
getValueInSnapshot()
-
Methods inherited from class org.h2.mvstore.tx.TxDecisionMaker
allowNonRepeatableRead, decideToAbort, getBlockingTransaction, getDecision, getLastValue, getNewValue, initialize, isCommitted, isRepeatedOperation, isThisTransaction, logAndDecideToPut, reset, selectValue, setDecision, toString
-
Methods inherited from class org.h2.mvstore.MVMap.DecisionMaker
decide
-
-
-
-
Constructor Detail
-
PutIfAbsentDecisionMaker
PutIfAbsentDecisionMaker(int mapId, Transaction transaction, java.util.function.Function<K,V> oldValueSupplier)
-
-
Method Detail
-
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 classTxDecisionMaker<K,V>
- Parameters:
existingValue
- value currently exists in the mapprovidedValue
- 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()
-
-