Skip to content

Commit

Permalink
HSEARCH-4843 Add deprecations/@Incubating that should have been added…
Browse files Browse the repository at this point in the history
… in previous issues
  • Loading branch information
yrodiere committed May 1, 2023
1 parent 754121f commit 7b64b0f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
7 changes: 5 additions & 2 deletions documentation/src/main/asciidoc/migration/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,10 @@ This affects the following configuration properties:
** `hibernate.search.backend.query.caching.configurer`
** `hibernate.search.mapping.configurer`

Additionally, some configuration properties have been deprecated:

* `hibernate.search.automatic_indexing.synchronization.strategy` is now deprecated in favor of `hibernate.search.indexing.plan.synchronization.strategy`.

[[api]]
== API changes

Expand Down Expand Up @@ -352,8 +356,7 @@ which enable the syntax `f.composite((p1, p2, p3) -> ..., <some projection>, <so
use the (more flexible) syntax `f.composite().from(<some projection>, <some projection>, <some projection>).as((p1, p2, p3) -> ...)` instead.
* `SearchSession#automaticIndexingSynchronizationStrategy(..)` and related `AutomaticIndexingSynchronizationStrategy`/`AutomaticIndexingSynchronizationConfigurationContext`/`AutomaticIndexingSynchronizationStrategyNames`:
use `SearchSession#indexingPlanSynchronizationStrategy(..)` and `IndexingPlanSynchronizationStrategy`/`IndexingPlanSynchronizationStrategyConfigurationContext`/`IndexingPlanSynchronizationStrategyNames` instead.
Note new API is still incubating and might change.
Also, configuration property `hibernate.search.automatic_indexing.synchronization.strategy` is now deprecated in favor of `hibernate.search.indexing.plan.synchronization.strategy`
Note the new API is still incubating and might change.

[[spi]]
== SPI changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.hibernate.search.mapper.orm.automaticindexing.session.AutomaticIndexingSynchronizationStrategyNames;
import org.hibernate.search.mapper.orm.cfg.HibernateOrmMapperSettings;
import org.hibernate.search.mapper.orm.logging.impl.Log;
import org.hibernate.search.mapper.orm.work.SearchIndexingPlanExecutionReport;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
import org.hibernate.search.util.common.SearchException;
Expand Down Expand Up @@ -676,7 +675,8 @@ public void apply(AutomaticIndexingSynchronizationConfigurationContext context)
// try to wait for the future to complete for a small duration...
try {
future.get( SMALL_DURATION_VALUE, SMALL_DURATION_UNIT );
SearchIndexingPlanExecutionReport report = future.get( SMALL_DURATION_VALUE, SMALL_DURATION_UNIT );
org.hibernate.search.mapper.orm.work.SearchIndexingPlanExecutionReport report =
future.get( SMALL_DURATION_VALUE, SMALL_DURATION_UNIT );
report.throwable().ifPresent( t -> {
throw log.indexingFailure( t.getMessage(), report.failingEntities(), t );
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.hibernate.search.engine.backend.work.execution.DocumentRefreshStrategy;
import org.hibernate.search.engine.backend.work.execution.OperationSubmitter;
import org.hibernate.search.engine.reporting.FailureHandler;
import org.hibernate.search.mapper.orm.work.SearchIndexingPlanExecutionReport;
import org.hibernate.search.mapper.pojo.work.IndexingPlanSynchronizationStrategyConfigurationContext;
import org.hibernate.search.util.common.annotation.Incubating;

Expand Down Expand Up @@ -46,10 +45,10 @@ public interface AutomaticIndexingSynchronizationConfigurationContext {
* The future will be completed with an execution report once all document changes are applied.
* If any document change or the commit/refresh required by{@link #documentCommitStrategy(DocumentCommitStrategy)}
* and {@link #documentRefreshStrategy(DocumentRefreshStrategy)} failed,
* the report will {@link SearchIndexingPlanExecutionReport#throwable() contain a throwable}
* and (if applicable) {@link SearchIndexingPlanExecutionReport#failingEntities() a list of failing entities}.
* the report will {@link org.hibernate.search.mapper.orm.work.SearchIndexingPlanExecutionReport#throwable() contain a throwable}
* and (if applicable) {@link org.hibernate.search.mapper.orm.work.SearchIndexingPlanExecutionReport#failingEntities() a list of failing entities}.
*/
void indexingFutureHandler(Consumer<CompletableFuture<SearchIndexingPlanExecutionReport>> handler);
void indexingFutureHandler(Consumer<CompletableFuture<org.hibernate.search.mapper.orm.work.SearchIndexingPlanExecutionReport>> handler);

/**
* @return The failure handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

import org.hibernate.search.mapper.orm.common.EntityReference;

/**
* @deprecated Use {@link org.hibernate.search.mapper.pojo.work.SearchIndexingPlanExecutionReport}
*/
@Deprecated
public interface SearchIndexingPlanExecutionReport {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import java.util.List;
import java.util.Optional;

import org.hibernate.search.util.common.annotation.Incubating;

@Incubating
public interface SearchIndexingPlanExecutionReport {

/**
Expand Down

0 comments on commit 7b64b0f

Please sign in to comment.