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 blockedConstructor 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)
IndexerService
createNewIndexerContext
in interface IndexerService
connection
- Lucene connection@NotNull public IndexerContext lockIndexerQueue(@NotNull com.atlassian.bonnie.ILuceneConnection connection)
IndexerService
lockIndexerQueue
in interface IndexerService
connection
- Lucene connectionpublic void flushAndUnlockIndexerQueue(@NotNull IndexerContext indexerContext)
IndexerService
flushAndUnlockIndexerQueue
in interface IndexerService
indexerContext
- indexer context@NotNull public List<org.apache.lucene.document.Document> getMatchingDocuments(@NotNull IndexerContext indexerContext, @NotNull org.apache.lucene.search.Query query)
IndexerService
getMatchingDocuments
in interface IndexerService
indexerContext
- indexer contextquery
- query that will be executed on Lucene connection@NotNull public <T> List<T> getMatchingDocuments(@NotNull IndexerContext indexerContext, @NotNull IndexSearcherTask<T> innerTask)
IndexerService
getMatchingDocuments
in interface IndexerService
indexerContext
- 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)
IndexerService
addDocument
in interface IndexerService
indexerContext
- 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)
IndexerService
addDocuments
in interface IndexerService
indexerContext
- 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)
IndexerService
updateDocument
in interface IndexerService
indexerContext
- 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)
IndexerService
deleteDocuments
in interface IndexerService
indexerContext
- indexer contextterm
- term that identifies documents to be deleted@NotNull public com.google.common.util.concurrent.ListenableFuture batchUpdate(@NotNull IndexerContext indexerContext, @NotNull IndexerTask task)
IndexerService
batchUpdate
in interface IndexerService
indexerContext
- 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)
IndexerService
recreateIndexDirectory
in interface IndexerService
indexerContext
- 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.