Package org.apache.cassandra.utils.btree
Class UpdateFunction.Simple<V>
- java.lang.Object
-
- org.apache.cassandra.utils.btree.UpdateFunction.Simple<V>
-
- All Implemented Interfaces:
UpdateFunction<V,V>
- Enclosing interface:
- UpdateFunction<K,V>
public static final class UpdateFunction.Simple<V> extends java.lang.Object implements UpdateFunction<V,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.utils.btree.UpdateFunction
UpdateFunction.Simple<V>
-
-
Field Summary
-
Fields inherited from interface org.apache.cassandra.utils.btree.UpdateFunction
noOp
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Vinsert(V v)Computes the value that should be inserted in the BTree.Vmerge(V replacing, V update)Computes the result of merging the existing value with the one from the update.static <V> UpdateFunction.Simple<V>of(java.util.function.BiFunction<V,V,V> f)voidonAllocatedOnHeap(long heapSize)
-
-
-
Method Detail
-
insert
public V insert(V v)
Description copied from interface:UpdateFunctionComputes the value that should be inserted in the BTree.- Specified by:
insertin interfaceUpdateFunction<V,V>- Parameters:
v- the update value- Returns:
- the value that should be inserted in the BTree
-
merge
public V merge(V replacing, V update)
Description copied from interface:UpdateFunctionComputes the result of merging the existing value with the one from the update.- Specified by:
mergein interfaceUpdateFunction<V,V>- 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
public void onAllocatedOnHeap(long heapSize)
- Specified by:
onAllocatedOnHeapin interfaceUpdateFunction<V,V>- Parameters:
heapSize- extra heap space allocated (over previous tree)
-
of
public static <V> UpdateFunction.Simple<V> of(java.util.function.BiFunction<V,V,V> f)
-
-