Remove ParseFieldMatcher usages from IndexSettings
This commit is contained in:
parent
4449eb181b
commit
64c3212fdb
|
@ -20,7 +20,6 @@
|
||||||
package org.elasticsearch.cluster.routing.allocation.command;
|
package org.elasticsearch.cluster.routing.allocation.command;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcherSupplier;
|
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.ObjectParser;
|
import org.elasticsearch.common.xcontent.ObjectParser;
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.lucene.index.MergePolicy;
|
import org.apache.lucene.index.MergePolicy;
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||||
import org.elasticsearch.common.ParseFieldMatcher;
|
|
||||||
import org.elasticsearch.common.logging.Loggers;
|
import org.elasticsearch.common.logging.Loggers;
|
||||||
import org.elasticsearch.common.settings.IndexScopedSettings;
|
import org.elasticsearch.common.settings.IndexScopedSettings;
|
||||||
import org.elasticsearch.common.settings.Setting;
|
import org.elasticsearch.common.settings.Setting;
|
||||||
|
@ -136,7 +135,6 @@ public final class IndexSettings {
|
||||||
private final Settings nodeSettings;
|
private final Settings nodeSettings;
|
||||||
private final int numberOfShards;
|
private final int numberOfShards;
|
||||||
private final boolean isShadowReplicaIndex;
|
private final boolean isShadowReplicaIndex;
|
||||||
private final ParseFieldMatcher parseFieldMatcher;
|
|
||||||
// volatile fields are updated via #updateIndexMetaData(IndexMetaData) under lock
|
// volatile fields are updated via #updateIndexMetaData(IndexMetaData) under lock
|
||||||
private volatile Settings settings;
|
private volatile Settings settings;
|
||||||
private volatile IndexMetaData indexMetaData;
|
private volatile IndexMetaData indexMetaData;
|
||||||
|
@ -237,7 +235,6 @@ public final class IndexSettings {
|
||||||
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);
|
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings);
|
||||||
this.queryStringAnalyzeWildcard = QUERY_STRING_ANALYZE_WILDCARD.get(nodeSettings);
|
this.queryStringAnalyzeWildcard = QUERY_STRING_ANALYZE_WILDCARD.get(nodeSettings);
|
||||||
this.queryStringAllowLeadingWildcard = QUERY_STRING_ALLOW_LEADING_WILDCARD.get(nodeSettings);
|
this.queryStringAllowLeadingWildcard = QUERY_STRING_ALLOW_LEADING_WILDCARD.get(nodeSettings);
|
||||||
this.parseFieldMatcher = new ParseFieldMatcher(settings);
|
|
||||||
this.defaultAllowUnmappedFields = scopedSettings.get(ALLOW_UNMAPPED);
|
this.defaultAllowUnmappedFields = scopedSettings.get(ALLOW_UNMAPPED);
|
||||||
this.durability = scopedSettings.get(INDEX_TRANSLOG_DURABILITY_SETTING);
|
this.durability = scopedSettings.get(INDEX_TRANSLOG_DURABILITY_SETTING);
|
||||||
syncInterval = INDEX_TRANSLOG_SYNC_INTERVAL_SETTING.get(settings);
|
syncInterval = INDEX_TRANSLOG_SYNC_INTERVAL_SETTING.get(settings);
|
||||||
|
@ -388,11 +385,6 @@ public final class IndexSettings {
|
||||||
return nodeSettings;
|
return nodeSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a {@link ParseFieldMatcher} for this index.
|
|
||||||
*/
|
|
||||||
public ParseFieldMatcher getParseFieldMatcher() { return parseFieldMatcher; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the settings and index metadata and notifies all registered settings consumers with the new settings iff at least one setting has changed.
|
* Updates the settings and index metadata and notifies all registered settings consumers with the new settings iff at least one setting has changed.
|
||||||
*
|
*
|
||||||
|
|
|
@ -22,7 +22,6 @@ package org.elasticsearch.ingest;
|
||||||
import org.elasticsearch.cluster.AbstractDiffable;
|
import org.elasticsearch.cluster.AbstractDiffable;
|
||||||
import org.elasticsearch.cluster.Diff;
|
import org.elasticsearch.cluster.Diff;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcherSupplier;
|
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -40,7 +39,7 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
public final class PipelineConfiguration extends AbstractDiffable<PipelineConfiguration> implements ToXContent {
|
public final class PipelineConfiguration extends AbstractDiffable<PipelineConfiguration> implements ToXContent {
|
||||||
|
|
||||||
private static final ObjectParser<Builder, ParseFieldMatcherSupplier> PARSER = new ObjectParser<>("pipeline_config", Builder::new);
|
private static final ObjectParser<Builder, Void> PARSER = new ObjectParser<>("pipeline_config", Builder::new);
|
||||||
static {
|
static {
|
||||||
PARSER.declareString(Builder::setId, new ParseField("id"));
|
PARSER.declareString(Builder::setId, new ParseField("id"));
|
||||||
PARSER.declareField((parser, builder, aVoid) -> {
|
PARSER.declareField((parser, builder, aVoid) -> {
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
package org.elasticsearch.search.aggregations.bucket.histogram;
|
package org.elasticsearch.search.aggregations.bucket.histogram;
|
||||||
|
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcherSupplier;
|
|
||||||
import org.elasticsearch.common.ParsingException;
|
import org.elasticsearch.common.ParsingException;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
|
@ -51,7 +50,7 @@ public class HistogramAggregationBuilder
|
||||||
extends ValuesSourceAggregationBuilder<ValuesSource.Numeric, HistogramAggregationBuilder> {
|
extends ValuesSourceAggregationBuilder<ValuesSource.Numeric, HistogramAggregationBuilder> {
|
||||||
public static final String NAME = "histogram";
|
public static final String NAME = "histogram";
|
||||||
|
|
||||||
private static final ObjectParser<double[], ParseFieldMatcherSupplier> EXTENDED_BOUNDS_PARSER = new ObjectParser<>(
|
private static final ObjectParser<double[], Void> EXTENDED_BOUNDS_PARSER = new ObjectParser<>(
|
||||||
Histogram.EXTENDED_BOUNDS_FIELD.getPreferredName(),
|
Histogram.EXTENDED_BOUNDS_FIELD.getPreferredName(),
|
||||||
() -> new double[]{ Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY });
|
() -> new double[]{ Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY });
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -22,7 +22,6 @@ import org.elasticsearch.ElasticsearchException;
|
||||||
import org.elasticsearch.client.Requests;
|
import org.elasticsearch.client.Requests;
|
||||||
import org.elasticsearch.common.Nullable;
|
import org.elasticsearch.common.Nullable;
|
||||||
import org.elasticsearch.common.ParseField;
|
import org.elasticsearch.common.ParseField;
|
||||||
import org.elasticsearch.common.ParseFieldMatcherSupplier;
|
|
||||||
import org.elasticsearch.common.Strings;
|
import org.elasticsearch.common.Strings;
|
||||||
import org.elasticsearch.common.bytes.BytesReference;
|
import org.elasticsearch.common.bytes.BytesReference;
|
||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class RestSearchTemplateAction extends BaseRestHandler {
|
||||||
|
|
||||||
// Creates the search request with all required params
|
// Creates the search request with all required params
|
||||||
SearchRequest searchRequest = new SearchRequest();
|
SearchRequest searchRequest = new SearchRequest();
|
||||||
RestSearchAction.parseSearchRequest(searchRequest, request, parseFieldMatcher, null);
|
RestSearchAction.parseSearchRequest(searchRequest, request, null);
|
||||||
|
|
||||||
// Creates the search template request
|
// Creates the search template request
|
||||||
SearchTemplateRequest searchTemplateRequest;
|
SearchTemplateRequest searchTemplateRequest;
|
||||||
|
|
|
@ -62,7 +62,7 @@ public abstract class AbstractBulkByQueryRestHandler<
|
||||||
* the generated parser probably is a noop but we should do the accounting just in case. It doesn't hurt to close twice but it
|
* the generated parser probably is a noop but we should do the accounting just in case. It doesn't hurt to close twice but it
|
||||||
* really hurts not to close if by some miracle we have to. */
|
* really hurts not to close if by some miracle we have to. */
|
||||||
try {
|
try {
|
||||||
RestSearchAction.parseSearchRequest(searchRequest, restRequest, parseFieldMatcher, searchRequestParser);
|
RestSearchAction.parseSearchRequest(searchRequest, restRequest, searchRequestParser);
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.close(searchRequestParser);
|
IOUtils.close(searchRequestParser);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue