Package com.couchbase.lite
Interface IndexUpdater
- All Superinterfaces:
ArrayInterface,AutoCloseable,Iterable<Object>
Enterprise Only
IndexUpdater used for updating the index in lazy mode. Currently, the vector index
is the only index type that can be updated lazily.
Note!!
The finish() function implicitly closes the IndexUpdater if it succeeds.
Use of a closed IndexUpdater or any container (Dict or Array) obtained
from it will throw an CouchbaseLiteError.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the updater without a checked exceptionvoidfinish()Updates the index with the computed vectors and removes any index rows for which null vector was given.voidSets the vector for the value corresponding to the index.voidskipVector(int index) Skip setting the vector for the value corresponding to the index.Methods inherited from interface com.couchbase.lite.ArrayInterface
count, getArray, getBlob, getBoolean, getDate, getDictionary, getDouble, getFloat, getInt, getLong, getNumber, getString, getValue, toJSON, toListMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
setVector
Sets the vector for the value corresponding to the index. Setting null value means that there is no vector for the value, and any existing vector will be removed when the finish() is called.- Parameters:
value- the vector.index- the index at which to place the vector.- Throws:
CouchbaseLiteException
-
skipVector
void skipVector(int index) Skip setting the vector for the value corresponding to the index. The vector will be required to compute and set again for the value when the QueryIndex's beginUpdate() is later called for updating the index. -
finish
Updates the index with the computed vectors and removes any index rows for which null vector was given. If there are any indexes that do not have their vector value set or are skipped, a CouchbaseLiteException will be thrown.Note: Before calling the finish() function, the set vectors are kept in the memory.
- Throws:
CouchbaseLiteException
-
close
void close()Close the updater without a checked exception- Specified by:
closein interfaceAutoCloseable
-