Class AliasValidator
java.lang.Object
org.elasticsearch.cluster.metadata.AliasValidator
Validator for an alias, to be used before adding an alias to the index metadata
and make sure the alias is valid
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Validate a proposed alias.void
validateAlias(Alias alias, String index, Metadata metadata)
Allows to validate anAlias
and make sure it's valid before it gets added to the index metadata.void
validateAliasFilter(String alias, String filter, SearchExecutionContext searchExecutionContext, org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry)
Validates an alias filter by parsing it using the providedSearchExecutionContext
void
validateAliasFilter(String alias, BytesReference filter, SearchExecutionContext searchExecutionContext, org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry)
Validates an alias filter by parsing it using the providedSearchExecutionContext
void
validateAliasMetadata(AliasMetadata aliasMetadata, String index, Metadata metadata)
Allows to validate anAliasMetadata
and make sure it's valid before it gets added to the index metadata.void
validateAliasStandalone(Alias alias)
Allows to partially validate an alias, without knowing which index it'll get applied to.
-
Constructor Details
-
AliasValidator
public AliasValidator()
-
-
Method Details
-
validateAlias
Allows to validate anAlias
and make sure it's valid before it gets added to the index metadata. Doesn't validate the alias filter.- Throws:
IllegalArgumentException
- if the alias is not valid
-
validateAliasMetadata
Allows to validate anAliasMetadata
and make sure it's valid before it gets added to the index metadata. Doesn't validate the alias filter.- Throws:
IllegalArgumentException
- if the alias is not valid
-
validateAliasStandalone
Allows to partially validate an alias, without knowing which index it'll get applied to. Useful with index templates containing aliases. Checks also that it is possible to parse the alias filter viaXContentParser
, without validating it as a filter though.- Throws:
IllegalArgumentException
- if the alias is not valid
-
validateAlias
public void validateAlias(String alias, String index, @Nullable String indexRouting, Function<String,String> lookup)Validate a proposed alias. -
validateAliasFilter
public void validateAliasFilter(String alias, String filter, SearchExecutionContext searchExecutionContext, org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry)Validates an alias filter by parsing it using the providedSearchExecutionContext
- Throws:
IllegalArgumentException
- if the filter is not valid
-
validateAliasFilter
public void validateAliasFilter(String alias, BytesReference filter, SearchExecutionContext searchExecutionContext, org.elasticsearch.common.xcontent.NamedXContentRegistry xContentRegistry)Validates an alias filter by parsing it using the providedSearchExecutionContext
- Throws:
IllegalArgumentException
- if the filter is not valid
-