Lowercase static final DeprecationLogger instance names (#34887)
After discussing on the team's FixItFriday, we concluded that static final instance variables that are mutable should be lowercased. Historically, DeprecationLogger was uppercased more frequently than lowercased.
This commit is contained in:
parent
3cde1356c1
commit
e1fdd00420
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.CharArraySet;
|
||||
import org.apache.lucene.analysis.LowerCaseFilter;
|
||||
|
@ -115,7 +116,6 @@ import org.elasticsearch.client.Client;
|
|||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.regex.Regex;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.env.Environment;
|
||||
|
@ -151,7 +151,7 @@ import static org.elasticsearch.plugins.AnalysisPlugin.requiresAnalysisSettings;
|
|||
|
||||
public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, ScriptPlugin {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(CommonAnalysisPlugin.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(CommonAnalysisPlugin.class));
|
||||
|
||||
private final SetOnce<ScriptService> scriptService = new SetOnce<>();
|
||||
|
||||
|
@ -376,7 +376,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
filters.add(PreConfiguredCharFilter.singleton("html_strip", false, HTMLStripCharFilter::new));
|
||||
filters.add(PreConfiguredCharFilter.singletonWithVersion("htmlStrip", false, (reader, version) -> {
|
||||
if (version.onOrAfter(org.elasticsearch.Version.V_6_3_0)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("htmlStrip_deprecation",
|
||||
deprecationLogger.deprecatedAndMaybeLog("htmlStrip_deprecation",
|
||||
"The [htmpStrip] char filter name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the filter name to [html_strip] instead.");
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
new EdgeNGramTokenFilter(input, 1)));
|
||||
filters.add(PreConfiguredTokenFilter.singletonWithVersion("edgeNGram", false, (reader, version) -> {
|
||||
if (version.onOrAfter(org.elasticsearch.Version.V_6_4_0)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("edgeNGram_deprecation",
|
||||
deprecationLogger.deprecatedAndMaybeLog("edgeNGram_deprecation",
|
||||
"The [edgeNGram] token filter name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the filter name to [edge_ngram] instead.");
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
filters.add(PreConfiguredTokenFilter.singleton("ngram", false, reader -> new NGramTokenFilter(reader, 1, 2, false)));
|
||||
filters.add(PreConfiguredTokenFilter.singletonWithVersion("nGram", false, (reader, version) -> {
|
||||
if (version.onOrAfter(org.elasticsearch.Version.V_6_4_0)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("nGram_deprecation",
|
||||
deprecationLogger.deprecatedAndMaybeLog("nGram_deprecation",
|
||||
"The [nGram] token filter name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the filter name to [ngram] instead.");
|
||||
}
|
||||
|
|
|
@ -19,16 +19,16 @@
|
|||
|
||||
package org.elasticsearch.analysis.common;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.index.IndexSettings;
|
||||
|
||||
public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTokenFilterFactory {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
new DeprecationLogger(Loggers.getLogger(LegacyDelimitedPayloadTokenFilterFactory.class));
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(LegacyDelimitedPayloadTokenFilterFactory.class));
|
||||
|
||||
LegacyDelimitedPayloadTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
|
||||
super(indexSettings, env, name, settings);
|
||||
|
@ -37,7 +37,7 @@ public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTo
|
|||
"[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead");
|
||||
}
|
||||
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_2_0)) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]");
|
||||
deprecationLogger.deprecated("Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.percolator;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.DelegatingAnalyzerWrapper;
|
||||
import org.apache.lucene.index.BinaryDocValues;
|
||||
|
@ -54,7 +55,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
|||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.common.xcontent.XContent;
|
||||
|
@ -95,7 +95,7 @@ import static org.elasticsearch.percolator.PercolatorFieldMapper.parseQuery;
|
|||
public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBuilder> {
|
||||
public static final String NAME = "percolate";
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(ParseField.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ParseField.class));
|
||||
|
||||
static final ParseField DOCUMENT_FIELD = new ParseField("document");
|
||||
static final ParseField DOCUMENTS_FIELD = new ParseField("documents");
|
||||
|
@ -577,7 +577,7 @@ public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBu
|
|||
final MapperService mapperService = context.getMapperService();
|
||||
String type = mapperService.documentMapper().type();
|
||||
if (documentType != null) {
|
||||
DEPRECATION_LOGGER.deprecated("[document_type] parameter has been deprecated because types have been deprecated");
|
||||
deprecationLogger.deprecated("[document_type] parameter has been deprecated because types have been deprecated");
|
||||
if (documentType.equals(type) == false) {
|
||||
throw new IllegalArgumentException("specified document_type [" + documentType +
|
||||
"] is not equal to the actual type [" + type + "]");
|
||||
|
|
|
@ -77,7 +77,7 @@ final class Ec2ClientSettings {
|
|||
|
||||
private static final Logger logger = Loggers.getLogger(Ec2ClientSettings.class);
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(logger);
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
/** Credentials to authenticate with ec2. */
|
||||
final AWSCredentials credentials;
|
||||
|
@ -135,11 +135,11 @@ final class Ec2ClientSettings {
|
|||
return null;
|
||||
} else {
|
||||
if (key.length() == 0) {
|
||||
DEPRECATION_LOGGER.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future",
|
||||
deprecationLogger.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future",
|
||||
SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey());
|
||||
}
|
||||
if (secret.length() == 0) {
|
||||
DEPRECATION_LOGGER.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future",
|
||||
deprecationLogger.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future",
|
||||
ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey());
|
||||
}
|
||||
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
|
||||
package org.elasticsearch.http;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.elasticsearch.common.ParsingException;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.lucene.search.Queries;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
|
@ -41,7 +41,8 @@ import java.io.IOException;
|
|||
public class TestDeprecatedQueryBuilder extends AbstractQueryBuilder<TestDeprecatedQueryBuilder> {
|
||||
public static final String NAME = "deprecated_match_all";
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(TestDeprecatedQueryBuilder.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||
LogManager.getLogger(TestDeprecatedQueryBuilder.class));
|
||||
|
||||
public TestDeprecatedQueryBuilder() {
|
||||
// nothing to do
|
||||
|
@ -79,7 +80,7 @@ public class TestDeprecatedQueryBuilder extends AbstractQueryBuilder<TestDepreca
|
|||
|
||||
@Override
|
||||
protected Query doToQuery(QueryShardContext context) throws IOException {
|
||||
DEPRECATION_LOGGER.deprecated("[{}] query is deprecated, but used on [{}] index", NAME, context.index().getName());
|
||||
deprecationLogger.deprecated("[{}] query is deprecated, but used on [{}] index", NAME, context.index().getName());
|
||||
|
||||
return Queries.newMatchAllQuery();
|
||||
}
|
||||
|
|
|
@ -69,7 +69,7 @@ import static org.elasticsearch.common.settings.Settings.writeSettingsToStream;
|
|||
*/
|
||||
public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateRequest> implements IndicesRequest, ToXContent {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(PutIndexTemplateRequest.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(PutIndexTemplateRequest.class));
|
||||
|
||||
private String name;
|
||||
|
||||
|
@ -313,7 +313,7 @@ public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateR
|
|||
if (name.equals("template")) {
|
||||
// This is needed to allow for bwc (beats, logstash) with pre-5.0 templates (#21009)
|
||||
if(entry.getValue() instanceof String) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated field [template] used, replaced by [index_patterns]");
|
||||
deprecationLogger.deprecated("Deprecated field [template] used, replaced by [index_patterns]");
|
||||
patterns(Collections.singletonList((String) entry.getValue()));
|
||||
}
|
||||
} else if (name.equals("index_patterns")) {
|
||||
|
|
|
@ -53,7 +53,7 @@ import java.util.Set;
|
|||
|
||||
public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaData> {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(IndexTemplateMetaData.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(IndexTemplateMetaData.class));
|
||||
|
||||
private final String name;
|
||||
|
||||
|
@ -451,7 +451,7 @@ public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaDat
|
|||
} else if (token.isValue()) {
|
||||
// Prior to 5.1.0, elasticsearch only supported a single index pattern called `template` (#21009)
|
||||
if("template".equals(currentFieldName)) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated field [template] used, replaced by [index_patterns]");
|
||||
deprecationLogger.deprecated("Deprecated field [template] used, replaced by [index_patterns]");
|
||||
builder.patterns(Collections.singletonList(parser.text()));
|
||||
} else if ("order".equals(currentFieldName)) {
|
||||
builder.order(parser.intValue());
|
||||
|
|
|
@ -41,7 +41,7 @@ public class DateUtils {
|
|||
return DateTimeZone.forID(zoneId.getId());
|
||||
}
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(DateFormatters.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(DateFormatters.class));
|
||||
// pkg private for tests
|
||||
static final Map<String, String> DEPRECATED_SHORT_TIMEZONES;
|
||||
static {
|
||||
|
@ -61,7 +61,7 @@ public class DateUtils {
|
|||
|
||||
String deprecatedId = DEPRECATED_SHORT_TIMEZONES.get(timeZone.getID());
|
||||
if (deprecatedId != null) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("timezone",
|
||||
deprecationLogger.deprecatedAndMaybeLog("timezone",
|
||||
"Use of short timezone id " + timeZone.getID() + " is deprecated. Use " + deprecatedId + " instead");
|
||||
return ZoneId.of(deprecatedId);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Objects;
|
|||
|
||||
public class ByteSizeValue implements Writeable, Comparable<ByteSizeValue>, ToXContentFragment {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ByteSizeValue.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ByteSizeValue.class));
|
||||
|
||||
public static final ByteSizeValue ZERO = new ByteSizeValue(0, ByteSizeUnit.BYTES);
|
||||
|
||||
|
@ -237,7 +237,7 @@ public class ByteSizeValue implements Writeable, Comparable<ByteSizeValue>, ToXC
|
|||
} catch (final NumberFormatException e) {
|
||||
try {
|
||||
final double doubleValue = Double.parseDouble(s);
|
||||
DEPRECATION_LOGGER.deprecated(
|
||||
deprecationLogger.deprecated(
|
||||
"Fractional bytes values are deprecated. Use non-fractional bytes values instead: [{}] found for setting [{}]",
|
||||
initialInput, settingName);
|
||||
return new ByteSizeValue((long) (doubleValue * unit.toBytes(1)));
|
||||
|
|
|
@ -42,7 +42,7 @@ public class LoggingDeprecationHandler implements DeprecationHandler {
|
|||
* Changing that will require some research to make super duper
|
||||
* sure it is safe.
|
||||
*/
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ParseField.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ParseField.class));
|
||||
|
||||
private LoggingDeprecationHandler() {
|
||||
// Singleton
|
||||
|
@ -50,11 +50,11 @@ public class LoggingDeprecationHandler implements DeprecationHandler {
|
|||
|
||||
@Override
|
||||
public void usedDeprecatedName(String usedName, String modernName) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated field [{}] used, expected [{}] instead", usedName, modernName);
|
||||
deprecationLogger.deprecated("Deprecated field [{}] used, expected [{}] instead", usedName, modernName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void usedDeprecatedField(String usedName, String replacedWith) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated field [{}] used, replaced by [{}]", usedName, replacedWith);
|
||||
deprecationLogger.deprecated("Deprecated field [{}] used, replaced by [{}]", usedName, replacedWith);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.elasticsearch.common.Booleans.parseBoolean;
|
|||
|
||||
public class HttpInfo implements Writeable, ToXContentFragment {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(HttpInfo.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(HttpInfo.class));
|
||||
|
||||
/** Whether to add hostname to publish host field when serializing. */
|
||||
private static final boolean CNAME_IN_PUBLISH_HOST =
|
||||
|
@ -86,7 +86,7 @@ public class HttpInfo implements Writeable, ToXContentFragment {
|
|||
if (cnameInPublishHost) {
|
||||
publishAddressString = hostString + '/' + publishAddress.toString();
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated(
|
||||
deprecationLogger.deprecated(
|
||||
"[http.publish_host] was printed as [ip:port] instead of [hostname/ip:port]. "
|
||||
+ "This format is deprecated and will change to [hostname/ip:port] in a future version. "
|
||||
+ "Use -Des.http.cname_in_publish_address=true to enforce non-deprecated formatting."
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.TreeMap;
|
|||
|
||||
public class DynamicTemplate implements ToXContentObject {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(DynamicTemplate.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(DynamicTemplate.class));
|
||||
|
||||
public enum MatchType {
|
||||
SIMPLE {
|
||||
|
@ -208,7 +208,7 @@ public class DynamicTemplate implements ToXContentObject {
|
|||
if (indexVersionCreated.onOrAfter(Version.V_6_0_0_alpha1)) {
|
||||
throw e;
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("match_mapping_type [" + matchMappingType + "] is invalid and will be ignored: "
|
||||
deprecationLogger.deprecated("match_mapping_type [" + matchMappingType + "] is invalid and will be ignored: "
|
||||
+ e.getMessage());
|
||||
// this template is on an unknown type so it will never match anything
|
||||
// null indicates that the template should be ignored
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.util.Objects;
|
|||
*/
|
||||
public class FieldNamesFieldMapper extends MetadataFieldMapper {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||
LogManager.getLogger(FieldNamesFieldMapper.class));
|
||||
|
||||
public static final String NAME = "_field_names";
|
||||
|
@ -184,7 +184,7 @@ public class FieldNamesFieldMapper extends MetadataFieldMapper {
|
|||
if (isEnabled() == false) {
|
||||
throw new IllegalStateException("Cannot run [exists] queries if the [_field_names] field is disabled");
|
||||
}
|
||||
DEPRECATION_LOGGER.deprecated(
|
||||
deprecationLogger.deprecated(
|
||||
"terms query on the _field_names field is deprecated and will be removed, use exists query instead");
|
||||
return super.termQuery(value, context);
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
|
|||
"_size", "_timestamp", "_ttl", IgnoredFieldMapper.NAME
|
||||
);
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(MapperService.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(MapperService.class));
|
||||
|
||||
private final IndexAnalyzers indexAnalyzers;
|
||||
|
||||
|
@ -408,7 +408,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
|
|||
throw new IllegalArgumentException("The [default] mapping cannot be updated on index [" + index().getName() +
|
||||
"]: defaults mappings are not useful anymore now that indices can have at most one type.");
|
||||
} else if (reason == MergeReason.MAPPING_UPDATE) { // only log in case of explicit mapping updates
|
||||
DEPRECATION_LOGGER.deprecated("[_default_] mapping is deprecated since it is not useful anymore now that indexes " +
|
||||
deprecationLogger.deprecated("[_default_] mapping is deprecated since it is not useful anymore now that indexes " +
|
||||
"cannot have more than one type");
|
||||
}
|
||||
assert defaultMapper.type().equals(DEFAULT_MAPPING);
|
||||
|
|
|
@ -92,7 +92,7 @@ public class TypeFieldMapper extends MetadataFieldMapper {
|
|||
|
||||
static final class TypeFieldType extends StringFieldType {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TypeFieldType.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TypeFieldType.class));
|
||||
|
||||
TypeFieldType() {
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ public class TypeFieldMapper extends MetadataFieldMapper {
|
|||
|
||||
@Override
|
||||
public Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("range_single_type",
|
||||
deprecationLogger.deprecatedAndMaybeLog("range_single_type",
|
||||
"Running [range] query on [_type] field for an index with a single type. As types are deprecated, this functionality will be removed in future releases.");
|
||||
Query result = new MatchAllDocsQuery();
|
||||
String type = context.getMapperService().documentMapper().type();
|
||||
|
|
|
@ -40,7 +40,7 @@ public class TypeQueryBuilder extends AbstractQueryBuilder<TypeQueryBuilder> {
|
|||
public static final String NAME = "type";
|
||||
|
||||
private static final ParseField VALUE_FIELD = new ParseField("value");
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TypeQueryBuilder.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TypeQueryBuilder.class));
|
||||
|
||||
private final String type;
|
||||
|
||||
|
@ -127,7 +127,7 @@ public class TypeQueryBuilder extends AbstractQueryBuilder<TypeQueryBuilder> {
|
|||
|
||||
@Override
|
||||
protected Query doToQuery(QueryShardContext context) throws IOException {
|
||||
DEPRECATION_LOGGER.deprecated("The [type] query is deprecated, filter on a field instead.");
|
||||
deprecationLogger.deprecated("The [type] query is deprecated, filter on a field instead.");
|
||||
//LUCENE 4 UPGRADE document mapper should use bytesref as well?
|
||||
DocumentMapper documentMapper = context.getMapperService().documentMapper(type);
|
||||
if (documentMapper == null) {
|
||||
|
|
|
@ -40,7 +40,7 @@ import java.util.Objects;
|
|||
*/
|
||||
public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScoreFunctionBuilder> {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||
LogManager.getLogger(RandomScoreFunctionBuilder.class));
|
||||
|
||||
public static final String NAME = "random_score";
|
||||
|
@ -168,7 +168,7 @@ public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScore
|
|||
if (field != null) {
|
||||
fieldType = context.getMapperService().fullName(field);
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated(
|
||||
deprecationLogger.deprecated(
|
||||
"As of version 7.0 Elasticsearch will require that a [field] parameter is provided when a [seed] is set");
|
||||
fieldType = context.getMapperService().fullName(IdFieldMapper.NAME);
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ final class SimilarityProviders {
|
|||
|
||||
private SimilarityProviders() {} // no instantiation
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(SimilarityProviders.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(SimilarityProviders.class));
|
||||
static final String DISCOUNT_OVERLAPS = "discount_overlaps";
|
||||
|
||||
private static final Map<String, BasicModel> BASIC_MODELS;
|
||||
|
@ -143,7 +143,7 @@ final class SimilarityProviders {
|
|||
throw new IllegalArgumentException("Basic model [" + basicModel + "] isn't supported anymore, " +
|
||||
"please use another model.");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("Basic model [" + basicModel +
|
||||
deprecationLogger.deprecated("Basic model [" + basicModel +
|
||||
"] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "].");
|
||||
model = BASIC_MODELS.get(replacement);
|
||||
assert model != null;
|
||||
|
@ -174,7 +174,7 @@ final class SimilarityProviders {
|
|||
throw new IllegalArgumentException("After effect [" + afterEffect +
|
||||
"] isn't supported anymore, please use another effect.");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("After effect [" + afterEffect +
|
||||
deprecationLogger.deprecated("After effect [" + afterEffect +
|
||||
"] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "].");
|
||||
effect = AFTER_EFFECTS.get(replacement);
|
||||
assert effect != null;
|
||||
|
@ -264,7 +264,7 @@ final class SimilarityProviders {
|
|||
if (version.onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
throw new IllegalArgumentException("Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
|
||||
deprecationLogger.deprecated("Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ import java.util.function.Supplier;
|
|||
|
||||
public final class SimilarityService extends AbstractIndexComponent {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(SimilarityService.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(SimilarityService.class));
|
||||
public static final String DEFAULT_SIMILARITY = "BM25";
|
||||
private static final String CLASSIC_SIMILARITY = "classic";
|
||||
private static final Map<String, Function<Version, Supplier<Similarity>>> DEFAULTS;
|
||||
|
@ -67,7 +67,7 @@ public final class SimilarityService extends AbstractIndexComponent {
|
|||
} else {
|
||||
final ClassicSimilarity similarity = SimilarityProviders.createClassicSimilarity(Settings.EMPTY, version);
|
||||
return () -> {
|
||||
DEPRECATION_LOGGER.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally "
|
||||
deprecationLogger.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally "
|
||||
+ "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity "
|
||||
+ "instead.");
|
||||
return similarity;
|
||||
|
@ -90,7 +90,7 @@ public final class SimilarityService extends AbstractIndexComponent {
|
|||
throw new IllegalArgumentException("The [classic] similarity may not be used anymore. Please use the [BM25] "
|
||||
+ "similarity or build a custom [scripted] similarity instead.");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally "
|
||||
deprecationLogger.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally "
|
||||
+ "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity "
|
||||
+ "instead.");
|
||||
return SimilarityProviders.createClassicSimilarity(settings, version);
|
||||
|
@ -154,7 +154,7 @@ public final class SimilarityService extends AbstractIndexComponent {
|
|||
defaultSimilarity = (providers.get("default") != null) ? providers.get("default").get()
|
||||
: providers.get(SimilarityService.DEFAULT_SIMILARITY).get();
|
||||
if (providers.get("base") != null) {
|
||||
DEPRECATION_LOGGER.deprecated("The [base] similarity is ignored since query normalization and coords have been removed");
|
||||
deprecationLogger.deprecated("The [base] similarity is ignored since query normalization and coords have been removed");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ public final class SimilarityService extends AbstractIndexComponent {
|
|||
if (indexCreatedVersion.onOrAfter(Version.V_7_0_0_alpha1)) {
|
||||
throw new IllegalArgumentException(message);
|
||||
} else if (indexCreatedVersion.onOrAfter(Version.V_6_5_0)) {
|
||||
DEPRECATION_LOGGER.deprecated(message);
|
||||
deprecationLogger.deprecated(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ public final class AnalysisModule {
|
|||
|
||||
private static final IndexSettings NA_INDEX_SETTINGS;
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(AnalysisModule.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(AnalysisModule.class));
|
||||
|
||||
private final HunspellService hunspellService;
|
||||
private final AnalysisRegistry analysisRegistry;
|
||||
|
@ -125,7 +125,7 @@ public final class AnalysisModule {
|
|||
@Override
|
||||
public TokenFilterFactory get(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
|
||||
if (indexSettings.getIndexVersionCreated().before(Version.V_7_0_0_alpha1)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("standard_deprecation",
|
||||
deprecationLogger.deprecatedAndMaybeLog("standard_deprecation",
|
||||
"The [standard] token filter name is deprecated and will be removed in a future version.");
|
||||
} else {
|
||||
throw new IllegalArgumentException("The [standard] token filter has been removed.");
|
||||
|
@ -183,7 +183,7 @@ public final class AnalysisModule {
|
|||
preConfiguredTokenFilters.register( "standard",
|
||||
PreConfiguredTokenFilter.singletonWithVersion("standard", true, (reader, version) -> {
|
||||
if (version.before(Version.V_7_0_0_alpha1)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("standard_deprecation",
|
||||
deprecationLogger.deprecatedAndMaybeLog("standard_deprecation",
|
||||
"The [standard] token filter is deprecated and will be removed in a future version.");
|
||||
} else {
|
||||
throw new IllegalArgumentException("The [standard] token filter has been removed.");
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.Collections;
|
|||
|
||||
public class RestPutIndexTemplateAction extends BaseRestHandler {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||
LogManager.getLogger(RestPutIndexTemplateAction.class));
|
||||
|
||||
public RestPutIndexTemplateAction(Settings settings, RestController controller) {
|
||||
|
@ -54,7 +54,7 @@ public class RestPutIndexTemplateAction extends BaseRestHandler {
|
|||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
PutIndexTemplateRequest putRequest = new PutIndexTemplateRequest(request.param("name"));
|
||||
if (request.hasParam("template")) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated parameter[template] used, replaced by [index_patterns]");
|
||||
deprecationLogger.deprecated("Deprecated parameter[template] used, replaced by [index_patterns]");
|
||||
putRequest.patterns(Collections.singletonList(request.param("template")));
|
||||
} else {
|
||||
putRequest.patterns(Arrays.asList(request.paramAsStringArray("index_patterns", Strings.EMPTY_ARRAY)));
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RestSearchAction extends BaseRestHandler {
|
|||
|
||||
public static final String TYPED_KEYS_PARAM = "typed_keys";
|
||||
private static final Set<String> RESPONSE_PARAMS = Collections.singleton(TYPED_KEYS_PARAM);
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class));
|
||||
|
||||
public RestSearchAction(Settings settings, RestController controller) {
|
||||
super(settings);
|
||||
|
@ -157,7 +157,7 @@ public class RestSearchAction extends BaseRestHandler {
|
|||
throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the search API with the " +
|
||||
"[{index}/_search] endpoint.");
|
||||
}
|
||||
DEPRECATION_LOGGER.deprecated("The {index}/{type}/_search endpoint is deprecated, use {index}/_search instead");
|
||||
deprecationLogger.deprecated("The {index}/{type}/_search endpoint is deprecated, use {index}/_search instead");
|
||||
}
|
||||
searchRequest.types(Strings.splitStringByCommaToArray(types));
|
||||
searchRequest.routing(request.param("routing"));
|
||||
|
|
|
@ -47,13 +47,13 @@ import java.util.Locale;
|
|||
* A wrapper around ZonedDateTime that exposes joda methods for backcompat.
|
||||
*/
|
||||
public class JodaCompatibleZonedDateTime {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(JodaCompatibleZonedDateTime.class));
|
||||
|
||||
private static void logDeprecated(String key, String message, Object... params) {
|
||||
// NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts
|
||||
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog(key, message, params);
|
||||
deprecationLogger.deprecatedAndMaybeLog(key, message, params);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import java.util.Set;
|
|||
|
||||
public final class ParameterMap implements Map<String, Object> {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(ParameterMap.class));
|
||||
|
||||
private final Map<String, Object> params;
|
||||
|
@ -64,7 +64,7 @@ public final class ParameterMap implements Map<String, Object> {
|
|||
public Object get(final Object key) {
|
||||
String deprecationMessage = deprecations.get(key);
|
||||
if (deprecationMessage != null) {
|
||||
DEPRECATION_LOGGER.deprecated(deprecationMessage);
|
||||
deprecationLogger.deprecated(deprecationMessage);
|
||||
}
|
||||
return params.get(key);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public final class ScriptMetaData implements MetaData.Custom, Writeable, ToXCont
|
|||
/**
|
||||
* Standard deprecation logger for used to deprecate allowance of empty templates.
|
||||
*/
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ScriptMetaData.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ScriptMetaData.class));
|
||||
|
||||
/**
|
||||
* A builder used to modify the currently stored scripts data held within
|
||||
|
@ -219,9 +219,9 @@ public final class ScriptMetaData implements MetaData.Custom, Writeable, ToXCont
|
|||
|
||||
if (source.getSource().isEmpty()) {
|
||||
if (source.getLang().equals(Script.DEFAULT_TEMPLATE_LANG)) {
|
||||
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used");
|
||||
deprecationLogger.deprecated("empty templates should no longer be used");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("empty scripts should no longer be used");
|
||||
deprecationLogger.deprecated("empty scripts should no longer be used");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
|
|||
/**
|
||||
* Standard deprecation logger for used to deprecate allowance of empty templates.
|
||||
*/
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(StoredScriptSource.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(StoredScriptSource.class));
|
||||
|
||||
/**
|
||||
* Standard {@link ParseField} for outer level of stored script source.
|
||||
|
@ -145,9 +145,9 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
|
|||
if (source == null) {
|
||||
if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
|
||||
if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
|
||||
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used");
|
||||
deprecationLogger.deprecated("empty templates should no longer be used");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("empty scripts should no longer be used");
|
||||
deprecationLogger.deprecated("empty scripts should no longer be used");
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("must specify source for stored script");
|
||||
|
@ -155,9 +155,9 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
|
|||
} else if (source.isEmpty()) {
|
||||
if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
|
||||
if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
|
||||
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used");
|
||||
deprecationLogger.deprecated("empty templates should no longer be used");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecated("empty scripts should no longer be used");
|
||||
deprecationLogger.deprecated("empty scripts should no longer be used");
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("source cannot be empty");
|
||||
|
@ -257,7 +257,7 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
|
|||
token = parser.nextToken();
|
||||
|
||||
if (token == Token.END_OBJECT) {
|
||||
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used");
|
||||
deprecationLogger.deprecated("empty templates should no longer be used");
|
||||
|
||||
return new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap());
|
||||
}
|
||||
|
|
|
@ -527,7 +527,7 @@ public class InternalOrder extends BucketOrder {
|
|||
*/
|
||||
public static class Parser {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(Parser.class));
|
||||
|
||||
/**
|
||||
|
@ -565,7 +565,7 @@ public class InternalOrder extends BucketOrder {
|
|||
}
|
||||
// _term and _time order deprecated in 6.0; replaced by _key
|
||||
if ("_term".equals(orderKey) || "_time".equals(orderKey)) {
|
||||
DEPRECATION_LOGGER.deprecated("Deprecated aggregation order key [{}] used, replaced by [_key]", orderKey);
|
||||
deprecationLogger.deprecated("Deprecated aggregation order key [{}] used, replaced by [_key]", orderKey);
|
||||
}
|
||||
switch (orderKey) {
|
||||
case "_term":
|
||||
|
|
|
@ -60,7 +60,7 @@ import java.util.Map;
|
|||
|
||||
public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, SignificantTermsAggregatorFactory>
|
||||
implements Releasable {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||
LogManager.getLogger(SignificantTermsAggregatorFactory.class));
|
||||
|
||||
private final IncludeExclude includeExclude;
|
||||
|
@ -202,7 +202,7 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac
|
|||
if (valuesSource instanceof ValuesSource.Bytes) {
|
||||
ExecutionMode execution = null;
|
||||
if (executionHint != null) {
|
||||
execution = ExecutionMode.fromString(executionHint, DEPRECATION_LOGGER);
|
||||
execution = ExecutionMode.fromString(executionHint, deprecationLogger);
|
||||
}
|
||||
if (valuesSource instanceof ValuesSource.Bytes.WithOrdinals == false) {
|
||||
execution = ExecutionMode.MAP;
|
||||
|
|
|
@ -47,7 +47,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, TermsAggregatorFactory> {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TermsAggregatorFactory.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TermsAggregatorFactory.class));
|
||||
|
||||
static Boolean REMAP_GLOBAL_ORDS, COLLECT_SEGMENT_ORDS;
|
||||
|
||||
|
@ -128,7 +128,7 @@ public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<Values
|
|||
if (valuesSource instanceof ValuesSource.Bytes) {
|
||||
ExecutionMode execution = null;
|
||||
if (executionHint != null) {
|
||||
execution = ExecutionMode.fromString(executionHint, DEPRECATION_LOGGER);
|
||||
execution = ExecutionMode.fromString(executionHint, deprecationLogger);
|
||||
}
|
||||
// In some cases, using ordinals is just not supported: override it
|
||||
if (valuesSource instanceof ValuesSource.Bytes.WithOrdinals == false) {
|
||||
|
|
|
@ -77,7 +77,7 @@ import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQuery
|
|||
* @see org.elasticsearch.action.search.SearchRequest#source(SearchSourceBuilder)
|
||||
*/
|
||||
public final class SearchSourceBuilder implements Writeable, ToXContentObject, Rewriteable<SearchSourceBuilder> {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(SearchSourceBuilder.class));
|
||||
|
||||
public static final ParseField FROM_FIELD = new ParseField("from");
|
||||
|
@ -1052,7 +1052,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R
|
|||
scriptFields.add(new ScriptField(parser));
|
||||
}
|
||||
} else if (INDICES_BOOST_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
DEPRECATION_LOGGER.deprecated(
|
||||
deprecationLogger.deprecated(
|
||||
"Object format in indices_boost is deprecated, please use array format instead");
|
||||
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
|
||||
if (token == XContentParser.Token.FIELD_NAME) {
|
||||
|
|
|
@ -55,7 +55,7 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public final class DocValueFieldsFetchSubPhase implements FetchSubPhase {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
|
||||
LogManager.getLogger(DocValueFieldsFetchSubPhase.class));
|
||||
|
||||
@Override
|
||||
|
@ -82,7 +82,7 @@ public final class DocValueFieldsFetchSubPhase implements FetchSubPhase {
|
|||
List<String> noFormatFields = context.docValueFieldsContext().fields().stream().filter(f -> f.format == null).map(f -> f.field)
|
||||
.collect(Collectors.toList());
|
||||
if (noFormatFields.isEmpty() == false) {
|
||||
DEPRECATION_LOGGER.deprecated("There are doc-value fields which are not using a format. The output will "
|
||||
deprecationLogger.deprecated("There are doc-value fields which are not using a format. The output will "
|
||||
+ "change in 7.0 when doc value fields get formatted based on mappings by default. It is recommended to pass "
|
||||
+ "[format={}] with a doc value field in order to opt in for the future behaviour and ease the migration to "
|
||||
+ "7.0: {}", DocValueFieldsContext.USE_DEFAULT_FORMAT, noFormatFields);
|
||||
|
|
|
@ -50,7 +50,7 @@ import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD;
|
|||
* A sort builder to sort based on a document field.
|
||||
*/
|
||||
public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(FieldSortBuilder.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(FieldSortBuilder.class));
|
||||
|
||||
public static final String NAME = "field_sort";
|
||||
public static final ParseField MISSING = new ParseField("missing");
|
||||
|
@ -402,14 +402,14 @@ public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> {
|
|||
static {
|
||||
PARSER.declareField(FieldSortBuilder::missing, p -> p.objectText(), MISSING, ValueType.VALUE);
|
||||
PARSER.declareString((fieldSortBuilder, nestedPath) -> {
|
||||
DEPRECATION_LOGGER.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter");
|
||||
deprecationLogger.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter");
|
||||
fieldSortBuilder.setNestedPath(nestedPath);
|
||||
}, NESTED_PATH_FIELD);
|
||||
PARSER.declareString(FieldSortBuilder::unmappedType , UNMAPPED_TYPE);
|
||||
PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)) , ORDER_FIELD);
|
||||
PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORT_MODE);
|
||||
PARSER.declareObject(FieldSortBuilder::setNestedFilter, (p, c) -> {
|
||||
DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");
|
||||
deprecationLogger.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");
|
||||
return SortBuilder.parseNestedFilter(p);
|
||||
}, NESTED_FILTER_FIELD);
|
||||
PARSER.declareObject(FieldSortBuilder::setNestedSort, (p, c) -> NestedSortBuilder.fromXContent(p), NESTED_FIELD);
|
||||
|
|
|
@ -72,7 +72,7 @@ import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD;
|
|||
* A geo distance based sorting on a geo point like field.
|
||||
*/
|
||||
public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder> {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(GeoDistanceSortBuilder.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(GeoDistanceSortBuilder.class));
|
||||
|
||||
public static final String NAME = "_geo_distance";
|
||||
public static final String ALTERNATIVE_NAME = "_geoDistance";
|
||||
|
@ -502,7 +502,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
|||
fieldName = currentName;
|
||||
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||
if (NESTED_FILTER_FIELD.match(currentName, parser.getDeprecationHandler())) {
|
||||
DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour of the [nested] parameter");
|
||||
deprecationLogger.deprecated("[nested_filter] has been deprecated in favour of the [nested] parameter");
|
||||
nestedFilter = parseInnerQueryBuilder(parser);
|
||||
} else if (NESTED_FIELD.match(currentName, parser.getDeprecationHandler())) {
|
||||
nestedSort = NestedSortBuilder.fromXContent(parser);
|
||||
|
@ -532,7 +532,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
|||
} else if (SORTMODE_FIELD.match(currentName, parser.getDeprecationHandler())) {
|
||||
sortMode = SortMode.fromString(parser.text());
|
||||
} else if (NESTED_PATH_FIELD.match(currentName, parser.getDeprecationHandler())) {
|
||||
DEPRECATION_LOGGER.deprecated("[nested_path] has been deprecated in favour of the [nested] parameter");
|
||||
deprecationLogger.deprecated("[nested_path] has been deprecated in favour of the [nested] parameter");
|
||||
nestedPath = parser.text();
|
||||
} else if (IGNORE_UNMAPPED.match(currentName, parser.getDeprecationHandler())) {
|
||||
ignoreUnmapped = parser.booleanValue();
|
||||
|
|
|
@ -66,7 +66,7 @@ import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD;
|
|||
* Script sort builder allows to sort based on a custom script expression.
|
||||
*/
|
||||
public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ScriptSortBuilder.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ScriptSortBuilder.class));
|
||||
|
||||
public static final String NAME = "_script";
|
||||
public static final ParseField TYPE_FIELD = new ParseField("type");
|
||||
|
@ -279,11 +279,11 @@ public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> {
|
|||
PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)), ORDER_FIELD);
|
||||
PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORTMODE_FIELD);
|
||||
PARSER.declareString((fieldSortBuilder, nestedPath) -> {
|
||||
DEPRECATION_LOGGER.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter");
|
||||
deprecationLogger.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter");
|
||||
fieldSortBuilder.setNestedPath(nestedPath);
|
||||
}, NESTED_PATH_FIELD);
|
||||
PARSER.declareObject(ScriptSortBuilder::setNestedFilter, (p, c) -> {
|
||||
DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");
|
||||
deprecationLogger.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");
|
||||
return SortBuilder.parseNestedFilter(p);
|
||||
}, NESTED_FILTER_FIELD);
|
||||
PARSER.declareObject(ScriptSortBuilder::setNestedSort, (p, c) -> NestedSortBuilder.fromXContent(p), NESTED_FIELD);
|
||||
|
|
|
@ -75,7 +75,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
|
|||
static final String CONTEXT_PRECISION = "precision";
|
||||
static final String CONTEXT_NEIGHBOURS = "neighbours";
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(GeoContextMapping.class));
|
||||
private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(GeoContextMapping.class));
|
||||
|
||||
private final int precision;
|
||||
private final String fieldName;
|
||||
|
@ -293,7 +293,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
|
|||
MappedFieldType mappedFieldType = fieldResolver.apply(fieldName);
|
||||
if (mappedFieldType == null) {
|
||||
if (indexVersionCreated.before(Version.V_7_0_0_alpha1)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("geo_context_mapping",
|
||||
deprecationLogger.deprecatedAndMaybeLog("geo_context_mapping",
|
||||
"field [{}] referenced in context [{}] is not defined in the mapping", fieldName, name);
|
||||
} else {
|
||||
throw new ElasticsearchParseException(
|
||||
|
@ -301,7 +301,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
|
|||
}
|
||||
} else if (GeoPointFieldMapper.CONTENT_TYPE.equals(mappedFieldType.typeName()) == false) {
|
||||
if (indexVersionCreated.before(Version.V_7_0_0_alpha1)) {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("geo_context_mapping",
|
||||
deprecationLogger.deprecatedAndMaybeLog("geo_context_mapping",
|
||||
"field [{}] referenced in context [{}] must be mapped to geo_point, found [{}]",
|
||||
fieldName, name, mappedFieldType.typeName());
|
||||
} else {
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
package org.elasticsearch.xpack.ml.job;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.index.IndexResponse;
|
||||
|
@ -19,7 +20,6 @@ import org.elasticsearch.common.CheckedConsumer;
|
|||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.logging.DeprecationLogger;
|
||||
import org.elasticsearch.common.logging.Loggers;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
|
@ -80,8 +80,8 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
public class JobManager extends AbstractComponent {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
new DeprecationLogger(Loggers.getLogger(JobManager.class));
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(JobManager.class));
|
||||
|
||||
private final Environment environment;
|
||||
private final JobResultsProvider jobResultsProvider;
|
||||
|
@ -194,7 +194,7 @@ public class JobManager extends AbstractComponent {
|
|||
Job job = request.getJobBuilder().build(new Date());
|
||||
|
||||
if (job.getDataDescription() != null && job.getDataDescription().getFormat() == DataDescription.DataFormat.DELIMITED) {
|
||||
DEPRECATION_LOGGER.deprecated("Creating jobs with delimited data format is deprecated. Please use xcontent instead.");
|
||||
deprecationLogger.deprecated("Creating jobs with delimited data format is deprecated. Please use xcontent instead.");
|
||||
}
|
||||
|
||||
// pre-flight check, not necessarily required, but avoids figuring this out while on the CS update thread
|
||||
|
|
|
@ -22,7 +22,7 @@ import java.util.StringJoiner;
|
|||
|
||||
public final class DomainSplitFunction {
|
||||
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
private static final DeprecationLogger deprecationLogger =
|
||||
new DeprecationLogger(LogManager.getLogger(DomainSplitFunction.class));
|
||||
|
||||
private static final int MAX_DOMAIN_PART_LENGTH = 63;
|
||||
|
@ -163,7 +163,7 @@ public final class DomainSplitFunction {
|
|||
public static List<String> domainSplit(String host, Map<String, Object> params) {
|
||||
// NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts
|
||||
AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
|
||||
DEPRECATION_LOGGER.deprecatedAndMaybeLog("domainSplit",
|
||||
deprecationLogger.deprecatedAndMaybeLog("domainSplit",
|
||||
"Method [domainSplit] taking params is deprecated. Remove the params argument.");
|
||||
return null;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue