Package org.apache.cassandra.utils.btree
Interface UpdateFunction<K,V>
-
- All Known Implementing Classes:
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 Modifier and Type Interface Description static classUpdateFunction.Simple<V>
-
Field Summary
Fields Modifier and Type Field Description static UpdateFunction.Simple<java.lang.Object>noOp
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Vinsert(K insert)Computes the value that should be inserted in the BTree.Vmerge(V replacing, K update)Computes the result of merging the existing value with the one from the update.static <K> UpdateFunction<K,K>noOp()voidonAllocatedOnHeap(long heapSize)
-
-
-
Field Detail
-
noOp
static final UpdateFunction.Simple<java.lang.Object> noOp
-
-
Method Detail
-
insert
V insert(K 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
V merge(V replacing, K update)
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
static <K> UpdateFunction<K,K> noOp()
-
-