Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made template filtering generic and extensible #7454

Merged

Conversation

Projects
None yet
4 participants
@javanna
Copy link
Member

commented Aug 26, 2014

Added the ability to register index template filters that are being applied when a new index is created, in order to decide whether a matching index template should be applied or not. The default filter that checks whether the template pattern matches the index name always runs first, additional filters can also be registered so that templates can be filtered out based on custom logic.

Took the chance to add the handy source(Object... source) method to PutIndexTemplateRequest and corresponding builder.

Closes #7459

@javanna javanna self-assigned this Aug 26, 2014

@javanna javanna added the review label Aug 26, 2014

@javanna

This comment has been minimized.

Copy link
Member Author

commented Aug 26, 2014

@imotov since you had a look at the original PR from @uboness, can you have a look at this one? ;)

@javanna javanna force-pushed the javanna:enhancement/index_templates_filtering branch Aug 26, 2014

@imotov

This comment has been minimized.

Copy link
Member

commented Aug 26, 2014

LGTM

@spinscale

View changes

src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java Outdated
} else {
updatedSettingsBuilder.put(entry.getKey(), entry.getValue());
if (indexTemplateFilters.isEmpty()) {
this.indexTemplateFilter = new DefaultIndexTemplateFilter();

This comment has been minimized.

Copy link
@spinscale

spinscale Aug 27, 2014

Member

the default filter can be static instead of generated?

This comment has been minimized.

Copy link
@javanna

javanna Aug 27, 2014

Author Member

Right, good point!

@@ -192,6 +193,17 @@ public void validateIndexName(String index, ClusterState state) throws Elasticse
}

private void createIndex(final CreateIndexClusterStateUpdateRequest request, final ActionListener<ClusterStateUpdateResponse> listener, final Semaphore mdLock) {

ImmutableSettings.Builder updatedSettingsBuilder = ImmutableSettings.settingsBuilder();

This comment has been minimized.

Copy link
@spinscale

spinscale Aug 27, 2014

Member

not sure why these lines were added? is there a test to show this functionality?

This comment has been minimized.

Copy link
@javanna

javanna Aug 27, 2014

Author Member

they weren't added, the github comparison makes things a bit hard to read here...

@javanna javanna force-pushed the javanna:enhancement/index_templates_filtering branch Aug 27, 2014

Index templates: Made template filtering generic and extensible via p…
…lugins

Added the ability to register template filters that are being applied when a new index is created. The default filter that checks whether the template pattern matches the index name always runs first, additional filters can also be registered so that templates can be filtered out based on custom logic.

Took the chance to add the handy source(Object... source) method to PutIndexTemplateRequest and corresponding builder

Closes #7459
Closes #7454

@javanna javanna force-pushed the javanna:enhancement/index_templates_filtering branch to 92ae3c8 Aug 27, 2014

@javanna javanna merged commit 92ae3c8 into elastic:master Aug 27, 2014

javanna added a commit that referenced this pull request Aug 27, 2014

Index templates: Made template filtering generic and extensible via p…
…lugins

Added the ability to register template filters that are being applied when a new index is created. The default filter that checks whether the template pattern matches the index name always runs first, additional filters can also be registered so that templates can be filtered out based on custom logic.

Took the chance to add the handy source(Object... source) method to PutIndexTemplateRequest and corresponding builder

Closes #7459
Closes #7454

@javanna javanna removed the review label Aug 27, 2014

javanna added a commit that referenced this pull request Sep 8, 2014

Index templates: Made template filtering generic and extensible via p…
…lugins

Added the ability to register template filters that are being applied when a new index is created. The default filter that checks whether the template pattern matches the index name always runs first, additional filters can also be registered so that templates can be filtered out based on custom logic.

Took the chance to add the handy source(Object... source) method to PutIndexTemplateRequest and corresponding builder

Closes #7459
Closes #7454

@clintongormley clintongormley changed the title Index templates: made template filtering generic and extensible Index templates: Made template filtering generic and extensible Sep 8, 2014

@clintongormley clintongormley changed the title Index templates: Made template filtering generic and extensible Made template filtering generic and extensible Jun 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.