Skip to content

Commit 6b793c3

Browse files
committed
Remove no-jdk deprecations
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 elastic#76896 relates elastic#85758
1 parent 4ba9ce7 commit 6b793c3

File tree

9 files changed

+10
-51
lines changed

9 files changed

+10
-51
lines changed

distribution/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,6 @@ subprojects {
524524
'zip': 'zip'
525525
],
526526

527-
'es.bundled_jdk': [
528-
'def': 'true'
529-
],
530-
531527
'license.name': [
532528
'deb': 'Elastic-License'
533529
],

distribution/src/bin/elasticsearch

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ if [[ $DAEMONIZE = false ]]; then
117117
-Des.path.conf="$ES_PATH_CONF" \
118118
-Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \
119119
-Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
120-
-Des.bundled_jdk="$ES_BUNDLED_JDK" \
121120
-cp "$ES_CLASSPATH" \
122121
org.elasticsearch.bootstrap.Elasticsearch \
123122
"${ARG_LIST[@]}" <<<"$KEYSTORE_PASSWORD"
@@ -130,7 +129,6 @@ else
130129
-Des.path.conf="$ES_PATH_CONF" \
131130
-Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \
132131
-Des.distribution.type="$ES_DISTRIBUTION_TYPE" \
133-
-Des.bundled_jdk="$ES_BUNDLED_JDK" \
134132
-cp "$ES_CLASSPATH" \
135133
org.elasticsearch.bootstrap.Elasticsearch \
136134
"${ARG_LIST[@]}" \

distribution/src/bin/elasticsearch-env

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

9898
9999
100-
101-
102-
if [[ "$ES_BUNDLED_JDK" == "false" ]]; then
103-
echo "warning: no-jdk distributions that do not bundle a JDK are deprecated and will be removed in a future release" >&2
104-
fi
105100

106101
if [[ "$ES_DISTRIBUTION_TYPE" == "docker" ]]; then
107102
# 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.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

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ static final class Fields {
531531
static final String VM_NAME = "vm_name";
532532
static final String VM_VERSION = "vm_version";
533533
static final String VM_VENDOR = "vm_vendor";
534-
static final String BUNDLED_JDK = "bundled_jdk";
535534
static final String USING_BUNDLED_JDK = "using_bundled_jdk";
536535
static final String COUNT = "count";
537536
static final String THREADS = "threads";
@@ -554,7 +553,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
554553
builder.field(Fields.VM_NAME, v.getKey().vmName);
555554
builder.field(Fields.VM_VERSION, v.getKey().vmVersion);
556555
builder.field(Fields.VM_VENDOR, v.getKey().vmVendor);
557-
builder.field(Fields.BUNDLED_JDK, v.getKey().bundledJdk);
558556
builder.field(Fields.USING_BUNDLED_JDK, v.getKey().usingBundledJdk);
559557
builder.field(Fields.COUNT, v.getValue());
560558
builder.endObject();
@@ -575,15 +573,13 @@ public static class JvmVersion {
575573
String vmName;
576574
String vmVersion;
577575
String vmVendor;
578-
boolean bundledJdk;
579576
Boolean usingBundledJdk;
580577

581578
JvmVersion(JvmInfo jvmInfo) {
582579
version = jvmInfo.version();
583580
vmName = jvmInfo.getVmName();
584581
vmVersion = jvmInfo.getVmVersion();
585582
vmVendor = jvmInfo.getVmVendor();
586-
bundledJdk = jvmInfo.getBundledJdk();
587583
usingBundledJdk = jvmInfo.getUsingBundledJdk();
588584
}
589585

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

Lines changed: 9 additions & 16 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

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

0 commit comments

Comments
 (0)