Class AbstractChangeSet<S extends NodeSlot,N extends com.apple.foundationdb.async.rtree.AbstractNode<S,N>>
java.lang.Object
com.apple.foundationdb.async.rtree.AbstractChangeSet<S,N>
- Type Parameters:
S
- slot type classN
- node type class (self type)
- All Implemented Interfaces:
Node.ChangeSet
public abstract class AbstractChangeSet<S extends NodeSlot,N extends com.apple.foundationdb.async.rtree.AbstractNode<S,N>>
extends Object
implements Node.ChangeSet
Abstract base implementations for all
Node.ChangeSet
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(Transaction transaction) Apply all mutations for the change set.int
getLevel()
The level we should use when maintaining the node slot index.getNode()
The node this change set applies to.Previous change set in the chain of change sets.boolean
Returns whether this change set needs to also update the node slot index.
-
Method Details
-
apply
Description copied from interface:Node.ChangeSet
Apply all mutations for the change set. These happen transactionally using theTransaction
provided.- Specified by:
apply
in interfaceNode.ChangeSet
- Parameters:
transaction
- transaction to use when making all modifications
-
getPreviousChangeSet
Previous change set in the chain of change sets. Can benull
if there is no previous change set.- Returns:
- the previous change set in the chain of change sets
-
getNode
The node this change set applies to.- Returns:
- the node this change set applies to
-
getLevel
public int getLevel()The level we should use when maintaining the node slot index. Iflevel < 0
, do not maintain the node slot index.- Returns:
- the level used when maintaing the node slot index
-
isUpdateNodeSlotIndex
public boolean isUpdateNodeSlotIndex()Returns whether this change set needs to also update the node slot index. There are scenarios where we do not need to update such an index in general. For instance, the user may not want to use such an index. In addition to that, there are change set implementations that should not update the index even if such and index is maintained in general. For instance, the moved-in slots were already persisted in the database before the move-in operation. We should not update the node slot index in such a case.- Returns:
true
if we need to update the node slot index,false
otherwise
-