diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java index b70c7c4fa32cd..f36cc50d94f47 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/DeprecationChecks.java @@ -40,7 +40,7 @@ private DeprecationChecks() { static List> NODE_SETTINGS_CHECKS = Collections.unmodifiableList(Arrays.asList( - // STUB + NodeDeprecationChecks::javaVersionCheck )); static List> INDEX_SETTINGS_CHECKS = diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java new file mode 100644 index 0000000000000..2f04fcdcbe8df --- /dev/null +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/NodeDeprecationChecks.java @@ -0,0 +1,29 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +package org.elasticsearch.xpack.deprecation; + +import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules; +import org.elasticsearch.bootstrap.JavaVersion; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; + +/** + * Node-specific deprecation checks + */ +public class NodeDeprecationChecks { + static DeprecationIssue javaVersionCheck(Settings nodeSettings, PluginsAndModules plugins) { + if (JavaVersion.current().compareTo(JavaVersion.parse("11")) < 0) { + return new DeprecationIssue(DeprecationIssue.Level.CRITICAL, + "Java 11 is required", + "https://www.elastic.co/guide/en/elasticsearch/reference/master/breaking-changes-8.0.html" + + "#_java_11_is_required", + "Java 11 will be required for future versions of Elasticsearch, this node is running version " + + JavaVersion.current().toString()); + } + return null; + } +}