Package org.h2.mvstore.tx
Class CommitDecisionMaker<V>
- java.lang.Object
-
- org.h2.mvstore.MVMap.DecisionMaker<VersionedValue<V>>
-
- org.h2.mvstore.tx.CommitDecisionMaker<V>
-
final class CommitDecisionMaker<V> extends MVMap.DecisionMaker<VersionedValue<V>>
Class CommitDecisionMaker makes a decision during post-commit processing about how to transform uncommitted map entry into committed one, based on undo log information.
-
-
Field Summary
Fields Modifier and Type Field Description private MVMap.Decision
decision
private long
undoKey
-
Fields inherited from class org.h2.mvstore.MVMap.DecisionMaker
DEFAULT, PUT, REMOVE
-
-
Constructor Summary
Constructors Constructor Description CommitDecisionMaker()
-
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.void
reset()
Resets internal state (if any) of a this DecisionMaker to it's initial state.<T extends VersionedValue<V>>
TselectValue(T existingValue, T providedValue)
Provides revised value for insert/update based on original input value and value currently existing in the map.(package private) void
setUndoKey(long undoKey)
java.lang.String
toString()
-
Methods inherited from class org.h2.mvstore.MVMap.DecisionMaker
decide
-
-
-
-
Field Detail
-
undoKey
private long undoKey
-
decision
private MVMap.Decision decision
-
-
Method Detail
-
setUndoKey
void setUndoKey(long undoKey)
-
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.- Specified by:
decide
in classMVMap.DecisionMaker<VersionedValue<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 VersionedValue<V>> T selectValue(T existingValue, T providedValue)
Description copied from class:MVMap.DecisionMaker
Provides 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:
selectValue
in classMVMap.DecisionMaker<VersionedValue<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.DecisionMaker
Resets 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:
reset
in classMVMap.DecisionMaker<VersionedValue<V>>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-