Class ConfiguredIndexingPlanSynchronizationStrategy.Builder
- java.lang.Object
-
- org.hibernate.search.mapper.pojo.work.spi.ConfiguredIndexingPlanSynchronizationStrategy.Builder
-
- All Implemented Interfaces:
IndexingPlanSynchronizationStrategyConfigurationContext
- Enclosing class:
- ConfiguredIndexingPlanSynchronizationStrategy
public static final class ConfiguredIndexingPlanSynchronizationStrategy.Builder extends Object implements IndexingPlanSynchronizationStrategyConfigurationContext
-
-
Constructor Summary
Constructors Constructor Description Builder(FailureHandler failureHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfiguredIndexingPlanSynchronizationStrategybuild()voiddocumentCommitStrategy(DocumentCommitStrategy strategy)voiddocumentRefreshStrategy(DocumentRefreshStrategy strategy)FailureHandlerfailureHandler()voidindexingFutureHandler(Consumer<? super CompletableFuture<? extends SearchIndexingPlanExecutionReport>> handler)Set the handler for the (asynchronous) indexing future.voidoperationSubmitter(OperationSubmitter operationSubmitter)Set operation submitter to be applied while executing underlying plans.
-
-
-
Constructor Detail
-
Builder
public Builder(FailureHandler failureHandler)
-
-
Method Detail
-
documentCommitStrategy
public void documentCommitStrategy(DocumentCommitStrategy strategy)
- Specified by:
documentCommitStrategyin interfaceIndexingPlanSynchronizationStrategyConfigurationContext- Parameters:
strategy- A strategy describing how commits should be handled after document changes are applied. Defaults toDocumentCommitStrategy.NONE.
-
documentRefreshStrategy
public void documentRefreshStrategy(DocumentRefreshStrategy strategy)
- Specified by:
documentRefreshStrategyin interfaceIndexingPlanSynchronizationStrategyConfigurationContext- Parameters:
strategy- A strategy describing how refresh should be handled after document changes are applied. Defaults toDocumentRefreshStrategy.NONE.
-
indexingFutureHandler
public void indexingFutureHandler(Consumer<? super CompletableFuture<? extends SearchIndexingPlanExecutionReport>> handler)
Description copied from interface:IndexingPlanSynchronizationStrategyConfigurationContextSet the handler for the (asynchronous) indexing future.This typically involves waiting on the given future, to prevent the thread from resuming execution until indexing is complete.
- Specified by:
indexingFutureHandlerin interfaceIndexingPlanSynchronizationStrategyConfigurationContext- Parameters:
handler- A handler that will be passed a future representing the progress of indexing. Defaults to a no-op handler. The future will be completed with an execution report once all document changes are applied. If any document change or the commit/refresh required byIndexingPlanSynchronizationStrategyConfigurationContext.documentCommitStrategy(DocumentCommitStrategy)andIndexingPlanSynchronizationStrategyConfigurationContext.documentRefreshStrategy(DocumentRefreshStrategy)failed, the report willcontain a throwableand (if applicable)a list of failing entities.
-
failureHandler
public FailureHandler failureHandler()
- Specified by:
failureHandlerin interfaceIndexingPlanSynchronizationStrategyConfigurationContext- Returns:
- The failure handler.
Use this to report failures that cannot be propagated by the
IndexingPlanSynchronizationStrategyConfigurationContext.indexingFutureHandler(Consumer).
-
operationSubmitter
public void operationSubmitter(OperationSubmitter operationSubmitter)
Description copied from interface:IndexingPlanSynchronizationStrategyConfigurationContextSet operation submitter to be applied while executing underlying plans.Using
OperationSubmitter.BLOCKINGby default.- Specified by:
operationSubmitterin interfaceIndexingPlanSynchronizationStrategyConfigurationContext- Parameters:
operationSubmitter- How to handle request to submit operation when the queue is full- See Also:
OperationSubmitter
-
build
public ConfiguredIndexingPlanSynchronizationStrategy build()
-
-