-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Types removal - deprecate include_type_name with index templates #37484
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
Merged
markharwood
merged 16 commits into
elastic:master
from
markharwood:fix/35190TemplateDep
Jan 29, 2019
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b93c66d
Added deprecation warnings for use of include_type_name in put/get in…
markharwood 7a3ee63
Remove the mapping(“field1=type1”, “field2=type2”…) syntax on PutInde…
markharwood 2668570
Compilation issue
markharwood b67672b
Javadoc issue
markharwood 1105177
Remove client side logging because of forbidden APIs
markharwood 9ec52a3
Unused import
markharwood 64ae784
Stripped HLRC version of PutIndexTemplateRequest of all references to…
markharwood 56381a9
Added test for GetIndexTemplateResponse
markharwood 9823346
Unused imports
markharwood b1615f2
Unused imports
markharwood 2fb874b
Fixed naming convention check, added tests for misuses of typed and u…
markharwood 5f08782
Checkstyle fix
markharwood 1240b2e
Fix API naming convention checks
markharwood 925c064
Addressing review comments:
markharwood a0326e4
Added test for deprecation warning in RestPutIndexTemplateActionTests
markharwood aebbc9b
Changed mappings from String to convention of BytesReference
markharwood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
...-high-level/src/main/java/org/elasticsearch/client/indices/GetIndexTemplatesResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| /* | ||
| * Licensed to Elasticsearch under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
| package org.elasticsearch.client.indices; | ||
|
|
||
| import org.elasticsearch.common.xcontent.XContentParser; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.ArrayList; | ||
| import java.util.Comparator; | ||
| import java.util.List; | ||
| import java.util.Objects; | ||
|
|
||
|
|
||
| public class GetIndexTemplatesResponse { | ||
markharwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| @Override | ||
| public String toString() { | ||
| List<IndexTemplateMetaData> thisList = new ArrayList<>(this.indexTemplates); | ||
| thisList.sort(Comparator.comparing(IndexTemplateMetaData::name)); | ||
| return "GetIndexTemplatesResponse [indexTemplates=" + thisList + "]"; | ||
| } | ||
|
|
||
| private final List<IndexTemplateMetaData> indexTemplates; | ||
|
|
||
| GetIndexTemplatesResponse() { | ||
| indexTemplates = new ArrayList<>(); | ||
| } | ||
|
|
||
| GetIndexTemplatesResponse(List<IndexTemplateMetaData> indexTemplates) { | ||
| this.indexTemplates = indexTemplates; | ||
| } | ||
|
|
||
| public List<IndexTemplateMetaData> getIndexTemplates() { | ||
| return indexTemplates; | ||
| } | ||
|
|
||
|
|
||
| public static GetIndexTemplatesResponse fromXContent(XContentParser parser) throws IOException { | ||
| final List<IndexTemplateMetaData> templates = new ArrayList<>(); | ||
markharwood marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| for (XContentParser.Token token = parser.nextToken(); token != XContentParser.Token.END_OBJECT; token = parser.nextToken()) { | ||
| if (token == XContentParser.Token.FIELD_NAME) { | ||
| final IndexTemplateMetaData templateMetaData = IndexTemplateMetaData.Builder.fromXContent(parser, parser.currentName()); | ||
| templates.add(templateMetaData); | ||
| } | ||
| } | ||
| return new GetIndexTemplatesResponse(templates); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| List<IndexTemplateMetaData> sortedList = new ArrayList<>(this.indexTemplates); | ||
| sortedList.sort(Comparator.comparing(IndexTemplateMetaData::name)); | ||
| return Objects.hash(sortedList); | ||
| } | ||
|
|
||
| @Override | ||
| public boolean equals(Object obj) { | ||
| if (this == obj) | ||
| return true; | ||
| if (obj == null) | ||
| return false; | ||
| if (getClass() != obj.getClass()) | ||
| return false; | ||
| // To compare results we need to make sure the templates are listed in the same order | ||
| GetIndexTemplatesResponse other = (GetIndexTemplatesResponse) obj; | ||
| List<IndexTemplateMetaData> thisList = new ArrayList<>(this.indexTemplates); | ||
| List<IndexTemplateMetaData> otherList = new ArrayList<>(other.indexTemplates); | ||
| thisList.sort(Comparator.comparing(IndexTemplateMetaData::name)); | ||
| otherList.sort(Comparator.comparing(IndexTemplateMetaData::name)); | ||
| return Objects.equals(thisList, otherList); | ||
| } | ||
|
|
||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.