Package org.apache.cassandra.utils.btree
Interface UpdateFunction<K,V>
- All Known Implementing Classes:
BTreePartitionUpdater,ColumnData.Reconciler,UpdateFunction.Simple
public interface UpdateFunction<K,V>
An interface defining the method to be applied to the existing and replacing object in a BTree. The objects returned
by the methods will be the object that need to be stored in the BTree.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionComputes the value that should be inserted in the BTree.Computes the result of merging the existing value with the one from the update.static <K> UpdateFunction<K,K> noOp()voidonAllocatedOnHeap(long heapSize)
-
Field Details
-
noOp
-
-
Method Details
-
insert
Computes the value that should be inserted in the BTree.- Parameters:
insert- the update value- Returns:
- the value that should be inserted in the BTree
-
merge
Computes the result of merging the existing value with the one from the update.- Parameters:
replacing- the value in the original tree we have matchedupdate- the value in the updating collection that matched- Returns:
- the value to insert into the new tree
-
onAllocatedOnHeap
void onAllocatedOnHeap(long heapSize) - Parameters:
heapSize- extra heap space allocated (over previous tree)
-
noOp
-