Interface UpdatableIndex<V>
- All Superinterfaces:
Index<V>,Iterable<Map.Entry<IndexKey,,V>> ModifiableIndex<V>
Represents an index that can be modifies using put and remove functions and that can be
serialized as an attribute in an
Obj interface via IndexContainer.-
Method Summary
Modifier and TypeMethodDescriptiontoIndexed(String prefix, BiConsumer<String, ? super Obj> persistObj) Build a serializable index container from this index object.toOptionalIndexed(String prefix, BiConsumer<String, ? super Obj> persistObj) Similar totoIndexed(String, BiConsumer), but returns an emptyOptional, if the index container is empty.Methods inherited from interface org.apache.polaris.persistence.nosql.api.index.Index
contains, get, iterator, iterator, prefetchIfNecessary, reverseIterator, reverseIteratorMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.polaris.persistence.nosql.api.index.ModifiableIndex
put, remove
-
Method Details
-
toIndexed
IndexContainer<V> toIndexed(@Nonnull String prefix, @Nonnull BiConsumer<String, ? super Obj> persistObj) Build a serializable index container from this index object. This updatable index may no longer be accessible after this function has been called, runtime exception may be thrown if the index is accessed after calling this function.- Parameters:
prefix- prefix to pass to the string argument of thepersistObjconsumer.persistObj- callback invoked to persist the object, to be delegated toCommitterState.writeOrReplace()- Returns:
- the updated
IndexContainer
-
toOptionalIndexed
Optional<IndexContainer<V>> toOptionalIndexed(@Nonnull String prefix, @Nonnull BiConsumer<String, ? super Obj> persistObj) Similar totoIndexed(String, BiConsumer), but returns an emptyOptional, if the index container is empty.
-