From 13dcb8ccbef75dbc68ea0a93a45f052c0be17580 Mon Sep 17 00:00:00 2001 From: javanna Date: Wed, 4 Jan 2017 15:56:25 +0100 Subject: [PATCH] remove ParseFieldMatcher usages from IngestMetadata --- .../main/java/org/elasticsearch/ingest/IngestMetadata.java | 6 ++---- .../org/elasticsearch/ingest/PipelineConfiguration.java | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/ingest/IngestMetadata.java b/core/src/main/java/org/elasticsearch/ingest/IngestMetadata.java index 6c87d6c5892..012ce5ba68d 100644 --- a/core/src/main/java/org/elasticsearch/ingest/IngestMetadata.java +++ b/core/src/main/java/org/elasticsearch/ingest/IngestMetadata.java @@ -24,8 +24,6 @@ import org.elasticsearch.cluster.DiffableUtils; import org.elasticsearch.cluster.NamedDiff; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.ParseField; -import org.elasticsearch.common.ParseFieldMatcher; -import org.elasticsearch.common.ParseFieldMatcherSupplier; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.ObjectParser; @@ -47,7 +45,7 @@ public final class IngestMetadata implements MetaData.Custom { public static final String TYPE = "ingest"; private static final ParseField PIPELINES_FIELD = new ParseField("pipeline"); - private static final ObjectParser, ParseFieldMatcherSupplier> INGEST_METADATA_PARSER = new ObjectParser<>( + private static final ObjectParser, Void> INGEST_METADATA_PARSER = new ObjectParser<>( "ingest_metadata", ArrayList::new); static { @@ -95,7 +93,7 @@ public final class IngestMetadata implements MetaData.Custom { public static IngestMetadata fromXContent(XContentParser parser) throws IOException { Map pipelines = new HashMap<>(); - List configs = INGEST_METADATA_PARSER.parse(parser, () -> ParseFieldMatcher.STRICT); + List configs = INGEST_METADATA_PARSER.parse(parser, null); for (PipelineConfiguration pipeline : configs) { pipelines.put(pipeline.getId(), pipeline); } diff --git a/core/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java b/core/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java index c983c205f8d..543a02d3e86 100644 --- a/core/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java +++ b/core/src/main/java/org/elasticsearch/ingest/PipelineConfiguration.java @@ -50,8 +50,8 @@ public final class PipelineConfiguration extends AbstractDiffable getParser() { - return (p, c) -> PARSER.apply(p ,c).build(); + public static ContextParser getParser() { + return (parser, context) -> PARSER.apply(parser, null).build(); } private static class Builder {