|
@@ -439,8 +439,7 @@ public class MetadataCreateIndexService {
|
|
|
* Given a state and index settings calculated after applying templates, validate metadata for
|
|
|
* the new index, returning an {@link IndexMetadata} for the new index
|
|
|
*/
|
|
|
- private IndexMetadata buildAndValidateTemporaryIndexMetadata(final ClusterState currentState,
|
|
|
- final Settings aggregatedIndexSettings,
|
|
|
+ private IndexMetadata buildAndValidateTemporaryIndexMetadata(final Settings aggregatedIndexSettings,
|
|
|
final CreateIndexClusterStateUpdateRequest request,
|
|
|
final int routingNumShards) {
|
|
|
|
|
@@ -481,7 +480,7 @@ public class MetadataCreateIndexService {
|
|
|
aggregateIndexSettings(currentState, request, MetadataIndexTemplateService.resolveSettings(templates),
|
|
|
null, settings, indexScopedSettings, shardLimitValidator, indexSettingProviders);
|
|
|
int routingNumShards = getIndexNumberOfRoutingShards(aggregatedIndexSettings, null);
|
|
|
- IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(currentState, aggregatedIndexSettings, request, routingNumShards);
|
|
|
+ IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(aggregatedIndexSettings, request, routingNumShards);
|
|
|
|
|
|
return applyCreateIndexWithTemporaryService(currentState, request, silent, null, tmpImd, List.of(mappings),
|
|
|
indexService -> resolveAndValidateAliases(request.index(), request.aliases(),
|
|
@@ -514,7 +513,7 @@ public class MetadataCreateIndexService {
|
|
|
MetadataIndexTemplateService.resolveSettings(currentState.metadata(), templateName),
|
|
|
null, settings, indexScopedSettings, shardLimitValidator, indexSettingProviders);
|
|
|
int routingNumShards = getIndexNumberOfRoutingShards(aggregatedIndexSettings, null);
|
|
|
- IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(currentState, aggregatedIndexSettings, request, routingNumShards);
|
|
|
+ IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(aggregatedIndexSettings, request, routingNumShards);
|
|
|
|
|
|
return applyCreateIndexWithTemporaryService(currentState, request, silent, null, tmpImd, mappings,
|
|
|
indexService -> resolveAndValidateAliases(request.index(), request.aliases(),
|
|
@@ -560,7 +559,7 @@ public class MetadataCreateIndexService {
|
|
|
final Settings aggregatedIndexSettings = aggregateIndexSettings(currentState, request, Settings.EMPTY,
|
|
|
sourceMetadata, settings, indexScopedSettings, shardLimitValidator, indexSettingProviders);
|
|
|
final int routingNumShards = getIndexNumberOfRoutingShards(aggregatedIndexSettings, sourceMetadata);
|
|
|
- IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(currentState, aggregatedIndexSettings, request, routingNumShards);
|
|
|
+ IndexMetadata tmpImd = buildAndValidateTemporaryIndexMetadata(aggregatedIndexSettings, request, routingNumShards);
|
|
|
|
|
|
return applyCreateIndexWithTemporaryService(currentState, request, silent, sourceMetadata, tmpImd, List.of(mappings),
|
|
|
indexService -> resolveAndValidateAliases(request.index(), request.aliases(), Collections.emptyList(),
|