Skip to content

Commit

Permalink
hsearch-es: Drop the deprecated '.index-defaults.foo' syntax for spec…
Browse files Browse the repository at this point in the history
…ifying default configuration for indexes
  • Loading branch information
yrodiere committed Aug 3, 2020
1 parent c926b01 commit d908226
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,6 @@ public static <T> void addBackendConfig(BiConsumer<String, Object> propertyColle
}
}

@Deprecated
public static void addBackendDefaultIndexConfig(BiConsumer<String, Object> propertyCollector, String backendName,
String configPath, Optional<?> value) {
addBackendDefaultIndexConfig(propertyCollector, backendName, configPath, value, Optional::isPresent, Optional::get);
}

@Deprecated
public static void addBackendDefaultIndexConfig(BiConsumer<String, Object> propertyCollector, String backendName,
String configPath, OptionalInt value) {
addBackendDefaultIndexConfig(propertyCollector, backendName, configPath, value, OptionalInt::isPresent,
OptionalInt::getAsInt);
}

@Deprecated
public static <T> void addBackendDefaultIndexConfig(BiConsumer<String, Object> propertyCollector, String backendName,
String configPath, T value,
Function<T, Boolean> shouldBeAdded, Function<T, ?> getValue) {
addBackendConfig(propertyCollector, backendName, BackendSettings.INDEX_DEFAULTS + "." + configPath, value,
shouldBeAdded, getValue);
}

public static void addBackendIndexConfig(BiConsumer<String, Object> propertyCollector, String backendName,
String indexName, String configPath, Optional<?> value) {
addBackendIndexConfig(propertyCollector, backendName, indexName, configPath, value, Optional::isPresent, Optional::get);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.quarkus.hibernate.search.elasticsearch.runtime;

import static io.quarkus.hibernate.search.elasticsearch.runtime.HibernateSearchConfigUtil.addBackendConfig;
import static io.quarkus.hibernate.search.elasticsearch.runtime.HibernateSearchConfigUtil.addBackendDefaultIndexConfig;
import static io.quarkus.hibernate.search.elasticsearch.runtime.HibernateSearchConfigUtil.addBackendIndexConfig;
import static io.quarkus.hibernate.search.elasticsearch.runtime.HibernateSearchConfigUtil.addConfig;

Expand Down Expand Up @@ -144,26 +143,6 @@ private void contributeBackendRuntimeProperties(BiConsumer<String, Object> prope
contributeBackendIndexRuntimeProperties(propertyCollector, backendName, null,
elasticsearchBackendConfig.indexDefaults);

// Deprecated .index-defaults.foo syntax for index defaults
// (Hibernate Search will log warnings if these properties are used)
addBackendDefaultIndexConfig(propertyCollector, backendName,
ElasticsearchIndexSettings.SCHEMA_MANAGEMENT_MINIMAL_REQUIRED_STATUS,
elasticsearchBackendConfig.legacyIndexDefaults.schemaManagement.requiredStatus);
addBackendDefaultIndexConfig(propertyCollector, backendName,
ElasticsearchIndexSettings.SCHEMA_MANAGEMENT_MINIMAL_REQUIRED_STATUS_WAIT_TIMEOUT,
elasticsearchBackendConfig.legacyIndexDefaults.schemaManagement.requiredStatusWaitTimeout,
Optional::isPresent,
d -> d.get().toMillis());
addBackendDefaultIndexConfig(propertyCollector, backendName,
ElasticsearchIndexSettings.INDEXING_QUEUE_COUNT,
elasticsearchBackendConfig.legacyIndexDefaults.indexing.queueCount);
addBackendDefaultIndexConfig(propertyCollector, backendName,
ElasticsearchIndexSettings.INDEXING_QUEUE_SIZE,
elasticsearchBackendConfig.legacyIndexDefaults.indexing.queueSize);
addBackendDefaultIndexConfig(propertyCollector, backendName,
ElasticsearchIndexSettings.INDEXING_MAX_BULK_SIZE,
elasticsearchBackendConfig.legacyIndexDefaults.indexing.maxBulkSize);

for (Entry<String, ElasticsearchIndexConfig> indexConfigEntry : runtimeConfig.defaultBackend.indexes.entrySet()) {
String indexName = indexConfigEntry.getKey();
ElasticsearchIndexConfig indexConfig = indexConfigEntry.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ public static class ElasticsearchBackendRuntimeConfig {
@ConfigItem(name = ConfigItem.PARENT)
ElasticsearchIndexConfig indexDefaults;

/**
* @deprecated Define index defaults directly at the backend level instead of using {@code index-defaults};
* e.g. use simply {@code quarkus.hibernate-search.elasticsearch.indexing.queue.count}
* instead of {@code quarkus.hibernate-search.elasticsearch.index-defaults.indexing.queue.count}.
*/
@ConfigItem(name = "index-defaults")
@Deprecated
ElasticsearchIndexConfig legacyIndexDefaults;

/**
* Per-index specific configuration.
*/
Expand Down

0 comments on commit d908226

Please sign in to comment.