Github user aljoscha commented on a diff in the pull request:
https://github.com/apache/flink/pull/4636#discussion_r137211750
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/util/EnvironmentInformation.java
---
@@ -284,7 +284,16 @@ public static void logEnvironmentInfo(Logger log,
String componentName, String[]
log.info(" JVM: " + jvmVersion);
log.info(" Maximum heap size: " + maxHeapMegabytes + "
MiBytes");
log.info(" JAVA_HOME: " + (javaHome == null ? "(not
set)" : javaHome));
- log.info(" Hadoop version: " +
VersionInfo.getVersion());
+
+ try {
+ Class.forName(
+ "org.apache.hadoop.util.VersionInfo",
+ false,
+
EnvironmentInformation.class.getClassLoader());
+ log.info(" Hadoop version: " +
VersionInfo.getVersion());
--- End diff --
Yes, that is intended because I didn't want to fiddle with the reflection
API. Ideally, I would like to do this:
```
try {
log.info(" Hadoop version: " + VersionInfo.getVersion());
} catch (ClassNotFoundException e) {
// ignore
}
```
but java won't let you do this. With the explicit `Class.forName()` it will
let me put the catch block.
---