Package org.h2.mvstore
Class MVMap.RewriteDecisionMaker<V>
- java.lang.Object
-
- org.h2.mvstore.MVMap.DecisionMaker<V>
-
- org.h2.mvstore.MVMap.RewriteDecisionMaker<V>
-
private static final class MVMap.RewriteDecisionMaker<V> extends MVMap.DecisionMaker<V>
-
-
Field Summary
Fields Modifier and Type Field Description private MVMap.Decisiondecisionprivate longpagePos-
Fields inherited from class org.h2.mvstore.MVMap.DecisionMaker
DEFAULT, IF_ABSENT, IF_PRESENT, PUT, REMOVE
-
-
Constructor Summary
Constructors Constructor Description RewriteDecisionMaker(long pagePos)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MVMap.Decisiondecide(V existingValue, V providedValue)Makes a decision about how to proceed with the update.MVMap.Decisiondecide(V existingValue, V providedValue, CursorPos<?,?> tip)Makes a decision about how to proceed with the update.(package private) MVMap.DecisiongetDecision()voidreset()Resets internal state (if any) of a this DecisionMaker to it's initial state.<T extends V>
TselectValue(T existingValue, T providedValue)Provides revised value for insert/update based on original input value and value currently existing in the map.java.lang.StringtoString()
-
-
-
Field Detail
-
pagePos
private final long pagePos
-
decision
private MVMap.Decision decision
-
-
Method Detail
-
decide
public MVMap.Decision decide(V existingValue, V providedValue, CursorPos<?,?> tip)
Description copied from class:MVMap.DecisionMakerMakes a decision about how to proceed with the update.- Overrides:
decidein classMVMap.DecisionMaker<V>- Parameters:
existingValue- the old valueprovidedValue- the new valuetip- the cursor position- Returns:
- the decision
-
decide
public MVMap.Decision decide(V existingValue, V providedValue)
Description copied from class:MVMap.DecisionMakerMakes a decision about how to proceed with the update.- Specified by:
decidein classMVMap.DecisionMaker<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
-
selectValue
public <T extends V> T selectValue(T existingValue, T providedValue)
Description copied from class:MVMap.DecisionMakerProvides revised value for insert/update based on original input value and value currently existing in the map. This method is only invoked after call to decide(), if it returns PUT.- Overrides:
selectValuein classMVMap.DecisionMaker<V>- Type Parameters:
T- value type- Parameters:
existingValue- value currently exists in the mapprovidedValue- original input value- Returns:
- value to be used by insert/update
-
reset
public void reset()
Description copied from class:MVMap.DecisionMakerResets internal state (if any) of a this DecisionMaker to it's initial state. This method is invoked whenever concurrent update failure is encountered, so we can re-start update process.- Overrides:
resetin classMVMap.DecisionMaker<V>
-
getDecision
MVMap.Decision getDecision()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-