|
20 | 20 |
|
21 | 21 | import com.carrotsearch.hppc.cursors.ObjectCursor; |
22 | 22 | import com.carrotsearch.hppc.cursors.ObjectObjectCursor; |
23 | | -import org.apache.logging.log4j.LogManager; |
24 | 23 | import org.elasticsearch.ElasticsearchParseException; |
25 | 24 | import org.elasticsearch.cluster.AbstractDiffable; |
26 | 25 | import org.elasticsearch.cluster.Diff; |
|
32 | 31 | import org.elasticsearch.common.compress.CompressedXContent; |
33 | 32 | import org.elasticsearch.common.io.stream.StreamInput; |
34 | 33 | import org.elasticsearch.common.io.stream.StreamOutput; |
35 | | -import org.elasticsearch.common.logging.DeprecationLogger; |
36 | 34 | import org.elasticsearch.common.settings.Settings; |
37 | 35 | import org.elasticsearch.common.util.set.Sets; |
38 | 36 | import org.elasticsearch.common.xcontent.ToXContent; |
|
52 | 50 |
|
53 | 51 | public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaData> { |
54 | 52 |
|
55 | | - private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(IndexTemplateMetaData.class)); |
56 | | - |
57 | 53 | private final String name; |
58 | 54 |
|
59 | 55 | private final int order; |
@@ -97,7 +93,7 @@ public IndexTemplateMetaData(String name, int order, Integer version, |
97 | 93 | this.name = name; |
98 | 94 | this.order = order; |
99 | 95 | this.version = version; |
100 | | - this.patterns= patterns; |
| 96 | + this.patterns = patterns; |
101 | 97 | this.settings = settings; |
102 | 98 | this.mappings = mappings; |
103 | 99 | this.aliases = aliases; |
@@ -227,7 +223,7 @@ public void writeTo(StreamOutput out) throws IOException { |
227 | 223 | public static class Builder { |
228 | 224 |
|
229 | 225 | private static final Set<String> VALID_FIELDS = Sets.newHashSet( |
230 | | - "template", "order", "mappings", "settings", "index_patterns", "aliases", "version"); |
| 226 | + "order", "mappings", "settings", "index_patterns", "aliases", "version"); |
231 | 227 |
|
232 | 228 | private String name; |
233 | 229 |
|
@@ -487,11 +483,7 @@ public static IndexTemplateMetaData fromXContent(XContentParser parser, String t |
487 | 483 | builder.patterns(index_patterns); |
488 | 484 | } |
489 | 485 | } else if (token.isValue()) { |
490 | | - // Prior to 5.1.0, elasticsearch only supported a single index pattern called `template` (#21009) |
491 | | - if("template".equals(currentFieldName)) { |
492 | | - deprecationLogger.deprecated("Deprecated field [template] used, replaced by [index_patterns]"); |
493 | | - builder.patterns(Collections.singletonList(parser.text())); |
494 | | - } else if ("order".equals(currentFieldName)) { |
| 486 | + if ("order".equals(currentFieldName)) { |
495 | 487 | builder.order(parser.intValue()); |
496 | 488 | } else if ("version".equals(currentFieldName)) { |
497 | 489 | builder.version(parser.intValue()); |
|
0 commit comments