mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Change default deprecation logger level to CRITICAL (#77030)
This commit changes default deprecation logger level to CRITICAL, where default means deprecations emitted by DeprecationLogger#critical method. It also introduces WARN deprecations which are emitted by DeprecationLogger#warn Those log lines emitted at WARN are meant to indicate that a functionality is deprecated but will not break at next major version. relates #76754
This commit is contained in:
parent
e570588a88
commit
0d3cebe812
125 changed files with 392 additions and 247 deletions
|
@ -78,7 +78,7 @@ appender.header_warning.name = header_warning
|
|||
#################################################
|
||||
|
||||
logger.deprecation.name = org.elasticsearch.deprecation
|
||||
logger.deprecation.level = deprecation
|
||||
logger.deprecation.level = WARN
|
||||
logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling
|
||||
logger.deprecation.appenderRef.header_warning.ref = header_warning
|
||||
logger.deprecation.additivity = false
|
||||
|
|
|
@ -200,12 +200,12 @@ By default, {es} rolls and compresses deprecation logs at 1GB. The default
|
|||
configuration preserves a maximum of five log files: four rolled logs and an
|
||||
active log.
|
||||
|
||||
{es} emits deprecation log messages at the `DEPRECATION` level. To stop writing
|
||||
deprecation log messages, set `logger.deprecation.level` to `error`:
|
||||
{es} emits deprecation log messages at the `CRITICAL` level. To stop writing
|
||||
deprecation log messages, set `logger.deprecation.level` to `OFF`:
|
||||
|
||||
[source,properties]
|
||||
----
|
||||
logger.deprecation.level = error
|
||||
logger.deprecation.level = OFF
|
||||
----
|
||||
|
||||
You can identify what is triggering deprecated functionality if `X-Opaque-Id` was used as an HTTP header.
|
||||
|
|
|
@ -666,7 +666,7 @@ public class ConstructingObjectParserTests extends ESTestCase {
|
|||
}
|
||||
|
||||
private static BiConsumer<StructRemovalField, Integer> logWarningDoNothing(String old_name) {
|
||||
return (struct,value) -> deprecationLogger.compatibleApiWarning("struct_removal",
|
||||
return (struct,value) -> deprecationLogger.compatibleCritical("struct_removal",
|
||||
"The field old_name has been removed and is being ignored");
|
||||
}
|
||||
|
||||
|
|
|
@ -243,7 +243,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
"The [edgeNGram] token filter name was deprecated in 6.4 and cannot be used in new indices. "
|
||||
+ "Please change the filter name to [edge_ngram] instead.");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "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.");
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
"The [nGram] token filter name was deprecated in 6.4 and cannot be used in new indices. "
|
||||
+ "Please change the filter name to [ngram] instead.");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "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.");
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
throw new IllegalArgumentException("The [nGram] tokenizer name was deprecated in 7.6. "
|
||||
+ "Please use the tokenizer name to [ngram] for indices created in versions 8 or higher instead.");
|
||||
} else if (indexSettings.getIndexVersionCreated().onOrAfter(org.elasticsearch.Version.V_7_6_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation",
|
||||
"The [nGram] tokenizer name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the tokenizer name to [ngram] instead.");
|
||||
}
|
||||
|
@ -348,7 +348,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
throw new IllegalArgumentException("The [edgeNGram] tokenizer name was deprecated in 7.6. "
|
||||
+ "Please use the tokenizer name to [edge_nGram] for indices created in versions 8 or higher instead.");
|
||||
} else if (indexSettings.getIndexVersionCreated().onOrAfter(org.elasticsearch.Version.V_7_6_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation",
|
||||
"The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the tokenizer name to [edge_ngram] instead.");
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
throw new IllegalArgumentException("The [nGram] tokenizer name was deprecated in 7.6. "
|
||||
+ "Please use the tokenizer name to [ngram] for indices created in versions 8 or higher instead.");
|
||||
} else if (version.onOrAfter(org.elasticsearch.Version.V_7_6_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "nGram_tokenizer_deprecation",
|
||||
"The [nGram] tokenizer name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the tokenizer name to [ngram] instead.");
|
||||
}
|
||||
|
@ -552,7 +552,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
|
|||
throw new IllegalArgumentException("The [edgeNGram] tokenizer name was deprecated in 7.6. "
|
||||
+ "Please use the tokenizer name to [edge_ngram] for indices created in versions 8 or higher instead.");
|
||||
} else if (version.onOrAfter(org.elasticsearch.Version.V_7_6_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "edgeNGram_tokenizer_deprecation",
|
||||
"The [edgeNGram] tokenizer name is deprecated and will be removed in a future version. "
|
||||
+ "Please change the tokenizer name to [edge_ngram] instead.");
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class SynonymTokenFilterFactory extends AbstractTokenFilterFactory {
|
|||
this.settings = settings;
|
||||
|
||||
if (settings.get("ignore_case") != null) {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_ignore_case_option",
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_ignore_case_option",
|
||||
"The ignore_case option on the synonym_graph filter is deprecated. " +
|
||||
"Instead, insert a lowercase filter in the filter chain before the synonym_graph filter.");
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@ public class UserAgentProcessor extends AbstractProcessor {
|
|||
boolean ignoreMissing = readBooleanProperty(TYPE, processorTag, config, "ignore_missing", false);
|
||||
Object ecsValue = config.remove("ecs");
|
||||
if (ecsValue != null) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ingest_useragent_ecs_settings",
|
||||
deprecationLogger.critical(DeprecationCategory.SETTINGS, "ingest_useragent_ecs_settings",
|
||||
"setting [ecs] is deprecated as ECS format is the default and only option");
|
||||
}
|
||||
|
||||
|
|
|
@ -362,7 +362,7 @@ public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBu
|
|||
}
|
||||
|
||||
private static BiConsumer<PercolateQueryBuilder, String> deprecateAndIgnoreType(String key, String message) {
|
||||
return (target, type) -> deprecationLogger.compatibleApiWarning(key, message);
|
||||
return (target, type) -> deprecationLogger.compatibleCritical(key, message);
|
||||
}
|
||||
|
||||
private static BytesReference parseDocument(XContentParser parser) throws IOException {
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ReindexValidator {
|
|||
state);
|
||||
SearchSourceBuilder searchSource = request.getSearchRequest().source();
|
||||
if (searchSource != null && searchSource.sorts() != null && searchSource.sorts().isEmpty() == false) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "reindex_sort", SORT_DEPRECATED_MESSAGE);
|
||||
deprecationLogger.critical(DeprecationCategory.API, "reindex_sort", SORT_DEPRECATED_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class AzureDiscoveryPlugin extends Plugin implements DiscoveryPlugin {
|
|||
|
||||
public AzureDiscoveryPlugin(Settings settings) {
|
||||
this.settings = settings;
|
||||
deprecationLogger.deprecate(DeprecationCategory.PLUGINS, "azure_discovery_plugin", "azure classic discovery plugin is deprecated.");
|
||||
deprecationLogger.critical(DeprecationCategory.PLUGINS, "azure_discovery_plugin", "azure classic discovery plugin is deprecated.");
|
||||
logger.trace("starting azure classic discovery plugin...");
|
||||
}
|
||||
|
||||
|
|
|
@ -125,12 +125,12 @@ final class Ec2ClientSettings {
|
|||
return null;
|
||||
} else {
|
||||
if (key.length() == 0) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings",
|
||||
deprecationLogger.critical(DeprecationCategory.SETTINGS, "ec2_invalid_settings",
|
||||
"Setting [{}] is set but [{}] is not, which will be unsupported in future",
|
||||
SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey());
|
||||
}
|
||||
if (secret.length() == 0) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "ec2_invalid_settings",
|
||||
deprecationLogger.critical(DeprecationCategory.SETTINGS, "ec2_invalid_settings",
|
||||
"Setting [{}] is set but [{}] is not, which will be unsupported in future",
|
||||
ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey());
|
||||
}
|
||||
|
|
|
@ -21,10 +21,10 @@ import org.apache.lucene.util.Constants;
|
|||
import org.elasticsearch.cli.UserException;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.common.Randomness;
|
||||
import org.elasticsearch.core.PathUtils;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
||||
import org.elasticsearch.core.PathUtils;
|
||||
import org.elasticsearch.env.Environment;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
|
@ -46,7 +46,6 @@ import java.util.regex.Pattern;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import static org.elasticsearch.common.logging.DeprecationLogger.DEPRECATION;
|
||||
import static org.hamcrest.Matchers.endsWith;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.hasItem;
|
||||
|
@ -117,7 +116,7 @@ public class EvilLoggerTests extends ESTestCase {
|
|||
}
|
||||
for (int j = 0; j < iterations; j++) {
|
||||
for (final Integer id : ids) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, Integer.toString(id),
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, Integer.toString(id),
|
||||
"This is a maybe logged deprecation message" + id);
|
||||
}
|
||||
}
|
||||
|
@ -171,8 +170,8 @@ public class EvilLoggerTests extends ESTestCase {
|
|||
for (int i = 0; i < 128; i++) {
|
||||
assertLogLine(
|
||||
deprecationEvents.get(i),
|
||||
DEPRECATION,
|
||||
"org.elasticsearch.common.logging.DeprecationLogger.deprecate",
|
||||
DeprecationLogger.CRITICAL,
|
||||
"org.elasticsearch.common.logging.DeprecationLogger.logDeprecation",
|
||||
"This is a maybe logged deprecation message" + i);
|
||||
}
|
||||
|
||||
|
@ -204,8 +203,8 @@ public class EvilLoggerTests extends ESTestCase {
|
|||
assertThat(deprecationEvents.size(), equalTo(1));
|
||||
assertLogLine(
|
||||
deprecationEvents.get(0),
|
||||
DEPRECATION,
|
||||
"org.elasticsearch.common.logging.DeprecationLogger.deprecate",
|
||||
DeprecationLogger.CRITICAL,
|
||||
"org.elasticsearch.common.logging.DeprecationLogger.logDeprecation",
|
||||
"\\[deprecated.foo\\] setting was deprecated in Elasticsearch and will be removed in a future release! " +
|
||||
"See the breaking changes documentation for the next major version.");
|
||||
}
|
||||
|
|
|
@ -78,10 +78,35 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
super.tearDown();
|
||||
}
|
||||
|
||||
public void testDeprecationWarnMessage() throws IOException {
|
||||
final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test");
|
||||
|
||||
testLogger.warn(DeprecationCategory.OTHER, "a key", "deprecated warn message1");
|
||||
|
||||
final Path path = PathUtils.get(System.getProperty("es.logs.base_path"),
|
||||
System.getProperty("es.logs.cluster_name") + "_deprecated.json");
|
||||
|
||||
try (Stream<Map<String, String>> stream = JsonLogsStream.mapStreamFrom(path)) {
|
||||
List<Map<String, String>> jsonLogs = stream
|
||||
.collect(Collectors.toList());
|
||||
|
||||
assertThat(jsonLogs, contains(
|
||||
allOf(
|
||||
hasEntry("log.level", "WARN"),
|
||||
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
|
||||
hasEntry("elasticsearch.event.category", "other"),
|
||||
hasEntry("message", "deprecated warn message1")
|
||||
))
|
||||
);
|
||||
}
|
||||
|
||||
assertWarnings("deprecated warn message1");
|
||||
}
|
||||
|
||||
public void testDeprecatedMessageWithoutXOpaqueId() throws IOException {
|
||||
final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test");
|
||||
|
||||
testLogger.deprecate(DeprecationCategory.OTHER, "a key", "deprecated message1");
|
||||
testLogger.critical(DeprecationCategory.OTHER, "a key", "deprecated message1");
|
||||
|
||||
final Path path = PathUtils.get(System.getProperty("es.logs.base_path"),
|
||||
System.getProperty("es.logs.cluster_name") + "_deprecated.json");
|
||||
|
@ -93,7 +118,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
assertThat(jsonLogs, contains(
|
||||
allOf(
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
|
||||
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
|
||||
hasEntry("elasticsearch.node.name", "sample-name"),
|
||||
|
@ -117,8 +142,8 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
threadContext.putHeader(Task.X_OPAQUE_ID, "someId");
|
||||
threadContext.putHeader(Task.TRACE_ID, "someTraceId");
|
||||
final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test");
|
||||
testLogger.deprecate(DeprecationCategory.OTHER,"someKey", "deprecated message1")
|
||||
.compatibleApiWarning("compatibleKey","compatible API message");
|
||||
testLogger.critical(DeprecationCategory.OTHER,"someKey", "deprecated message1")
|
||||
.compatibleCritical("compatibleKey","compatible API message");
|
||||
|
||||
final Path path = PathUtils.get(
|
||||
System.getProperty("es.logs.base_path"),
|
||||
|
@ -132,7 +157,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
jsonLogs,
|
||||
contains(
|
||||
allOf(
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.namespace", "default"),
|
||||
|
@ -148,7 +173,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
hasEntry("elasticsearch.event.category", "other")
|
||||
),
|
||||
allOf(
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
// event.dataset and data_stream.dataset have to be the same across the data stream
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
|
||||
|
@ -200,7 +225,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
contains(
|
||||
// deprecation log for field deprecated_name
|
||||
allOf(
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.namespace", "default"),
|
||||
|
@ -217,7 +242,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
),
|
||||
// deprecation log for field deprecated_name2 (note it is not being throttled)
|
||||
allOf(
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.namespace", "default"),
|
||||
|
@ -234,7 +259,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
),
|
||||
// compatible log line
|
||||
allOf(
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("data_stream.namespace", "default"),
|
||||
|
@ -264,7 +289,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
threadContext.putHeader(Task.X_OPAQUE_ID, "someId");
|
||||
threadContext.putHeader(Task.TRACE_ID, "someTraceId");
|
||||
final DeprecationLogger testLogger = DeprecationLogger.getLogger("org.elasticsearch.test");
|
||||
testLogger.deprecate(DeprecationCategory.OTHER, "someKey", "deprecated message1");
|
||||
testLogger.critical(DeprecationCategory.OTHER, "someKey", "deprecated message1");
|
||||
|
||||
final Path path = PathUtils.get(
|
||||
System.getProperty("es.logs.base_path"),
|
||||
|
@ -279,7 +304,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
contains(
|
||||
allOf(
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
|
||||
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
|
||||
hasEntry("elasticsearch.node.name", "sample-name"),
|
||||
|
@ -475,8 +500,8 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
// For the same key and X-Opaque-ID deprecation should be once
|
||||
withThreadContext(threadContext -> {
|
||||
threadContext.putHeader(Task.X_OPAQUE_ID, "ID1");
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message1");
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message2");
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message1");
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message2");
|
||||
assertWarnings("message1", "message2");
|
||||
|
||||
final Path path = PathUtils.get(System.getProperty("es.logs.base_path"),
|
||||
|
@ -488,7 +513,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
assertThat(jsonLogs, contains(
|
||||
allOf(
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
|
||||
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
|
||||
hasEntry("elasticsearch.node.name", "sample-name"),
|
||||
|
@ -504,8 +529,8 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
//continuing with message1-ID1 in logs already, adding a new deprecation log line with message2-ID2
|
||||
withThreadContext(threadContext -> {
|
||||
threadContext.putHeader(Task.X_OPAQUE_ID, "ID2");
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message1");
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, "key", "message2");
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message1");
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, "key", "message2");
|
||||
assertWarnings("message1", "message2");
|
||||
|
||||
final Path path = PathUtils.get(
|
||||
|
@ -520,7 +545,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
contains(
|
||||
allOf(
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
|
||||
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
|
||||
hasEntry("elasticsearch.node.name", "sample-name"),
|
||||
|
@ -530,7 +555,7 @@ public class JsonLoggerTests extends ESTestCase {
|
|||
),
|
||||
allOf(
|
||||
hasEntry("event.dataset", "deprecation.elasticsearch"),
|
||||
hasEntry("log.level", "DEPRECATION"),
|
||||
hasEntry("log.level", "CRITICAL"),
|
||||
hasEntry("log.logger", "org.elasticsearch.deprecation.test"),
|
||||
hasEntry("elasticsearch.cluster.name", "elasticsearch"),
|
||||
hasEntry("elasticsearch.node.name", "sample-name"),
|
||||
|
|
|
@ -40,7 +40,7 @@ appender.header_warning.type = HeaderWarningAppender
|
|||
appender.header_warning.name = header_warning
|
||||
|
||||
logger.deprecation.name = org.elasticsearch.deprecation
|
||||
logger.deprecation.level = deprecation
|
||||
logger.deprecation.level = WARN
|
||||
logger.deprecation.appenderRef.deprecation_rolling.ref = deprecated
|
||||
logger.deprecation.appenderRef.deprecatedconsole.ref = deprecatedconsole
|
||||
logger.deprecation.appenderRef.header_warning.ref = header_warning
|
||||
|
|
|
@ -364,7 +364,7 @@ public class SystemIndicesSnapshotIT extends AbstractSnapshotIntegTestCase {
|
|||
new MockLogAppender.SeenEventExpectation(
|
||||
"restore-system-index-from-snapshot",
|
||||
"org.elasticsearch.deprecation.snapshots.RestoreService",
|
||||
DeprecationLogger.DEPRECATION,
|
||||
DeprecationLogger.CRITICAL,
|
||||
"Restoring system indices by name is deprecated. Use feature states instead. System indices: [.test-system-idx]"
|
||||
)
|
||||
);
|
||||
|
|
|
@ -150,7 +150,7 @@ public class TransportGetAliasesAction extends TransportMasterNodeReadAction<Get
|
|||
}
|
||||
}
|
||||
if (systemIndicesNames.isEmpty() == false) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "open_system_index_access",
|
||||
deprecationLogger.critical(DeprecationCategory.API, "open_system_index_access",
|
||||
"this request accesses system indices: {}, but in a future major version, direct access to system " +
|
||||
"indices will be prevented by default", systemIndicesNames);
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ public class TransportGetAliasesAction extends TransportMasterNodeReadAction<Get
|
|||
}
|
||||
|
||||
if (systemAliases.isEmpty() == false) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "open_system_alias_access",
|
||||
deprecationLogger.critical(DeprecationCategory.API, "open_system_alias_access",
|
||||
"this request accesses aliases with names reserved for system indices: {}, but in a future major version, direct " +
|
||||
"access to system indices and their aliases will not be allowed", systemAliases);
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ public final class BulkRequestParser {
|
|||
if (parser.getRestApiVersion().matches(RestApiVersion.equalTo(RestApiVersion.V_7))) {
|
||||
// for bigger bulks, deprecation throttling might not be enough
|
||||
if (deprecateOrErrorOnType && typesDeprecationLogged == false) {
|
||||
deprecationLogger.compatibleApiWarning("bulk_with_types",
|
||||
deprecationLogger.compatibleCritical("bulk_with_types",
|
||||
RestBulkAction.TYPES_DEPRECATION_MESSAGE);
|
||||
typesDeprecationLogged = true;
|
||||
}
|
||||
|
|
|
@ -392,7 +392,7 @@ public class MultiGetRequest extends ActionRequest
|
|||
id = parser.text();
|
||||
} else if(parser.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
TYPE.match(currentFieldName,parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("mget_with_types", RestMultiGetAction.TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("mget_with_types", RestMultiGetAction.TYPES_DEPRECATION_MESSAGE);
|
||||
} else if (ROUTING.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
routing = parser.text();
|
||||
} else if (FIELDS.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
|
|
|
@ -197,7 +197,7 @@ public class MultiGetResponse extends ActionResponse implements Iterable<MultiGe
|
|||
if (INDEX.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
index = parser.text();
|
||||
} else if (TYPE.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("mget_with_types", RestMultiGetAction.TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("mget_with_types", RestMultiGetAction.TYPES_DEPRECATION_MESSAGE);
|
||||
} else if (ID.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
id = parser.text();
|
||||
}
|
||||
|
|
|
@ -187,7 +187,7 @@ public class SimulatePipelineRequest extends ActionRequest implements ToXContent
|
|||
String routing = ConfigurationUtils.readOptionalStringOrIntProperty(null, null,
|
||||
dataMap, Metadata.ROUTING.getFieldName());
|
||||
if (restApiVersion == RestApiVersion.V_7 && dataMap.containsKey(Metadata.TYPE.getFieldName())) {
|
||||
deprecationLogger.compatibleApiWarning("simulate_pipeline_with_types",
|
||||
deprecationLogger.compatibleCritical("simulate_pipeline_with_types",
|
||||
"[types removal] specifying _type in pipeline simulation requests is deprecated");
|
||||
}
|
||||
Long version = null;
|
||||
|
|
|
@ -189,7 +189,7 @@ public class MultiSearchRequest extends ActionRequest implements CompositeIndice
|
|||
}
|
||||
// support first line with \n
|
||||
if (restApiVersion == RestApiVersion.V_7 && nextMarker == 0) {
|
||||
deprecationLogger.compatibleApiWarning("msearch_first_line_empty", FIRST_LINE_EMPTY_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("msearch_first_line_empty", FIRST_LINE_EMPTY_DEPRECATION_MESSAGE);
|
||||
from = nextMarker + 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ public class MultiSearchRequest extends ActionRequest implements CompositeIndice
|
|||
ignoreThrottled = value;
|
||||
} else if(restApiVersion == RestApiVersion.V_7 &&
|
||||
("type".equals(entry.getKey()) || "types".equals(entry.getKey()))) {
|
||||
deprecationLogger.compatibleApiWarning("msearch_with_types", RestMultiSearchAction.TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("msearch_with_types", RestMultiSearchAction.TYPES_DEPRECATION_MESSAGE);
|
||||
} else {
|
||||
throw new IllegalArgumentException("key [" + entry.getKey() + "] is not supported in the metadata section");
|
||||
}
|
||||
|
|
|
@ -580,7 +580,7 @@ public class TermVectorsRequest extends SingleShardRequest<TermVectorsRequest> i
|
|||
} else if (VERSION_TYPE.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
termVectorsRequest.versionType = VersionType.fromString(parser.text());
|
||||
} else if (restApiVersion == RestApiVersion.V_7 && TYPE.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("termvectors_with_types",
|
||||
deprecationLogger.compatibleCritical("termvectors_with_types",
|
||||
RestTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
|
||||
} else {
|
||||
throw new ElasticsearchParseException("failed to parse term vectors request. unknown field [{}]", currentFieldName);
|
||||
|
|
|
@ -352,7 +352,7 @@ public class IndexNameExpressionResolver {
|
|||
|
||||
if (resolvedSystemIndices.isEmpty() == false) {
|
||||
Collections.sort(resolvedSystemIndices);
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "open_system_index_access",
|
||||
deprecationLogger.critical(DeprecationCategory.API, "open_system_index_access",
|
||||
"this request accesses system indices: {}, but in a future major version, direct access to system " +
|
||||
"indices will be prevented by default", resolvedSystemIndices);
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ public class MetadataCreateIndexService {
|
|||
} else if (isHidden) {
|
||||
logger.trace("index [{}] is a hidden index", index);
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.INDICES, "index_name_starts_with_dot",
|
||||
deprecationLogger.critical(DeprecationCategory.INDICES, "index_name_starts_with_dot",
|
||||
"index name [{}] starts with a dot '.', in the next major version, index names " +
|
||||
"starting with a dot are reserved for hidden indices and system indices", index);
|
||||
}
|
||||
|
@ -366,7 +366,7 @@ public class MetadataCreateIndexService {
|
|||
request.index(), isHiddenFromRequest);
|
||||
|
||||
if (v1Templates.size() > 1) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "index_template_multiple_match",
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES, "index_template_multiple_match",
|
||||
"index [{}] matches multiple legacy templates [{}], composable templates will only match a single template",
|
||||
request.index(), v1Templates.stream().map(IndexTemplateMetadata::name).sorted().collect(Collectors.joining(", ")));
|
||||
}
|
||||
|
@ -1274,7 +1274,7 @@ public class MetadataCreateIndexService {
|
|||
if (IndexSettings.INDEX_SOFT_DELETES_SETTING.get(indexSettings) &&
|
||||
(IndexSettings.INDEX_TRANSLOG_RETENTION_AGE_SETTING.exists(indexSettings)
|
||||
|| IndexSettings.INDEX_TRANSLOG_RETENTION_SIZE_SETTING.exists(indexSettings))) {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.SETTINGS,
|
||||
"translog_retention",
|
||||
"Translog retention settings [index.translog.retention.age] and [index.translog.retention.size] are deprecated and "
|
||||
|
@ -1286,7 +1286,7 @@ public class MetadataCreateIndexService {
|
|||
public static void validateStoreTypeSetting(Settings indexSettings) {
|
||||
final String storeType = IndexModule.INDEX_STORE_TYPE_SETTING.get(indexSettings);
|
||||
if (IndexModule.Type.SIMPLEFS.match(storeType)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "store_type_setting",
|
||||
deprecationLogger.critical(DeprecationCategory.SETTINGS, "store_type_setting",
|
||||
"[simplefs] is deprecated and will be removed in 8.0. Use [niofs] or other file systems instead. " +
|
||||
"Elasticsearch 7.15 or later uses [niofs] for the [simplefs] store type as it offers superior " +
|
||||
"or equivalent performance to [simplefs].");
|
||||
|
|
|
@ -264,16 +264,16 @@ public class Joda {
|
|||
|
||||
private static void maybeLogJodaDeprecation(String input) {
|
||||
if (input.contains("CC")) {
|
||||
getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "joda-century-of-era-format",
|
||||
getDeprecationLogger().critical(DeprecationCategory.PARSING, "joda-century-of-era-format",
|
||||
"Use of 'C' (century-of-era) is deprecated and will not be supported in the next major version of Elasticsearch.");
|
||||
}
|
||||
if (input.contains("YY")) {
|
||||
getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "joda-year-of-era-format",
|
||||
getDeprecationLogger().critical(DeprecationCategory.PARSING, "joda-year-of-era-format",
|
||||
"Use of 'Y' (year-of-era) will change to 'y' in the" +
|
||||
" next major version of Elasticsearch. Prefix your date format with '8' to use the new specifier.");
|
||||
}
|
||||
if (input.contains("xx")) {
|
||||
getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "joda-week-based-year-format",
|
||||
getDeprecationLogger().critical(DeprecationCategory.PARSING, "joda-week-based-year-format",
|
||||
"Use of 'x' (week-based-year) will change" +
|
||||
" to 'Y' in the next major version of Elasticsearch. Prefix your date format with '8' to use the new specifier.");
|
||||
}
|
||||
|
@ -372,11 +372,11 @@ public class Joda {
|
|||
long millis = new BigDecimal(text).longValue() * factor;
|
||||
// check for deprecations, but after it has parsed correctly so invalid values aren't counted as deprecated
|
||||
if (millis < 0) {
|
||||
getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "epoch-negative", "Use of negative values" +
|
||||
getDeprecationLogger().critical(DeprecationCategory.PARSING, "epoch-negative", "Use of negative values" +
|
||||
" in epoch time formats is deprecated and will not be supported in the next major version of Elasticsearch.");
|
||||
}
|
||||
if (scientificNotation.matcher(text).find()) {
|
||||
getDeprecationLogger().deprecate(DeprecationCategory.PARSING, "epoch-scientific-notation",
|
||||
getDeprecationLogger().critical(DeprecationCategory.PARSING, "epoch-scientific-notation",
|
||||
"Use of scientific notation" +
|
||||
" in epoch time formats is deprecated and will not be supported in the next major version of Elasticsearch.");
|
||||
}
|
||||
|
|
|
@ -13,12 +13,12 @@ import org.apache.logging.log4j.LogManager;
|
|||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* A logger that logs deprecation notices. Logger should be initialized with a parent logger which name will be used
|
||||
* A logger that logs deprecation notices. Logger should be initialized with a class or name which will be used
|
||||
* for deprecation logger. For instance <code>DeprecationLogger.getLogger("org.elasticsearch.test.SomeClass")</code> will
|
||||
* result in a deprecation logger with name <code>org.elasticsearch.deprecation.test.SomeClass</code>. This allows to use a
|
||||
* <code>deprecation</code> logger defined in log4j2.properties.
|
||||
* <p>
|
||||
* Logs are emitted at the custom {@link #DEPRECATION} level, and routed wherever they need to go using log4j. For example,
|
||||
* Logs are emitted at the custom {@link #CRITICAL} level, and routed wherever they need to go using log4j. For example,
|
||||
* to disk using a rolling file appender, or added as a response header using {@link HeaderWarningAppender}.
|
||||
* <p>
|
||||
* Deprecation messages include a <code>key</code>, which is used for rate-limiting purposes. The log4j configuration
|
||||
|
@ -27,11 +27,12 @@ import org.apache.logging.log4j.Logger;
|
|||
* message limiting.
|
||||
*/
|
||||
public class DeprecationLogger {
|
||||
|
||||
/**
|
||||
* Deprecation messages are logged at this level.
|
||||
* More serious that WARN by 1, but less serious than ERROR
|
||||
*/
|
||||
public static Level DEPRECATION = Level.forName("DEPRECATION", Level.WARN.intLevel() + 1);
|
||||
public static Level CRITICAL = Level.forName("CRITICAL", Level.WARN.intLevel() - 1);
|
||||
|
||||
|
||||
private final Logger logger;
|
||||
|
||||
|
@ -72,29 +73,55 @@ public class DeprecationLogger {
|
|||
}
|
||||
|
||||
/**
|
||||
* Logs a message at the {@link #DEPRECATION} level. The message is also sent to the header warning logger,
|
||||
* Logs a message at the {@link DeprecationLogger#CRITICAL} level.
|
||||
* This log will indicate that a change will break in next version.
|
||||
* The message is also sent to the header warning logger,
|
||||
* so that it can be returned to the client.
|
||||
*/
|
||||
public DeprecationLogger deprecate(
|
||||
public DeprecationLogger critical(
|
||||
final DeprecationCategory category,
|
||||
final String key,
|
||||
final String msg,
|
||||
final Object... params
|
||||
) {
|
||||
final Object... params) {
|
||||
return logDeprecation(CRITICAL, category, key, msg, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs a message at the {@link Level#WARN} level for less critical deprecations
|
||||
* that won't break in next version.
|
||||
* The message is also sent to the header warning logger,
|
||||
* so that it can be returned to the client.
|
||||
*/
|
||||
public DeprecationLogger warn(
|
||||
final DeprecationCategory category,
|
||||
final String key,
|
||||
final String msg,
|
||||
final Object... params) {
|
||||
return logDeprecation(Level.WARN, category, key, msg, params);
|
||||
}
|
||||
|
||||
private DeprecationLogger logDeprecation(Level level, DeprecationCategory category, String key, String msg, Object[] params) {
|
||||
assert category != DeprecationCategory.COMPATIBLE_API :
|
||||
"DeprecationCategory.COMPATIBLE_API should be logged with compatibleApiWarning method";
|
||||
ESLogMessage deprecationMessage = DeprecatedMessage.of(category, key, HeaderWarning.getXOpaqueId(), msg, params);
|
||||
logger.log(DEPRECATION, deprecationMessage);
|
||||
logger.log(level, deprecationMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DeprecationLogger compatibleApiWarning(
|
||||
/**
|
||||
* Used for handling previous version RestApiCompatible logic.
|
||||
* Logs a message at the {@link DeprecationLogger#CRITICAL} level
|
||||
* that have been broken in previous version.
|
||||
* The message is also sent to the header warning logger,
|
||||
* so that it can be returned to the client.
|
||||
*/
|
||||
public DeprecationLogger compatibleCritical(
|
||||
final String key,
|
||||
final String msg,
|
||||
final Object... params) {
|
||||
String opaqueId = HeaderWarning.getXOpaqueId();
|
||||
ESLogMessage deprecationMessage = DeprecatedMessage.compatibleDeprecationMessage(key, opaqueId, msg, params);
|
||||
logger.log(DEPRECATION, deprecationMessage);
|
||||
logger.log(CRITICAL, deprecationMessage);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -548,7 +548,7 @@ public class Setting<T> implements ToXContentObject {
|
|||
// It would be convenient to show its replacement key, but replacement is often not so simple
|
||||
final String key = getKey();
|
||||
Settings.DeprecationLoggerHolder.deprecationLogger
|
||||
.deprecate(DeprecationCategory.SETTINGS, key,
|
||||
.critical(DeprecationCategory.SETTINGS, key,
|
||||
"[{}] setting was deprecated in Elasticsearch and will be removed in a future release! "
|
||||
+ "See the breaking changes documentation for the next major version.", key);
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ public class DateUtils {
|
|||
public static ZoneId of(String zoneId) {
|
||||
String deprecatedId = DEPRECATED_SHORT_TIMEZONES.get(zoneId);
|
||||
if (deprecatedId != null) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.PARSING, "timezone",
|
||||
deprecationLogger.critical(DeprecationCategory.PARSING, "timezone",
|
||||
"Use of short timezone id " + zoneId + " is deprecated. Use " + deprecatedId + " instead");
|
||||
return ZoneId.of(deprecatedId);
|
||||
}
|
||||
|
|
|
@ -261,7 +261,7 @@ public class ByteSizeValue implements Writeable, Comparable<ByteSizeValue>, ToXC
|
|||
try {
|
||||
final double doubleValue = Double.parseDouble(s);
|
||||
DeprecationLoggerHolder.deprecationLogger
|
||||
.deprecate(DeprecationCategory.PARSING, "fractional_byte_values",
|
||||
.critical(DeprecationCategory.PARSING, "fractional_byte_values",
|
||||
"Fractional bytes values are deprecated. Use non-fractional bytes values instead: [{}] found for setting [{}]",
|
||||
initialInput, settingName);
|
||||
return new ByteSizeValue((long) (doubleValue * unit.toBytes(1)));
|
||||
|
|
|
@ -37,10 +37,10 @@ public class LoggingDeprecationHandler implements DeprecationHandler {
|
|||
public static final LoggingDeprecationHandler INSTANCE = new LoggingDeprecationHandler();
|
||||
|
||||
private TriConsumer<String, Object[], String> deprecationLoggerFunction = (message, params, field_name) ->
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "deprecated_field_" + field_name, message, params);
|
||||
deprecationLogger.critical(DeprecationCategory.API, "deprecated_field_" + field_name, message, params);
|
||||
|
||||
private TriConsumer<String, Object[], String> compatibleLoggerFunction = (message, params, field_name) ->
|
||||
deprecationLogger.compatibleApiWarning("deprecated_field_" + field_name, message, params);
|
||||
deprecationLogger.compatibleCritical("deprecated_field_" + field_name, message, params);
|
||||
|
||||
private LoggingDeprecationHandler() {
|
||||
// one instance only
|
||||
|
|
|
@ -190,7 +190,7 @@ public final class IndexSortConfig {
|
|||
if (this.indexCreatedVersion.onOrAfter(Version.V_7_13_0)) {
|
||||
throw new IllegalArgumentException("Cannot use alias [" + sortSpec.field + "] as an index sort field");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecate(
|
||||
DEPRECATION_LOGGER.critical(
|
||||
DeprecationCategory.MAPPINGS,
|
||||
"index-sort-aliases",
|
||||
"Index sort for index [" + indexName + "] defined on field [" + sortSpec.field +
|
||||
|
|
|
@ -72,7 +72,7 @@ public class Analysis {
|
|||
public static void checkForDeprecatedVersion(String name, Settings settings) {
|
||||
String sVersion = settings.get("version");
|
||||
if (sVersion != null) {
|
||||
DEPRECATION_LOGGER.deprecate(
|
||||
DEPRECATION_LOGGER.critical(
|
||||
DeprecationCategory.ANALYSIS,
|
||||
"analyzer.version",
|
||||
"Setting [version] on analysis component [" + name + "] has no effect and is deprecated"
|
||||
|
|
|
@ -39,7 +39,7 @@ public class ShingleTokenFilterFactory extends AbstractTokenFilterFactory {
|
|||
+ " must be less than or equal to: [" + maxAllowedShingleDiff + "] but was [" + shingleDiff + "]. This limit"
|
||||
+ " can be set by changing the [" + IndexSettings.MAX_SHINGLE_DIFF_SETTING.getKey() + "] index level setting.");
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "excessive_shingle_diff",
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "excessive_shingle_diff",
|
||||
"Deprecated big difference between maxShingleSize and minShingleSize" +
|
||||
" in Shingle TokenFilter, expected difference must be less than or equal to: [" + maxAllowedShingleDiff + "]");
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class ShingleTokenFilterFactory extends AbstractTokenFilterFactory {
|
|||
"] cannot be used to parse synonyms");
|
||||
}
|
||||
else {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter " + name()
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.ANALYSIS, "synonym_tokenfilters", "Token filter " + name()
|
||||
+ "] will not be usable to parse synonym after v7.0");
|
||||
}
|
||||
return this;
|
||||
|
|
|
@ -327,7 +327,7 @@ public class GetResult implements Writeable, Iterable<DocumentField>, ToXContent
|
|||
if (_INDEX.equals(currentFieldName)) {
|
||||
index = parser.text();
|
||||
} else if (parser.getRestApiVersion() == RestApiVersion.V_7 && MapperService.TYPE_FIELD_NAME.equals(currentFieldName)) {
|
||||
deprecationLogger.compatibleApiWarning("mget_with_types", RestMultiGetAction.TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("mget_with_types", RestMultiGetAction.TYPES_DEPRECATION_MESSAGE);
|
||||
} else if (_ID.equals(currentFieldName)) {
|
||||
id = parser.text();
|
||||
} else if (_VERSION.equals(currentFieldName)) {
|
||||
|
|
|
@ -189,7 +189,7 @@ public class CompletionFieldMapper extends FieldMapper {
|
|||
throw new IllegalArgumentException(
|
||||
"Limit of completion field contexts [" + COMPLETION_CONTEXTS_LIMIT + "] has been exceeded");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "excessive_completion_contexts",
|
||||
deprecationLogger.critical(DeprecationCategory.MAPPINGS, "excessive_completion_contexts",
|
||||
"You have defined more than [" + COMPLETION_CONTEXTS_LIMIT + "] completion contexts" +
|
||||
" in the mapping for field [" + name() + "]. " +
|
||||
"The maximum allowed number of completion contexts in a mapping will be limited to " +
|
||||
|
|
|
@ -295,7 +295,7 @@ public final class DateFieldMapper extends FieldMapper {
|
|||
if (indexCreatedVersion.onOrAfter(Version.V_8_0_0)) {
|
||||
throw new MapperParsingException("Error parsing [null_value] on field [" + name() + "]: " + e.getMessage(), e);
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.MAPPINGS, "date_mapper_null_field",
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.MAPPINGS, "date_mapper_null_field",
|
||||
"Error parsing [" + nullValue.getValue()
|
||||
+ "] as date in [null_value] on field [" + name() + "]); [null_value] will be ignored");
|
||||
return null;
|
||||
|
|
|
@ -1130,7 +1130,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable {
|
|||
}
|
||||
if (Objects.equals("boost", propName)) {
|
||||
if (parserContext.indexVersionCreated().before(Version.V_8_0_0)) {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.API,
|
||||
"boost",
|
||||
"Parameter [boost] on field [{}] is deprecated and has no effect",
|
||||
|
@ -1143,14 +1143,14 @@ public abstract class FieldMapper extends Mapper implements Cloneable {
|
|||
}
|
||||
Parameter<?> parameter = deprecatedParamsMap.get(propName);
|
||||
if (parameter != null) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, propName, "Parameter [{}] on mapper [{}] is deprecated, use [{}]",
|
||||
deprecationLogger.critical(DeprecationCategory.API, propName, "Parameter [{}] on mapper [{}] is deprecated, use [{}]",
|
||||
propName, name, parameter.name);
|
||||
} else {
|
||||
parameter = paramsMap.get(propName);
|
||||
}
|
||||
if (parameter == null) {
|
||||
if (isDeprecatedParameter(propName, parserContext.indexVersionCreated())) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, propName,
|
||||
deprecationLogger.critical(DeprecationCategory.API, propName,
|
||||
"Parameter [{}] has no effect on type [{}] and will be removed in future", propName, type);
|
||||
iterator.remove();
|
||||
continue;
|
||||
|
@ -1158,7 +1158,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable {
|
|||
if (parserContext.isFromDynamicTemplate() && parserContext.indexVersionCreated().before(Version.V_8_0_0)) {
|
||||
// The parameter is unknown, but this mapping is from a dynamic template.
|
||||
// Until 7.x it was possible to use unknown parameters there, so for bwc we need to ignore it
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, propName,
|
||||
deprecationLogger.critical(DeprecationCategory.API, propName,
|
||||
"Parameter [{}] is used in a dynamic template mapping and has no effect on type [{}]. "
|
||||
+ "Usage will result in an error in future major versions and should be removed.",
|
||||
propName,
|
||||
|
@ -1172,7 +1172,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable {
|
|||
);
|
||||
}
|
||||
if (parameter.deprecated) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, propName,
|
||||
deprecationLogger.critical(DeprecationCategory.API, propName,
|
||||
"Parameter [{}] is deprecated and will be removed in a future version",
|
||||
propName);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ public class FieldNamesFieldMapper extends MetadataFieldMapper {
|
|||
throw new MapperParsingException("The `enabled` setting for the `_field_names` field has been deprecated and "
|
||||
+ "removed. Please remove it from your mappings and templates.");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES,
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES,
|
||||
"field_names_enabled_parameter", ENABLED_DEPRECATION_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ public class FieldNamesFieldMapper extends MetadataFieldMapper {
|
|||
if (isEnabled() == false) {
|
||||
throw new IllegalStateException("Cannot run [exists] queries if the [_field_names] field is disabled");
|
||||
}
|
||||
deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "terms_query_on_field_names",
|
||||
deprecationLogger.critical(DeprecationCategory.MAPPINGS, "terms_query_on_field_names",
|
||||
"terms query on the _field_names field is deprecated and will be removed, use exists query instead");
|
||||
return super.termQuery(value, context);
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ public class GeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper<Geomet
|
|||
@Override
|
||||
public GeoShapeFieldMapper build(MapperBuilderContext context) {
|
||||
if (multiFieldsBuilder.hasMultiFields()) {
|
||||
DEPRECATION_LOGGER.deprecate(
|
||||
DEPRECATION_LOGGER.critical(
|
||||
DeprecationCategory.MAPPINGS,
|
||||
"geo_shape_multifields",
|
||||
"Adding multifields to [geo_shape] mappers has no effect and will be forbidden in future"
|
||||
|
|
|
@ -154,7 +154,7 @@ public class IdFieldMapper extends MetadataFieldMapper {
|
|||
IndexFieldDataCache cache,
|
||||
CircuitBreakerService breakerService
|
||||
) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.AGGREGATIONS, "id_field_data", ID_FIELD_DATA_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.critical(DeprecationCategory.AGGREGATIONS, "id_field_data", ID_FIELD_DATA_DEPRECATION_MESSAGE);
|
||||
final IndexFieldData<?> fieldData = fieldDataBuilder.build(cache,
|
||||
breakerService);
|
||||
return new IndexFieldData<>() {
|
||||
|
|
|
@ -120,7 +120,7 @@ public class IpFieldMapper extends FieldMapper {
|
|||
if (indexCreatedVersion.onOrAfter(Version.V_8_0_0)) {
|
||||
throw new MapperParsingException("Error parsing [null_value] on field [" + name() + "]: " + e.getMessage(), e);
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.MAPPINGS, "ip_mapper_null_field", "Error parsing [" +
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.MAPPINGS, "ip_mapper_null_field", "Error parsing [" +
|
||||
nullValue.getValue() + "] as IP in [null_value] on field [" + name() + "]); [null_value] will be ignored");
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ public class ObjectMapper extends Mapper implements Cloneable {
|
|||
}
|
||||
return true;
|
||||
} else if (fieldName.equals("include_in_all")) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "include_in_all",
|
||||
deprecationLogger.critical(DeprecationCategory.MAPPINGS, "include_in_all",
|
||||
"[include_in_all] is deprecated, the _all field have been removed in this version");
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -443,7 +443,7 @@ public class RootObjectMapper extends ObjectMapper {
|
|||
if (failInvalidDynamicTemplates) {
|
||||
throw new IllegalArgumentException(message, lastError);
|
||||
} else {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.TEMPLATES, "invalid_dynamic_template",
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.TEMPLATES, "invalid_dynamic_template",
|
||||
"{}, last error: [{}]", message, lastError.getMessage());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ public class TypeParsers {
|
|||
// For indices created prior to 8.0, we only emit a deprecation warning and do not fail type parsing. This is to
|
||||
// maintain the backwards-compatibility guarantee that we can always load indexes from the previous major version.
|
||||
if (parserContext.indexVersionCreated().before(Version.V_8_0_0)) {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.INDICES,
|
||||
"multifield_within_multifield",
|
||||
"At least one multi-field, ["
|
||||
|
|
|
@ -522,7 +522,7 @@ public abstract class AbstractGeometryQueryBuilder<QB extends AbstractGeometryQu
|
|||
params.id = parser.text();
|
||||
} else if (parser.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
SHAPE_TYPE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("geo_share_query_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("geo_share_query_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
} else if (SHAPE_INDEX_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
params.index = parser.text();
|
||||
} else if (SHAPE_PATH_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class CommonTermsQueryBuilder extends AbstractQueryBuilder<CommonTermsQue
|
|||
}
|
||||
|
||||
public static CommonTermsQueryBuilder fromXContent(XContentParser parser) throws IOException {
|
||||
deprecationLogger.compatibleApiWarning("common_term_query", COMMON_TERMS_QUERY_DEPRECATION_MSG);
|
||||
deprecationLogger.compatibleCritical("common_term_query", COMMON_TERMS_QUERY_DEPRECATION_MSG);
|
||||
throw new ParsingException(parser.getTokenLocation(), COMMON_TERMS_QUERY_DEPRECATION_MSG);
|
||||
}
|
||||
|
||||
|
|
|
@ -356,7 +356,7 @@ public class MoreLikeThisQueryBuilder extends AbstractQueryBuilder<MoreLikeThisQ
|
|||
item.index = parser.text();
|
||||
} else if (parser.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
TYPE.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("more_like_this_query_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("more_like_this_query_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
} else if (ID.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
item.id = parser.text();
|
||||
} else if (DOC.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
|
|
|
@ -82,7 +82,7 @@ public class TypeQueryV7Builder extends AbstractQueryBuilder<TypeQueryV7Builder>
|
|||
}
|
||||
|
||||
public static TypeQueryV7Builder fromXContent(XContentParser parser) throws IOException {
|
||||
deprecationLogger.compatibleApiWarning("type_query", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("type_query", TYPES_DEPRECATION_MESSAGE);
|
||||
throw new ParsingException(parser.getTokenLocation(), TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScore
|
|||
} else {
|
||||
String fieldName;
|
||||
if (field == null) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.QUERIES, "seed_requires_field",
|
||||
deprecationLogger.critical(DeprecationCategory.QUERIES, "seed_requires_field",
|
||||
"As of version 7.0 Elasticsearch will require that a [field] parameter is provided when a [seed] is set");
|
||||
fieldName = IdFieldMapper.NAME;
|
||||
} else {
|
||||
|
|
|
@ -104,7 +104,7 @@ final class SimilarityProviders {
|
|||
throw new IllegalArgumentException("Basic model [" + basicModel + "] isn't supported anymore, " +
|
||||
"please use another model.");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.INDICES, basicModel + "_similarity_model_replaced", "Basic model ["
|
||||
deprecationLogger.critical(DeprecationCategory.INDICES, basicModel + "_similarity_model_replaced", "Basic model ["
|
||||
+ basicModel + "] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "].");
|
||||
model = BASIC_MODELS.get(replacement);
|
||||
assert model != null;
|
||||
|
@ -135,7 +135,7 @@ final class SimilarityProviders {
|
|||
throw new IllegalArgumentException("After effect [" + afterEffect +
|
||||
"] isn't supported anymore, please use another effect.");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.INDICES, afterEffect + "_after_effect_replaced", "After effect ["
|
||||
deprecationLogger.critical(DeprecationCategory.INDICES, afterEffect + "_after_effect_replaced", "After effect ["
|
||||
+ afterEffect + "] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "].");
|
||||
effect = AFTER_EFFECTS.get(replacement);
|
||||
assert effect != null;
|
||||
|
@ -225,7 +225,7 @@ final class SimilarityProviders {
|
|||
if (version.onOrAfter(Version.V_7_0_0)) {
|
||||
throw new IllegalArgumentException("Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.INDICES, "unknown_similarity_setting",
|
||||
deprecationLogger.critical(DeprecationCategory.INDICES, "unknown_similarity_setting",
|
||||
"Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ public final class SimilarityService {
|
|||
defaultSimilarity = (providers.get("default") != null) ? providers.get("default").get()
|
||||
: providers.get(SimilarityService.DEFAULT_SIMILARITY).get();
|
||||
if (providers.get("base") != null) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.QUERIES, "base_similarity_ignored",
|
||||
deprecationLogger.critical(DeprecationCategory.QUERIES, "base_similarity_ignored",
|
||||
"The [base] similarity is ignored since query normalization and coords have been removed");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,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)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "standard_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "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.");
|
||||
|
@ -175,7 +175,7 @@ public final class AnalysisModule {
|
|||
// in certain circumstances to create a new index referencing the standard token filter
|
||||
// until version 7_5_2
|
||||
if (version.before(Version.V_7_6_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "standard_deprecation",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "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.");
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ConditionalProcessor extends AbstractProcessor implements WrappingP
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> FUNCTIONS = Map.of(
|
||||
"_type", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.INDICES, "conditional-processor__type",
|
||||
deprecationLogger.critical(DeprecationCategory.INDICES, "conditional-processor__type",
|
||||
"[types removal] Looking up doc types [_type] in scripts is deprecated.");
|
||||
return value;
|
||||
});
|
||||
|
|
|
@ -306,7 +306,7 @@ public class Node implements Closeable {
|
|||
logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), jvmInfo.getUsingBundledJdk());
|
||||
} else {
|
||||
logger.info("JVM home [{}]", System.getProperty("java.home"));
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.OTHER,
|
||||
"no-jdk",
|
||||
"no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release");
|
||||
|
@ -320,7 +320,7 @@ public class Node implements Closeable {
|
|||
if (Environment.PATH_SHARED_DATA_SETTING.exists(tmpSettings)) {
|
||||
// NOTE: this must be done with an explicit check here because the deprecation property on a path setting will
|
||||
// cause ES to fail to start since logging is not yet initialized on first read of the setting
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.SETTINGS,
|
||||
"shared-data-path",
|
||||
"setting [path.shared_data] is deprecated and will be removed in a future release"
|
||||
|
|
|
@ -59,9 +59,9 @@ public class DeprecationRestHandler implements RestHandler {
|
|||
@Override
|
||||
public void handleRequest(RestRequest request, RestChannel channel, NodeClient client) throws Exception {
|
||||
if (compatibleVersionWarning == false) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, deprecationKey, deprecationMessage);
|
||||
deprecationLogger.critical(DeprecationCategory.API, deprecationKey, deprecationMessage);
|
||||
} else {
|
||||
deprecationLogger.compatibleApiWarning(deprecationKey, deprecationMessage);
|
||||
deprecationLogger.compatibleCritical(deprecationKey, deprecationMessage);
|
||||
}
|
||||
|
||||
handler.handleRequest(request, channel, client);
|
||||
|
|
|
@ -77,7 +77,7 @@ public class RestNodesStatsAction extends BaseRestHandler {
|
|||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if(request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("types")){
|
||||
deprecationLogger.compatibleApiWarning("nodes_stats_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("nodes_stats_types", TYPES_DEPRECATION_MESSAGE);
|
||||
request.param("types");
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class RestCloseIndexAction extends BaseRestHandler {
|
|||
closeIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, closeIndexRequest.indicesOptions()));
|
||||
String waitForActiveShards = request.param("wait_for_active_shards");
|
||||
if ("index-setting".equalsIgnoreCase(waitForActiveShards)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "close-index-wait_for_active_shards-index-setting",
|
||||
deprecationLogger.critical(DeprecationCategory.SETTINGS, "close-index-wait_for_active_shards-index-setting",
|
||||
"?wait_for_active_shards=index-setting is now the default behaviour; the 'index-setting' value for this parameter " +
|
||||
"should no longer be used since it will become unsupported in version " + (Version.V_7_0_0.major + 2));
|
||||
// TODO in v9:
|
||||
|
|
|
@ -62,7 +62,7 @@ public class RestCreateIndexAction extends BaseRestHandler {
|
|||
CreateIndexRequest createIndexRequest = new CreateIndexRequest(request.param("index"));
|
||||
if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {
|
||||
request.param(INCLUDE_TYPE_NAME_PARAMETER);// just consume, it is always replaced with _doc
|
||||
deprecationLogger.compatibleApiWarning("create_index_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("create_index_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
if (request.hasContent()) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class RestGetFieldMappingAction extends BaseRestHandler {
|
|||
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7) {
|
||||
if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {
|
||||
deprecationLogger.compatibleApiWarning("get_field_mapping_with_types", INCLUDE_TYPE_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("get_field_mapping_with_types", INCLUDE_TYPE_DEPRECATION_MESSAGE);
|
||||
}
|
||||
boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY);
|
||||
final String[] types = request.paramAsStringArrayOrEmptyIfAll("type");
|
||||
|
@ -77,7 +77,7 @@ public class RestGetFieldMappingAction extends BaseRestHandler {
|
|||
|
||||
if (request.hasParam("local")) {
|
||||
request.param("local");
|
||||
deprecationLogger.compatibleApiWarning(
|
||||
deprecationLogger.compatibleCritical(
|
||||
"get_field_mapping_local",
|
||||
"Use [local] in get field mapping requests is deprecated. " + "The parameter will be removed in the next major version"
|
||||
);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RestGetIndexTemplateAction extends BaseRestHandler {
|
|||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {
|
||||
deprecationLogger.compatibleApiWarning("get_index_template_include_type_name", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("get_index_template_include_type_name", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
final String[] names = Strings.splitStringByCommaToArray(request.param("name"));
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class RestGetIndicesAction extends BaseRestHandler {
|
|||
// starting with 7.0 we don't include types by default in the response to GET requests
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
request.hasParam(INCLUDE_TYPE_NAME_PARAMETER) && request.method().equals(GET)) {
|
||||
deprecationLogger.compatibleApiWarning("get_indices_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("get_indices_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RestGetMappingAction extends BaseRestHandler {
|
|||
if (request.getRestApiVersion() == RestApiVersion.V_7) {
|
||||
if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {
|
||||
request.param(INCLUDE_TYPE_NAME_PARAMETER);
|
||||
deprecationLogger.compatibleApiWarning("get_mapping_with_types", INCLUDE_TYPE_DEPRECATION_MSG);
|
||||
deprecationLogger.compatibleCritical("get_mapping_with_types", INCLUDE_TYPE_DEPRECATION_MSG);
|
||||
}
|
||||
final String[] types = request.paramAsStringArrayOrEmptyIfAll("type");
|
||||
if (request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY) == false && types.length > 0) {
|
||||
|
@ -78,7 +78,7 @@ public class RestGetMappingAction extends BaseRestHandler {
|
|||
" include_type_name is set to true.");
|
||||
}
|
||||
if (request.method().equals(HEAD)) {
|
||||
deprecationLogger.compatibleApiWarning("get_mapping_types_removal",
|
||||
deprecationLogger.compatibleCritical("get_mapping_types_removal",
|
||||
"Type exists requests are deprecated, as types have been deprecated.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
|
|||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if(request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("types")){
|
||||
deprecationLogger.compatibleApiWarning("indices_stats_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("indices_stats_types", TYPES_DEPRECATION_MESSAGE);
|
||||
request.param("types");
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,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.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("template")) {
|
||||
deprecationLogger.compatibleApiWarning("template_parameter_deprecation",
|
||||
deprecationLogger.compatibleCritical("template_parameter_deprecation",
|
||||
"Deprecated parameter [template] used, replaced by [index_patterns]");
|
||||
putRequest.patterns(List.of(request.param("template")));
|
||||
} else {
|
||||
|
@ -70,7 +70,7 @@ public class RestPutIndexTemplateAction extends BaseRestHandler {
|
|||
request.getXContentType()).v2();
|
||||
if(request.getRestApiVersion() == RestApiVersion.V_7) {
|
||||
if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER) ) {
|
||||
deprecationLogger.compatibleApiWarning("put_index_template_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("put_index_template_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY);
|
||||
if(includeTypeName) {
|
||||
|
@ -82,7 +82,7 @@ public class RestPutIndexTemplateAction extends BaseRestHandler {
|
|||
sourceAsMap = RestCreateIndexAction.prepareMappings(sourceAsMap);
|
||||
}
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && sourceAsMap.containsKey("template")) {
|
||||
deprecationLogger.compatibleApiWarning("template_field_deprecation",
|
||||
deprecationLogger.compatibleCritical("template_field_deprecation",
|
||||
"Deprecated field [template] used, replaced by [index_patterns]");
|
||||
putRequest.patterns(List.of((String) sourceAsMap.remove("template")));
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class RestPutMappingAction extends BaseRestHandler {
|
|||
final boolean includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER,
|
||||
DEFAULT_INCLUDE_TYPE_NAME_POLICY);
|
||||
if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {
|
||||
deprecationLogger.compatibleApiWarning("put_mapping_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("put_mapping_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
final String type = request.param("type");
|
||||
if (includeTypeName == false &&
|
||||
|
|
|
@ -39,7 +39,7 @@ public abstract class RestResizeHandler extends BaseRestHandler {
|
|||
@Override
|
||||
public final RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("copy_settings")) {
|
||||
deprecationLogger.compatibleApiWarning("copy_settings", "parameter [copy_settings] is deprecated and will be removed in 8.0.0");
|
||||
deprecationLogger.compatibleCritical("copy_settings", "parameter [copy_settings] is deprecated and will be removed in 8.0.0");
|
||||
|
||||
final String rawCopySettings = request.param("copy_settings");
|
||||
final boolean copySettings = Booleans.parseBoolean(rawCopySettings);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class RestRolloverIndexAction extends BaseRestHandler {
|
|||
boolean includeTypeName = false;
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7) {
|
||||
if (request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {
|
||||
deprecationLogger.compatibleApiWarning("index_rollover_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("index_rollover_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
includeTypeName = request.paramAsBoolean(INCLUDE_TYPE_NAME_PARAMETER, DEFAULT_INCLUDE_TYPE_NAME_POLICY);
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class RestValidateQueryAction extends BaseRestHandler {
|
|||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) {
|
||||
deprecationLogger.compatibleApiWarning("validate_query_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("validate_query_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
request.param("type");
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class RestGetSourceAction extends BaseRestHandler {
|
|||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) {
|
||||
request.param("type"); // consume and ignore the type
|
||||
deprecationLogger.compatibleApiWarning("get_source_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("get_source_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
final GetRequest getRequest = new GetRequest(request.param("index"), request.param("id"));
|
||||
|
|
|
@ -53,7 +53,7 @@ public class RestMultiTermVectorsAction extends BaseRestHandler {
|
|||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) {
|
||||
request.param("type");
|
||||
deprecationLogger.compatibleApiWarning(DeprecationRestHandler.DEPRECATED_ROUTE_KEY, TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical(DeprecationRestHandler.DEPRECATED_ROUTE_KEY, TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
MultiTermVectorsRequest multiTermVectorsRequest = new MultiTermVectorsRequest();
|
||||
TermVectorsRequest template = new TermVectorsRequest()
|
||||
|
|
|
@ -59,7 +59,7 @@ public class RestCountAction extends BaseRestHandler {
|
|||
@Override
|
||||
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) {
|
||||
deprecationLogger.compatibleApiWarning("count_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("count_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
request.param("type");
|
||||
}
|
||||
SearchRequest countRequest = new SearchRequest(Strings.splitStringByCommaToArray(request.param("index")));
|
||||
|
|
|
@ -131,7 +131,7 @@ public class RestSearchAction extends BaseRestHandler {
|
|||
IntConsumer setSize) throws IOException {
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("type")) {
|
||||
request.param("type");
|
||||
deprecationLogger.compatibleApiWarning("search_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
deprecationLogger.compatibleCritical("search_with_types", TYPES_DEPRECATION_MESSAGE);
|
||||
}
|
||||
|
||||
if (searchRequest.source() == null) {
|
||||
|
@ -209,7 +209,7 @@ public class RestSearchAction extends BaseRestHandler {
|
|||
int size = request.paramAsInt("size", SearchService.DEFAULT_SIZE);
|
||||
if (request.getRestApiVersion() == RestApiVersion.V_7 && size == -1) {
|
||||
// we treat -1 as not-set, but deprecate it to be able to later remove this funny extra treatment
|
||||
deprecationLogger.compatibleApiWarning(
|
||||
deprecationLogger.compatibleCritical(
|
||||
"search-api-size-1",
|
||||
"Using search size of -1 is deprecated and will be removed in future versions. "
|
||||
+ "Instead, don't use the `size` parameter if you don't want to set it explicitly."
|
||||
|
|
|
@ -24,13 +24,13 @@ abstract class AbstractSortScript extends DocBasedScript implements ScorerAware
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> PARAMS_FUNCTIONS = Map.of(
|
||||
"doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "sort-script_doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "sort-script_doc",
|
||||
"Accessing variable [doc] via [params.doc] from within an sort-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
},
|
||||
"_doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "sort-script__doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "sort-script__doc",
|
||||
"Accessing variable [doc] via [params._doc] from within an sort-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
|
|
|
@ -30,13 +30,13 @@ public abstract class AggregationScript extends DocBasedScript implements Scorer
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> PARAMS_FUNCTIONS = Map.of(
|
||||
"doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "aggregation-script_doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "aggregation-script_doc",
|
||||
"Accessing variable [doc] via [params.doc] from within an aggregation-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
},
|
||||
"_doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "aggregation-script__doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "aggregation-script__doc",
|
||||
"Accessing variable [doc] via [params._doc] from within an aggregation-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
|
|
|
@ -29,13 +29,13 @@ public abstract class FieldScript extends DocBasedScript {
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> PARAMS_FUNCTIONS = Map.of(
|
||||
"doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "field-script_doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "field-script_doc",
|
||||
"Accessing variable [doc] via [params.doc] from within an field-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
},
|
||||
"_doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "field-script__doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "field-script__doc",
|
||||
"Accessing variable [doc] via [params._doc] from within an field-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
|
|
|
@ -58,7 +58,7 @@ public class JodaCompatibleZonedDateTime
|
|||
@SuppressLoggerChecks(reason = "safely delegates to logger")
|
||||
@Override
|
||||
public Void run() {
|
||||
deprecationLogger.deprecate(category, key, message, params);
|
||||
deprecationLogger.critical(category, key, message, params);
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -53,13 +53,13 @@ public abstract class ScoreScript extends DocBasedScript {
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> PARAMS_FUNCTIONS = Map.of(
|
||||
"doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "score-script_doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "score-script_doc",
|
||||
"Accessing variable [doc] via [params.doc] from within an score-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
},
|
||||
"_doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "score-script__doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "score-script__doc",
|
||||
"Accessing variable [doc] via [params._doc] from within an score-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
|
|
|
@ -208,13 +208,13 @@ public final class ScriptMetadata implements Metadata.Custom, Writeable, ToXCont
|
|||
|
||||
if (source.getSource().isEmpty()) {
|
||||
if (source.getLang().equals(Script.DEFAULT_TEMPLATE_LANG)) {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.TEMPLATES,
|
||||
"empty_templates",
|
||||
"empty templates should no longer be used"
|
||||
);
|
||||
} else {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.TEMPLATES,
|
||||
"empty_scripts",
|
||||
"empty scripts should no longer be used"
|
||||
|
|
|
@ -57,18 +57,18 @@ public class ScriptedMetricAggContexts {
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> PARAMS_FUNCTIONS = Map.of(
|
||||
"doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "map-script_doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "map-script_doc",
|
||||
"Accessing variable [doc] via [params.doc] from within an scripted metric agg map script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
},
|
||||
"_doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "map-script__doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "map-script__doc",
|
||||
"Accessing variable [doc] via [params._doc] from within an scripted metric agg map script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
}, "_agg", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "map-script__agg",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "map-script__agg",
|
||||
"Accessing variable [_agg] via [params._agg] from within a scripted metric agg map script "
|
||||
+ "is deprecated in favor of using [state].");
|
||||
return value;
|
||||
|
|
|
@ -134,10 +134,10 @@ 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)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "empty_templates",
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_templates",
|
||||
"empty templates should no longer be used");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "empty_scripts",
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_scripts",
|
||||
"empty scripts should no longer be used");
|
||||
}
|
||||
} else {
|
||||
|
@ -146,10 +146,10 @@ 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)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "empty_templates",
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_templates",
|
||||
"empty templates should no longer be used");
|
||||
} else {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "empty_scripts",
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_scripts",
|
||||
"empty scripts should no longer be used");
|
||||
}
|
||||
} else {
|
||||
|
@ -250,7 +250,7 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
|
|||
token = parser.nextToken();
|
||||
|
||||
if (token == Token.END_OBJECT) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.TEMPLATES, "empty_templates", "empty templates should no longer be used");
|
||||
deprecationLogger.critical(DeprecationCategory.TEMPLATES, "empty_templates", "empty templates should no longer be used");
|
||||
|
||||
return new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap());
|
||||
}
|
||||
|
|
|
@ -29,13 +29,13 @@ public abstract class TermsSetQueryScript {
|
|||
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(DynamicMap.class);
|
||||
private static final Map<String, Function<Object, Object>> PARAMS_FUNCTIONS = Map.of(
|
||||
"doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "terms-set-query-script_doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "terms-set-query-script_doc",
|
||||
"Accessing variable [doc] via [params.doc] from within an terms-set-query-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
},
|
||||
"_doc", value -> {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SCRIPTING, "terms-set-query-script__doc",
|
||||
deprecationLogger.critical(DeprecationCategory.SCRIPTING, "terms-set-query-script__doc",
|
||||
"Accessing variable [doc] via [params._doc] from within an terms-set-query-script "
|
||||
+ "is deprecated in favor of directly accessing [doc].");
|
||||
return value;
|
||||
|
|
|
@ -577,7 +577,7 @@ public abstract class InternalOrder extends BucketOrder {
|
|||
}
|
||||
// _term and _time order deprecated in 6.0; replaced by _key
|
||||
if (parser.getRestApiVersion() == RestApiVersion.V_7 && ("_term".equals(orderKey) || "_time".equals(orderKey))) {
|
||||
deprecationLogger.compatibleApiWarning(
|
||||
deprecationLogger.compatibleCritical(
|
||||
"_term_and_time_key_removal",
|
||||
"Deprecated aggregation order key [{}] used, replaced by [_key]",
|
||||
orderKey
|
||||
|
|
|
@ -51,7 +51,7 @@ public final class AutoDateHistogramAggregatorFactory extends ValuesSourceAggreg
|
|||
CardinalityUpperBound cardinality,
|
||||
Map<String, Object> metadata) -> {
|
||||
|
||||
DEPRECATION_LOGGER.deprecate(
|
||||
DEPRECATION_LOGGER.critical(
|
||||
DeprecationCategory.AGGREGATIONS,
|
||||
"auto-date-histogram-boolean",
|
||||
"Running AutoIntervalDateHistogram aggregations on [boolean] fields is deprecated"
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class DateHistogramAggregatorFactory extends ValuesSourceAggregator
|
|||
parent,
|
||||
cardinality,
|
||||
metadata) -> {
|
||||
DEPRECATION_LOGGER.deprecate(
|
||||
DEPRECATION_LOGGER.critical(
|
||||
DeprecationCategory.AGGREGATIONS,
|
||||
"date-histogram-boolean",
|
||||
"Running DateHistogram aggregations on [boolean] fields is deprecated"
|
||||
|
|
|
@ -104,7 +104,7 @@ public class DateIntervalWrapper implements ToXContentFragment, Writeable {
|
|||
but immediately adapt it into either fixed or calendar interval.
|
||||
*/
|
||||
parser.declareField((wrapper, interval) -> {
|
||||
DEPRECATION_LOGGER.deprecate(DeprecationCategory.AGGREGATIONS, "date-interval-getter", DEPRECATION_TEXT);
|
||||
DEPRECATION_LOGGER.critical(DeprecationCategory.AGGREGATIONS, "date-interval-getter", DEPRECATION_TEXT);
|
||||
if (interval instanceof Long) {
|
||||
wrapper.fixedInterval(new DateHistogramInterval(interval + "ms"));
|
||||
} else {
|
||||
|
|
|
@ -71,7 +71,7 @@ public class DateRangeAggregationBuilder extends AbstractRangeBuilder<DateRangeA
|
|||
Aggregator parent,
|
||||
CardinalityUpperBound cardinality,
|
||||
Map<String, Object> metadata) -> {
|
||||
DEPRECATION_LOGGER.deprecate(
|
||||
DEPRECATION_LOGGER.critical(
|
||||
DeprecationCategory.AGGREGATIONS,
|
||||
"Range-boolean",
|
||||
"Running Range or DateRange aggregations on [boolean] fields is deprecated"
|
||||
|
|
|
@ -372,7 +372,7 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac
|
|||
if ("global_ordinals".equals(value)) {
|
||||
return GLOBAL_ORDINALS;
|
||||
} else if ("global_ordinals_hash".equals(value)) {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.AGGREGATIONS,
|
||||
"global_ordinals_hash",
|
||||
"global_ordinals_hash is deprecated. Please use [global_ordinals] instead."
|
||||
|
|
|
@ -1124,7 +1124,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R
|
|||
int parsedSize = parser.intValue();
|
||||
if (parser.getRestApiVersion() == RestApiVersion.V_7 && parsedSize == -1) {
|
||||
// we treat -1 as not-set, but deprecate it to be able to later remove this funny extra treatment
|
||||
deprecationLogger.compatibleApiWarning(
|
||||
deprecationLogger.compatibleCritical(
|
||||
"search-api-size-1",
|
||||
"Using search size of -1 is deprecated and will be removed in future versions. "
|
||||
+ "Instead, don't use the `size` parameter if you don't want to set it explicitly."
|
||||
|
@ -1180,7 +1180,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R
|
|||
}
|
||||
} else if (parser.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
INDICES_BOOST_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("indices_boost_object_format",
|
||||
deprecationLogger.compatibleCritical("indices_boost_object_format",
|
||||
"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) {
|
||||
|
|
|
@ -64,7 +64,7 @@ public final class FieldAndFormat implements Writeable, ToXContentObject {
|
|||
} else {
|
||||
String text = p.text();
|
||||
if (text.equals(USE_DEFAULT_FORMAT)) {
|
||||
DEPRECATION_LOGGER.compatibleApiWarning("explicit_default_format",
|
||||
DEPRECATION_LOGGER.compatibleCritical("explicit_default_format",
|
||||
"[" + USE_DEFAULT_FORMAT + "] is a special format that was only used to " +
|
||||
"ease the transition to 7.x. It has become the default and shouldn't be set explicitly anymore.");
|
||||
return null;
|
||||
|
|
|
@ -411,7 +411,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
|||
} else if (token == XContentParser.Token.START_OBJECT) {
|
||||
if (parser.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
NESTED_FILTER_FIELD.match(currentName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("nested_filter",
|
||||
deprecationLogger.compatibleCritical("nested_filter",
|
||||
"[nested_filter] has been removed in favour of the [nested] parameter");
|
||||
throw new ParsingException(
|
||||
parser.getTokenLocation(),
|
||||
|
@ -436,7 +436,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
|
|||
} else if (token.isValue()) {
|
||||
if (parser.getRestApiVersion() == RestApiVersion.V_7 &&
|
||||
NESTED_PATH_FIELD.match(currentName, parser.getDeprecationHandler())) {
|
||||
deprecationLogger.compatibleApiWarning("nested_path",
|
||||
deprecationLogger.compatibleCritical("nested_path",
|
||||
"[nested_path] has been removed in favour of the [nested] parameter");
|
||||
throw new ParsingException(
|
||||
parser.getTokenLocation(),
|
||||
|
|
|
@ -280,7 +280,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
|
|||
MappedFieldType mappedFieldType = fieldResolver.apply(fieldName);
|
||||
if (mappedFieldType == null) {
|
||||
if (indexVersionCreated.before(Version.V_7_0_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "geo_context_mapping",
|
||||
deprecationLogger.critical(DeprecationCategory.MAPPINGS, "geo_context_mapping",
|
||||
"field [{}] referenced in context [{}] is not defined in the mapping", fieldName, name);
|
||||
} else {
|
||||
throw new ElasticsearchParseException(
|
||||
|
@ -288,7 +288,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
|
|||
}
|
||||
} else if (GeoPointFieldMapper.CONTENT_TYPE.equals(mappedFieldType.typeName()) == false) {
|
||||
if (indexVersionCreated.before(Version.V_7_0_0)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.MAPPINGS, "geo_context_mapping",
|
||||
deprecationLogger.critical(DeprecationCategory.MAPPINGS, "geo_context_mapping",
|
||||
"field [{}] referenced in context [{}] must be mapped to geo_point, found [{}]",
|
||||
fieldName, name, mappedFieldType.typeName());
|
||||
} else {
|
||||
|
|
|
@ -401,7 +401,7 @@ public class RestoreService implements ClusterStateApplier {
|
|||
// log a deprecation warning if the any of the indexes to delete were included in the request and the snapshot
|
||||
// is from a version that should have feature states
|
||||
if (snapshotInfo.version().onOrAfter(Version.V_7_12_0) && explicitlyRequestedSystemIndices.isEmpty() == false) {
|
||||
deprecationLogger.deprecate(
|
||||
deprecationLogger.critical(
|
||||
DeprecationCategory.API,
|
||||
"restore-system-index-from-snapshot",
|
||||
"Restoring system indices by name is deprecated. Use feature states instead. System indices: "
|
||||
|
|
|
@ -91,7 +91,7 @@ public class TransportInfo implements ReportingService.Info {
|
|||
if (InetAddresses.isInetAddress(hostString) == false) {
|
||||
publishAddressString = hostString + '/' + publishAddress.toString();
|
||||
if (cnameInPublishAddressProperty) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.SETTINGS, "cname_in_publish_address",
|
||||
deprecationLogger.critical(DeprecationCategory.SETTINGS, "cname_in_publish_address",
|
||||
"es.transport.cname_in_publish_address system property is deprecated and no longer affects " + propertyName +
|
||||
" formatting. Remove this property to get rid of this deprecation warning.");
|
||||
}
|
||||
|
|
|
@ -107,14 +107,14 @@ public class TransportAnalyzeActionTests extends ESTestCase {
|
|||
|
||||
@Override
|
||||
public TokenStream create(TokenStream tokenStream) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "deprecated_token_filter_create",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "deprecated_token_filter_create",
|
||||
"Using deprecated token filter [deprecated]");
|
||||
return tokenStream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TokenStream normalize(TokenStream tokenStream) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "deprecated_token_filter_normalize",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "deprecated_token_filter_normalize",
|
||||
"Using deprecated token filter [deprecated]");
|
||||
return tokenStream;
|
||||
}
|
||||
|
|
|
@ -314,7 +314,7 @@ public class AnalysisRegistryTests extends ESTestCase {
|
|||
@Override
|
||||
public TokenStream create(TokenStream tokenStream) {
|
||||
if (indexSettings.getIndexVersionCreated().equals(Version.CURRENT)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "deprecated_token_filter",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "deprecated_token_filter",
|
||||
"Using deprecated token filter [deprecated]");
|
||||
}
|
||||
return tokenStream;
|
||||
|
@ -343,7 +343,7 @@ public class AnalysisRegistryTests extends ESTestCase {
|
|||
|
||||
@Override
|
||||
public TokenStream create(TokenStream tokenStream) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "unused_token_filter",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "unused_token_filter",
|
||||
"Using deprecated token filter [unused]");
|
||||
return tokenStream;
|
||||
}
|
||||
|
@ -357,7 +357,7 @@ public class AnalysisRegistryTests extends ESTestCase {
|
|||
|
||||
@Override
|
||||
public TokenStream create(TokenStream tokenStream) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.ANALYSIS, "deprecated_normalizer",
|
||||
deprecationLogger.critical(DeprecationCategory.ANALYSIS, "deprecated_normalizer",
|
||||
"Using deprecated token filter [deprecated_normalizer]");
|
||||
return tokenStream;
|
||||
}
|
||||
|
|
|
@ -76,10 +76,10 @@ public class DeprecationRestHandlerTests extends ESTestCase {
|
|||
// log, then forward
|
||||
if (compatibleVersionWarning) {
|
||||
inOrder.verify(deprecationLogger)
|
||||
.compatibleApiWarning("deprecated_route_GET_/some/path", deprecationMessage);
|
||||
.compatibleCritical("deprecated_route_GET_/some/path", deprecationMessage);
|
||||
} else {
|
||||
inOrder.verify(deprecationLogger)
|
||||
.deprecate(DeprecationCategory.API, "deprecated_route_GET_/some/path", deprecationMessage);
|
||||
.critical(DeprecationCategory.API, "deprecated_route_GET_/some/path", deprecationMessage);
|
||||
}
|
||||
|
||||
inOrder.verify(handler).handleRequest(request, channel, client);
|
||||
|
|
|
@ -253,7 +253,7 @@ public class ESLoggerUsageTests extends ESTestCase {
|
|||
|
||||
public void checkDeprecationLogger() {
|
||||
DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(ESLoggerUsageTests.class);
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, "key","message {}", 123);
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, "key","message {}", 123);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class DeprecatedQueryBuilder extends AbstractQueryBuilder<DeprecatedQuery
|
|||
|
||||
@Override
|
||||
protected Query doToQuery(SearchExecutionContext context) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.QUERIES, "to_query", "[deprecated] query");
|
||||
deprecationLogger.critical(DeprecationCategory.QUERIES, "to_query", "[deprecated] query");
|
||||
return new MatchAllDocsQuery();
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ public class RestGetLicenseAction extends BaseRestHandler {
|
|||
// In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0 the flag is deprecated and can only be true
|
||||
// TODO Remove this from 9.0
|
||||
if (request.hasParam("accept_enterprise")) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "get_license_accept_enterprise",
|
||||
deprecationLogger.critical(DeprecationCategory.API, "get_license_accept_enterprise",
|
||||
"Including [accept_enterprise] in get license requests is deprecated." +
|
||||
" The parameter will be removed in the next major version");
|
||||
if (request.paramAsBoolean("accept_enterprise", true) == false
|
||||
|
|
|
@ -354,7 +354,7 @@ public class XPackPlugin extends XPackClientPlugin
|
|||
if (Files.exists(config) == false) {
|
||||
Path legacyConfig = env.configFile().resolve("x-pack").resolve(name);
|
||||
if (Files.exists(legacyConfig)) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.OTHER, "config_file_path",
|
||||
deprecationLogger.critical(DeprecationCategory.OTHER, "config_file_path",
|
||||
"Config file [" + name + "] is in a deprecated location. Move from " +
|
||||
legacyConfig.toString() + " to " + config.toString());
|
||||
return legacyConfig;
|
||||
|
|
|
@ -49,7 +49,7 @@ public class RestXPackInfoAction extends BaseRestHandler {
|
|||
// In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0 the flag is deprecated and can only be true
|
||||
// TODO Remove this from 9.0
|
||||
if (request.hasParam("accept_enterprise")) {
|
||||
deprecationLogger.deprecate(DeprecationCategory.API, "get_license_accept_enterprise",
|
||||
deprecationLogger.critical(DeprecationCategory.API, "get_license_accept_enterprise",
|
||||
"Including [accept_enterprise] in get license requests is deprecated." +
|
||||
" The parameter will be removed in the next major version");
|
||||
if (request.paramAsBoolean("accept_enterprise", true) == false
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue