Interface IndexIndexingPlan<R>
-
- Type Parameters:
R
- The type of entity references in theexecution report
.
public interface IndexIndexingPlan<R>
A set of works to be executed on a single index.Works are accumulated when methods such as
add(DocumentReferenceProvider, DocumentContributor)
oraddOrUpdate(DocumentReferenceProvider, DocumentContributor)
are called, and executed only whenexecute()
is called.Relative ordering of works within a plan will be preserved.
Implementations may not be thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
add(DocumentReferenceProvider documentReferenceProvider, DocumentContributor documentContributor)
Add a document to the index, assuming that the document is absent from the index.void
addOrUpdate(DocumentReferenceProvider documentReferenceProvider, DocumentContributor documentContributor)
Update a document in the index, or add it if it's absent from the index.void
delete(DocumentReferenceProvider documentReferenceProvider)
Delete a document from the index.void
discard()
Discard all works that are present in this plan.default CompletableFuture<?>
execute()
Start executing all the works in this plan, and clear the plan so that it can be re-used.CompletableFuture<IndexIndexingPlanExecutionReport<R>>
executeAndReport()
Start executing all the works in this plan, and clear the plan so that it can be re-used.
-
-
-
Method Detail
-
add
void add(DocumentReferenceProvider documentReferenceProvider, DocumentContributor documentContributor)
Add a document to the index, assuming that the document is absent from the index.- Parameters:
documentReferenceProvider
- A source of information about the identity of the document to add.documentContributor
- A contributor to the document, adding fields to the indexed document.
-
addOrUpdate
void addOrUpdate(DocumentReferenceProvider documentReferenceProvider, DocumentContributor documentContributor)
Update a document in the index, or add it if it's absent from the index.- Parameters:
documentReferenceProvider
- A source of information about the identity of the document to update.documentContributor
- A contributor to the document, adding fields to the indexed document.
-
delete
void delete(DocumentReferenceProvider documentReferenceProvider)
Delete a document from the index.- Parameters:
documentReferenceProvider
- A source of information about the identity of the document to delete.
-
execute
default CompletableFuture<?> execute()
Start executing all the works in this plan, and clear the plan so that it can be re-used.- Returns:
- A
CompletableFuture
that will be completed when all the works are complete. The future will be completed with an exception if a work failed.
-
executeAndReport
CompletableFuture<IndexIndexingPlanExecutionReport<R>> executeAndReport()
Start executing all the works in this plan, and clear the plan so that it can be re-used.- Returns:
- A
CompletableFuture
that will hold an execution report when all the works are complete. The future will be completed normally even if a work failed, but the report will contain an exception.
-
discard
void discard()
Discard all works that are present in this plan.
-
-