Skip to content

Commit cf3dc57

Browse files
authored
Remove no-jdk deprecations (#85765)
The no-jdk distributions exist in 7.x and before. They were removed with 8.0. This commit removes the remaining deprecation messages for using the no-jdk distribution. Note that when talking with an older node, we drop the bundledJdk attribute. This is ok because it is only possible for this to not be true when talking with a 7.17 node, during an upgrade, and the usingBundledJdk is retained, which is the important thing if debugging a problem. relates #76896 relates #85758
1 parent b361ff2 commit cf3dc57

File tree

13 files changed

+13
-55
lines changed

13 files changed

+13
-55
lines changed

benchmarks/src/main/resources/org/elasticsearch/benchmark/xcontent/monitor_cluster_stats.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@
262262
"vm_name" : "OpenJDK 64-Bit Server VM",
263263
"vm_version" : "11.0.7.7",
264264
"vm_vendor" : "OpenJDK",
265-
"bundled_jdk" : false,
266265
"using_bundled_jdk" : null,
267266
"count" : 15
268267
}

distribution/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,10 +527,6 @@ subprojects {
527527
'zip': 'zip'
528528
],
529529

530-
'es.bundled_jdk': [
531-
'def': 'true'
532-
],
533-
534530
'license.name': [
535531
'deb': 'Elastic-License'
536532
],

distribution/src/bin/elasticsearch

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ if [[ $DAEMONIZE = false ]]; then
116116
-Des.path.conf="$ES_PATH_CONF" \
117117
-Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \
118118
-Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
119-
-Des.bundled_jdk="$ES_BUNDLED_JDK" \
120119
-cp "$ES_CLASSPATH" \
121120
org.elasticsearch.bootstrap.Elasticsearch \
122121
"${ARG_LIST[@]}" <<<"$KEYSTORE_PASSWORD"
@@ -128,7 +127,6 @@ else
128127
-Des.path.conf="$ES_PATH_CONF" \
129128
-Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \
130129
-Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
131-
-Des.bundled_jdk="$ES_BUNDLED_JDK" \
132130
-cp "$ES_CLASSPATH" \
133131
org.elasticsearch.bootstrap.Elasticsearch \
134132
"${ARG_LIST[@]}" \

distribution/src/bin/elasticsearch-env

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,6 @@ ES_PATH_CONF=`cd "$ES_PATH_CONF"; pwd`
9191

9292
9393
94-
95-
96-
if [[ "$ES_BUNDLED_JDK" == "false" ]]; then
97-
echo "warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release" >&2
98-
fi
9994

10095
if [[ "$ES_DISTRIBUTION_TYPE" == "docker" ]]; then
10196
# Allow environment variables to be set by creating a file with the

distribution/src/bin/elasticsearch-env.bat

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ for %%I in ("%ES_PATH_CONF%..") do set ES_PATH_CONF=%%~dpfI
2828

2929
set ES_DISTRIBUTION_FLAVOR=@es.distribution.flavor@
3030
set ES_DISTRIBUTION_TYPE=@es.distribution.type@
31-
set ES_BUNDLED_JDK=@es.bundled_jdk@
32-
33-
if "%ES_BUNDLED_JDK%" == "false" (
34-
echo "warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release" >&2
35-
)
3631

3732
cd /d "%ES_HOME%"
3833

