wangyang0918 commented on code in PR #160:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/160#discussion_r846895737
##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/EnvUtils.java:
##########
@@ -68,4 +97,113 @@ public static String getRequired(String key) {
}
return value;
}
+
+ /**
+ * Logs information about the environment, like code revision, current
user, Java version, and
+ * JVM parameters.
+ *
+ * @param log The logger to log the information to.
+ * @param componentName The component name to mention in the log.
+ * @param commandLineArgs The arguments accompanying the starting the
component.
+ */
+ public static void logEnvironmentInfo(
+ Logger log, String componentName, String[] commandLineArgs) {
+ if (log.isInfoEnabled()) {
+ Properties properties = new Properties();
+ try (InputStream propFile =
+
EnvUtils.class.getClassLoader().getResourceAsStream(PROP_FILE)) {
+ if (propFile != null) {
+ properties.load(propFile);
+ }
+ } catch (IOException e) {
+ LOG.info(
+ "Cannot determine code revision: Unable to read
version property file.: {}",
+ e.getMessage());
+ }
+ String javaHome = System.getenv("JAVA_HOME");
+ String arch = System.getProperty("os.arch");
+ long maxHeapMegabytes = getMaxJvmHeapMemory() >>> 20;
+ log.info(
+
"--------------------------------------------------------------------------------");
+ log.info(
+ " Starting "
+ + componentName
+ + " (Version: "
+ + getProperty(properties, "project.version",
UNKNOWN)
+ + ", Flink Version: "
+ + getVersion()
+ + ", Scala: "
Review Comment:
We do not need to print the scala version. The `flink-kubernetes-operator`
does not depends any scala classes and we have already excluded the scala
dependencies. Also Flink will be scala free in the later version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]