public interface IndexProvider extends IndexInformation
Modifier and Type | Method and Description |
---|---|
BaseTransactionConfigurable |
beginTransaction(BaseTransactionConfig config)
Returns a transaction handle for a new index transaction.
|
void |
clearStorage()
Clears the index and removes all entries in all stores.
|
void |
close()
Closes the index
|
void |
mutate(Map<String,Map<String,IndexMutation>> mutations,
KeyInformation.IndexRetriever informations,
BaseTransaction tx)
Mutates the index (adds and removes fields or entire documents)
|
List<String> |
query(IndexQuery query,
KeyInformation.IndexRetriever informations,
BaseTransaction tx)
Executes the given query against the index.
|
Iterable<RawQuery.Result<String>> |
query(RawQuery query,
KeyInformation.IndexRetriever informations,
BaseTransaction tx)
Executes the given raw query against the index
|
void |
register(String store,
String key,
KeyInformation information,
BaseTransaction tx)
This method registers a new key for the specified index store with the given data type.
|
void |
restore(Map<String,Map<String,List<IndexEntry>>> documents,
KeyInformation.IndexRetriever informations,
BaseTransaction tx)
Restores the index to the state of the primary data store as given in the
documents variable. |
getFeatures, mapKey2Field, supports, supports
void register(String store, String key, KeyInformation information, BaseTransaction tx) throws BackendException
store
- Index storekey
- New key to registerinformation
- Information on the key to registertx
- enclosing transactionBackendException
void mutate(Map<String,Map<String,IndexMutation>> mutations, KeyInformation.IndexRetriever informations, BaseTransaction tx) throws BackendException
mutations
- Updates to the index. First map contains all the mutations for each store. The inner map contains
all changes for each document in an IndexMutation
.informations
- Information on the keys used in the mutation accessible through KeyInformation.IndexRetriever
.tx
- Enclosing transactionBackendException
IndexMutation
void restore(Map<String,Map<String,List<IndexEntry>>> documents, KeyInformation.IndexRetriever informations, BaseTransaction tx) throws BackendException
documents
variable. When this method returns, the index records
for the given documents exactly matches the provided data. Unlike mutate(java.util.Map, KeyInformation.IndexRetriever, BaseTransaction)
this method does not do a delta-update, but entirely replaces the documents with the provided data or deletes them if the document content is empty.documents
- The outer map maps stores to documents, the inner contains the documents mapping document ids to the document content which is a
list of IndexEntry
. If that list is empty, that means this document should not exist and ought to be deleted.informations
- Information on the keys used in the mutation accessible through KeyInformation.IndexRetriever
.tx
- Enclosing transactionBackendException
List<String> query(IndexQuery query, KeyInformation.IndexRetriever informations, BaseTransaction tx) throws BackendException
query
- Query to executeinformations
- Information on the keys used in the query accessible through KeyInformation.IndexRetriever
.tx
- Enclosing transactionBackendException
IndexQuery
Iterable<RawQuery.Result<String>> query(RawQuery query, KeyInformation.IndexRetriever informations, BaseTransaction tx) throws BackendException
query
- Query to executeinformations
- Information on the keys used in the query accessible through KeyInformation.IndexRetriever
.tx
- Enclosing transactionBackendException
RawQuery
BaseTransactionConfigurable beginTransaction(BaseTransactionConfig config) throws BackendException
BackendException
void close() throws BackendException
BackendException
void clearStorage() throws BackendException
BackendException
Copyright © 2012–2017. All rights reserved.