distribution/src/bin/elasticsearch-service.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ if "%JVM_SS%" == "" (
194194
set OTHER_JAVA_OPTS=%OTHER_JAVA_OPTS:"=%
195195
set OTHER_JAVA_OPTS=%OTHER_JAVA_OPTS:~1%
196196

197-
set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%";-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%";-Des.distribution.type="%ES_DISTRIBUTION_TYPE%";-Des.bundled_jdk="%ES_BUNDLED_JDK%"
197+
set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%";-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%";-Des.distribution.type="%ES_DISTRIBUTION_TYPE%"
198198

199199
if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
200200
if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

distribution/src/bin/elasticsearch.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ ECHO.!KEYSTORE_PASSWORD!| %JAVA% %ES_JAVA_OPTS% -Delasticsearch ^
156156
-Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" ^
157157
-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%" ^
158158
-Des.distribution.type="%ES_DISTRIBUTION_TYPE%" ^
159-
-Des.bundled_jdk="%ES_BUNDLED_JDK%" ^
160159
-cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!
161160

162161
endlocal

docs/reference/cluster/stats.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ Vendor of the JVM.
10411041
10421042
`bundled_jdk`::
10431043
(Boolean)
1044-
If `true`, the JVM includes a bundled Java Development Kit (JDK).
1044+
Always `true`. All distributions come with a bundled Java Development Kit (JDK).
10451045
10461046
`using_bundled_jdk`::
10471047
(Boolean)

server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
554554
builder.field(Fields.VM_NAME, v.getKey().vmName);
555555
builder.field(Fields.VM_VERSION, v.getKey().vmVersion);
556556
builder.field(Fields.VM_VENDOR, v.getKey().vmVendor);
557-
builder.field(Fields.BUNDLED_JDK, v.getKey().bundledJdk);
557+
builder.field(Fields.BUNDLED_JDK, true); // bundled_jdk is retained for backcompat
558558
builder.field(Fields.USING_BUNDLED_JDK, v.getKey().usingBundledJdk);
559559
builder.field(Fields.COUNT, v.getValue());
560560
builder.endObject();
@@ -575,15 +575,13 @@ public static class JvmVersion {
575575
String vmName;
576576
String vmVersion;
577577
String vmVendor;
578-
boolean bundledJdk;
579578
Boolean usingBundledJdk;
580579

581580
JvmVersion(JvmInfo jvmInfo) {
582581
version = jvmInfo.version();
583582
vmName = jvmInfo.getVmName();
584583
vmVersion = jvmInfo.getVmVersion();
585584
vmVendor = jvmInfo.getVmVendor();
586-
bundledJdk = jvmInfo.getBundledJdk();
587585
usingBundledJdk = jvmInfo.getUsingBundledJdk();
588586
}
589587

server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
package org.elasticsearch.monitor.jvm;
1010

1111
import org.apache.lucene.util.Constants;
12+
import org.elasticsearch.Version;
1213
import org.elasticsearch.common.io.stream.StreamInput;
1314
import org.elasticsearch.common.io.stream.StreamOutput;
1415
import org.elasticsearch.common.io.stream.Writeable;
1516
import org.elasticsearch.common.unit.ByteSizeValue;
16-
import org.elasticsearch.core.Booleans;
1717
import org.elasticsearch.core.PathUtils;
1818
import org.elasticsearch.core.SuppressForbidden;
1919
import org.elasticsearch.node.ReportingService;
@@ -141,17 +141,13 @@ public class JvmInfo implements ReportingService.Info {
141141

142142
}
143143

144-
final boolean bundledJdk = Booleans.parseBoolean(System.getProperty("es.bundled_jdk", Boolean.FALSE.toString()));
145-
final Boolean usingBundledJdk = bundledJdk ? usingBundledJdk() : null;
146-
147144
INSTANCE = new JvmInfo(
148145
ProcessHandle.current().pid(),
149146
System.getProperty("java.version"),
150147
runtimeMXBean.getVmName(),
151148
runtimeMXBean.getVmVersion(),
152149
runtimeMXBean.getVmVendor(),
153-
bundledJdk,
154-
usingBundledJdk,
150+
usingBundledJdk(),
155151
runtimeMXBean.getStartTime(),
156152
configuredInitialHeapSize,
157153
configuredMaxHeapSize,
@@ -200,7 +196,6 @@ public static JvmInfo jvmInfo() {
200196
private final String vmName;
201197
private final String vmVersion;
202198
private final String vmVendor;
203-
private final boolean bundledJdk;
204199
private final Boolean usingBundledJdk;
205200
private final long startTime;
206201
private final long configuredInitialHeapSize;
@@ -225,7 +220,6 @@ private JvmInfo(
225220
String vmName,
226221
String vmVersion,
227222
String vmVendor,
228-
boolean bundledJdk,
229223
Boolean usingBundledJdk,
230224
long startTime,
231225
long configuredInitialHeapSize,
@@ -249,7 +243,6 @@ private JvmInfo(
249243
this.vmName = vmName;
250244
this.vmVersion = vmVersion;
251245
this.vmVendor = vmVendor;
252-
this.bundledJdk = bundledJdk;
253246
this.usingBundledJdk = usingBundledJdk;
254247
this.startTime = startTime;
255248
this.configuredInitialHeapSize = configuredInitialHeapSize;
@@ -275,7 +268,10 @@ public JvmInfo(StreamInput in) throws IOException {
275268
vmName = in.readString();
276269
vmVersion = in.readString();
277270
vmVendor = in.readString();
278-
bundledJdk = in.readBoolean();
271+
if (in.getVersion().before(Version.V_8_3_0)) {
272+
// Before 8.0 the no-jdk distributions could have bundledJdk false, this is always true now.
273+
in.readBoolean();
274+
}
279275
usingBundledJdk = in.readOptionalBoolean();
280276
startTime = in.readLong();
281277
inputArguments = new String[in.readInt()];
@@ -306,7 +302,9 @@ public void writeTo(StreamOutput out) throws IOException {
306302
out.writeString(vmName);
307303
out.writeString(vmVersion);
308304
out.writeString(vmVendor);
309-
out.writeBoolean(bundledJdk);
305+
if (out.getVersion().before(Version.V_8_3_0)) {
306+
out.writeBoolean(true);
307+
}
310308
out.writeOptionalBoolean(usingBundledJdk);
311309
out.writeLong(startTime);
312310
out.writeInt(inputArguments.length);
@@ -422,10 +420,6 @@ public String getVmVendor() {
422420
return this.vmVendor;
423421
}
424422

425-
public boolean getBundledJdk() {
426-
return bundledJdk;
427-
}
428-
429423
public Boolean getUsingBundledJdk() {
430424
return usingBundledJdk;
431425
}
@@ -510,7 +504,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
510504
builder.field(Fields.VM_NAME, vmName);
511505
builder.field(Fields.VM_VERSION, vmVersion);
512506
builder.field(Fields.VM_VENDOR, vmVendor);
513-
builder.field(Fields.BUNDLED_JDK, bundledJdk);
514507
builder.field(Fields.USING_BUNDLED_JDK, usingBundledJdk);
515508
builder.timeField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, startTime);
516509

@@ -540,7 +533,6 @@ static final class Fields {
540533
static final String VM_NAME = "vm_name";
541534
static final String VM_VERSION = "vm_version";
542535
static final String VM_VENDOR = "vm_vendor";
543-
static final String BUNDLED_JDK = "bundled_jdk";
544536
static final String USING_BUNDLED_JDK = "using_bundled_jdk";
545537
static final String START_TIME = "start_time";
546538
static final String START_TIME_IN_MILLIS = "start_time_in_millis";

server/src/main/java/org/elasticsearch/node/Node.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,16 +332,7 @@ protected Node(
332332
Constants.JAVA_VERSION,
333333
Constants.JVM_VERSION
334334
);
335-
if (jvmInfo.getBundledJdk()) {
336-
logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), jvmInfo.getUsingBundledJdk());
337-
} else {
338-
logger.info("JVM home [{}]", System.getProperty("java.home"));
339-
deprecationLogger.warn(
340-
DeprecationCategory.OTHER,
341-
"no-jdk",
342-
"no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release"
343-
);
344-
}
335+
logger.info("JVM home [{}], using bundled JDK [{}]", System.getProperty("java.home"), jvmInfo.getUsingBundledJdk());
345336
logger.info("JVM arguments {}", Arrays.toString(jvmInfo.getInputArguments()));
346337
if (Build.CURRENT.isProductionRelease() == false) {
347338
logger.warn(

test/framework/src/main/java/org/elasticsearch/test/ESTestCase.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@
8585
import org.elasticsearch.index.analysis.TokenizerFactory;
8686
import org.elasticsearch.indices.IndicesModule;
8787
import org.elasticsearch.indices.analysis.AnalysisModule;
88-
import org.elasticsearch.monitor.jvm.JvmInfo;
8988
import org.elasticsearch.plugins.AnalysisPlugin;
9089
import org.elasticsearch.plugins.Plugin;
9190
import org.elasticsearch.script.MockScriptEngine;
@@ -475,9 +474,6 @@ protected List<String> filteredWarnings() {
475474
);
476475
filtered.add("Configuring [path.data] with a list is deprecated. Instead specify as a string value");
477476
filtered.add("setting [path.shared_data] is deprecated and will be removed in a future release");
478-
if (JvmInfo.jvmInfo().getBundledJdk() == false) {
479-
filtered.add("no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release");
480-
}
481477
return filtered;
482478
}
483479

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ public void testToXContent() throws IOException {
353353
when(mockJvmInfo.getVmName()).thenReturn("_jvm_vm_name");
354354
when(mockJvmInfo.getVmVersion()).thenReturn("_jvm_vm_version");
355355
when(mockJvmInfo.getVmVendor()).thenReturn("_jvm_vm_vendor");
356-
when(mockJvmInfo.getBundledJdk()).thenReturn(true);
357356
when(mockJvmInfo.getUsingBundledJdk()).thenReturn(true);
358357

359358
final Build mockBuild = new Build(Build.Flavor.DEFAULT, Build.Type.DOCKER, "", "", false, "");

0 commit comments

Comments
 (0)