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 V
insert(V v)
Computes the value that should be inserted in the BTree.V
merge(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)
void
onAllocatedOnHeap(long heapSize)
-
-
-
Method Detail
-
insert
public V insert(V v)
Description copied from interface:UpdateFunction
Computes the value that should be inserted in the BTree.- Specified by:
insert
in 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:UpdateFunction
Computes the result of merging the existing value with the one from the update.- Specified by:
merge
in 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:
onAllocatedOnHeap
in 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)
-
-