public class IndexerServiceImpl extends Object implements IndexerService, org.springframework.beans.factory.DisposableBean
MAX_QUEUE_SIZE_PER_CONNECTION
- if the capacity of ExecutorService queue is exceeded, the thread that submits add/update/remove operation will be blocked| Constructor and Description |
|---|
IndexerServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture |
addDocument(IndexerContext indexerContext,
org.apache.lucene.document.Document document)
Submit add document request
|
com.google.common.util.concurrent.ListenableFuture |
addDocuments(IndexerContext indexerContext,
Iterable<org.apache.lucene.document.Document> documents)
Submit add documents request
|
com.google.common.util.concurrent.ListenableFuture |
batchUpdate(IndexerContext indexerContext,
IndexerTask task)
Submit batch update request
|
static <V> com.google.common.util.concurrent.ListenableFutureTask<V> |
createAuthorisedTask(Callable<V> callable) |
IndexerContext |
createNewIndexerContext(com.atlassian.bonnie.ILuceneConnection connection)
Create new default indexer context.
|
com.google.common.util.concurrent.ListenableFuture |
deleteDocuments(IndexerContext indexerContext,
org.apache.lucene.index.Term term)
Submit delete documents request
|
void |
destroy() |
void |
flushAndUnlockIndexerQueue(IndexerContext indexerContext)
Unlock indexer and submit for execution all operations that were queued while index was locked
|
<T> List<T> |
getMatchingDocuments(IndexerContext indexerContext,
IndexSearcherTask<T> innerTask)
Submit a custom search task for execution
|
List<org.apache.lucene.document.Document> |
getMatchingDocuments(IndexerContext indexerContext,
org.apache.lucene.search.Query query)
Submit a document search query
|
IndexerContext |
lockIndexerQueue(com.atlassian.bonnie.ILuceneConnection connection)
Lock indexer and return a context that will allow executing operations while indexer is locked.
|
com.google.common.util.concurrent.ListenableFuture |
recreateIndexDirectory(IndexerContext indexerContext)
Submit recreate index directory request
|
com.google.common.util.concurrent.ListenableFuture |
updateDocument(IndexerContext indexerContext,
org.apache.lucene.index.Term term,
org.apache.lucene.document.Document document)
Submit update document request
|
public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBean@NotNull public IndexerContext createNewIndexerContext(@NotNull com.atlassian.bonnie.ILuceneConnection connection)
IndexerServicecreateNewIndexerContext in interface IndexerServiceconnection - Lucene connection@NotNull public IndexerContext lockIndexerQueue(@NotNull com.atlassian.bonnie.ILuceneConnection connection)
IndexerServicelockIndexerQueue in interface IndexerServiceconnection - Lucene connectionpublic void flushAndUnlockIndexerQueue(@NotNull
IndexerContext indexerContext)
IndexerServiceflushAndUnlockIndexerQueue in interface IndexerServiceindexerContext - indexer context@NotNull public List<org.apache.lucene.document.Document> getMatchingDocuments(@NotNull IndexerContext indexerContext, @NotNull org.apache.lucene.search.Query query)
IndexerServicegetMatchingDocuments in interface IndexerServiceindexerContext - indexer contextquery - query that will be executed on Lucene connection@NotNull public <T> List<T> getMatchingDocuments(@NotNull IndexerContext indexerContext, @NotNull IndexSearcherTask<T> innerTask)
IndexerServicegetMatchingDocuments in interface IndexerServiceindexerContext - indexer contextinnerTask - search task to get executed@NotNull
public com.google.common.util.concurrent.ListenableFuture addDocument(@NotNull
IndexerContext indexerContext,
@NotNull
org.apache.lucene.document.Document document)
IndexerServiceaddDocument in interface IndexerServiceindexerContext - indexer contextdocument - document to be added to index@NotNull
public com.google.common.util.concurrent.ListenableFuture addDocuments(@NotNull
IndexerContext indexerContext,
@NotNull
Iterable<org.apache.lucene.document.Document> documents)
IndexerServiceaddDocuments in interface IndexerServiceindexerContext - indexer contextdocuments - documents to be added to index@NotNull
public com.google.common.util.concurrent.ListenableFuture updateDocument(@NotNull
IndexerContext indexerContext,
@NotNull
org.apache.lucene.index.Term term,
@NotNull
org.apache.lucene.document.Document document)
IndexerServiceupdateDocument in interface IndexerServiceindexerContext - indexer contextterm - term that identifies document that is about to be updateddocument - new document that will be added to index@NotNull
public com.google.common.util.concurrent.ListenableFuture deleteDocuments(@NotNull
IndexerContext indexerContext,
@NotNull
org.apache.lucene.index.Term term)
IndexerServicedeleteDocuments in interface IndexerServiceindexerContext - indexer contextterm - term that identifies documents to be deleted@NotNull
public com.google.common.util.concurrent.ListenableFuture batchUpdate(@NotNull
IndexerContext indexerContext,
@NotNull
IndexerTask task)
IndexerServicebatchUpdate in interface IndexerServiceindexerContext - indexer contexttask - task to be executed within ILuceneConnection.withBatchUpdate(com.atlassian.bonnie.ILuceneConnection.BatchUpdateAction)@NotNull
public com.google.common.util.concurrent.ListenableFuture recreateIndexDirectory(@NotNull
IndexerContext indexerContext)
IndexerServicerecreateIndexDirectory in interface IndexerServiceindexerContext - indexer contextpublic static <V> com.google.common.util.concurrent.ListenableFutureTask<V> createAuthorisedTask(@NotNull
Callable<V> callable)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.