Package org.apache.cassandra.utils.btree
Interface UpdateFunction<K,V>
-
- All Superinterfaces:
com.google.common.base.Function<K,V>,java.util.function.Function<K,V>
- All Known Implementing Classes:
UpdateFunction.Simple
public interface UpdateFunction<K,V> extends com.google.common.base.Function<K,V>An interface defining a function to be applied to both the object we are replacing in a BTree and the object that is intended to replace it, returning the object to actually replace it.
-
-
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 booleanabortEarly()voidallocated(long heapSize)Vapply(V replacing, K update)static <K> UpdateFunction<K,K>noOp()
-
-
-
Field Detail
-
noOp
static final UpdateFunction.Simple<java.lang.Object> noOp
-
-
Method Detail
-
apply
V apply(V replacing, K 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
-
abortEarly
boolean abortEarly()
- Returns:
- true if we should fail the update
-
allocated
void allocated(long heapSize)
- Parameters:
heapSize- extra heap space allocated (over previous tree)
-
noOp
static <K> UpdateFunction<K,K> noOp()
-
-