public class SQLiteViewStore extends java.lang.Object implements ViewStore, QueryRowStore
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TAG |
| Modifier | Constructor and Description |
|---|---|
protected |
SQLiteViewStore(SQLiteStore store,
java.lang.String name,
boolean create) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the storage.
|
void |
deleteIndex()
Erases the view's _index.
|
void |
deleteView()
Deletes the view's storage (metadata and _index), removing it from the database.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
dump()
Methods for debugging
|
protected void |
emit(java.lang.Object key,
java.lang.Object value,
long sequence) |
ViewStoreDelegate |
getDelegate()
The delegate (in practice, the owning View itself.)
|
java.util.Map<java.lang.String,java.lang.Object> |
getDocumentProperties(java.lang.String docID,
long sequence)
Fetches a document's body; called when the row value represents the entire document.
|
long |
getLastSequenceChangedAt()
The last sequence number that caused an actual change in the _index.
|
long |
getLastSequenceIndexed()
The last sequence number that has been indexed.
|
java.lang.String |
getName()
The name of the view.
|
int |
getTotalRows()
The total number of rows in the _index.
|
static java.lang.Object |
groupKey(java.lang.Object key,
int groupLevel)
Returns the prefix of the key to use in the result row, at this groupLevel
|
java.lang.Object |
parseRowValue(byte[] valueData)
Parses a "normal" (not entire-doc) row value into a JSON-compatible object.
|
java.util.List<QueryRow> |
reducedQuery(QueryOptions options)
Queries the view, with reducing or grouping as per the options.
|
java.util.List<QueryRow> |
regularQuery(QueryOptions options)
Queries the view without performing any reducing or grouping.
|
boolean |
rowValueIsEntireDoc(byte[] valueData)
Given the raw data of a row's value, returns YES if this is a non-JSON placeholder representing
the entire document.
|
void |
setCollation(View.TDViewCollation collation) |
void |
setDelegate(ViewStoreDelegate delegate) |
boolean |
setVersion(java.lang.String version)
Updates the version of the view.
|
Status |
updateIndexes(java.util.List<ViewStore> inputViews)
Updates the indexes of one or more views in parallel.
|
protected SQLiteViewStore(SQLiteStore store, java.lang.String name, boolean create) throws CouchbaseLiteException
CouchbaseLiteExceptionpublic java.lang.String getName()
ViewStorepublic ViewStoreDelegate getDelegate()
ViewStoregetDelegate in interface ViewStorepublic void setDelegate(ViewStoreDelegate delegate)
setDelegate in interface ViewStorepublic void setCollation(View.TDViewCollation collation)
setCollation in interface ViewStorepublic void close()
ViewStorepublic void deleteIndex()
ViewStoredeleteIndex in interface ViewStorepublic void deleteView()
ViewStoredeleteView in interface ViewStorepublic boolean setVersion(java.lang.String version)
setVersion in interface ViewStorepublic int getTotalRows()
ViewStoregetTotalRows in interface ViewStorepublic long getLastSequenceIndexed()
getLastSequenceIndexed in interface ViewStorepublic long getLastSequenceChangedAt()
ViewStoregetLastSequenceChangedAt in interface ViewStorepublic Status updateIndexes(java.util.List<ViewStore> inputViews) throws CouchbaseLiteException
updateIndexes in interface ViewStoreinputViews - An array of ViewStore instances, always including the receiver.CouchbaseLiteExceptionprotected void emit(java.lang.Object key,
java.lang.Object value,
long sequence)
throws JsonProcessingException
JsonProcessingExceptionpublic java.util.List<QueryRow> regularQuery(QueryOptions options) throws CouchbaseLiteException
regularQuery in interface ViewStoreCouchbaseLiteExceptionpublic java.util.List<QueryRow> reducedQuery(QueryOptions options) throws CouchbaseLiteException
reducedQuery in interface ViewStoreCouchbaseLiteExceptionpublic java.util.List<java.util.Map<java.lang.String,java.lang.Object>> dump()
ViewStorepublic boolean rowValueIsEntireDoc(byte[] valueData)
QueryRowStorerowValueIsEntireDoc in interface QueryRowStorepublic java.lang.Object parseRowValue(byte[] valueData)
QueryRowStoreparseRowValue in interface QueryRowStorepublic java.util.Map<java.lang.String,java.lang.Object> getDocumentProperties(java.lang.String docID,
long sequence)
QueryRowStoregetDocumentProperties in interface QueryRowStoredocID - The document IDsequence - The sequence representing this revisionpublic static java.lang.Object groupKey(java.lang.Object key,
int groupLevel)