public class EnvironmentInformation extends Object
Modifier and Type | Class and Description |
---|---|
static class |
EnvironmentInformation.RevisionInformation
Revision information encapsulates information about the source code revision of the Flink
code.
|
Modifier and Type | Method and Description |
---|---|
static String |
getHadoopUser()
Gets the name of the user that is running the JVM.
|
static String |
getHadoopVersionString() |
static String |
getJvmStartupOptions()
Gets the system parameters and environment parameters that were passed to the JVM on startup.
|
static String[] |
getJvmStartupOptionsArray()
Gets the system parameters and environment parameters that were passed to the JVM on startup.
|
static String |
getJvmVersion()
Gets the version of the JVM in the form "VM_Name - Vendor - Spec/Version".
|
static long |
getMaxJvmHeapMemory()
The maximum JVM heap size, in bytes.
|
static long |
getOpenFileHandlesLimit()
Tries to retrieve the maximum number of open file handles.
|
static EnvironmentInformation.RevisionInformation |
getRevisionInformation()
Returns the code revision (commit and commit date) of Flink, as generated by the Maven builds.
|
static long |
getSizeOfFreeHeapMemory()
Gets an estimate of the size of the free heap memory.
|
static long |
getSizeOfFreeHeapMemoryWithDefrag()
Gets an estimate of the size of the free heap memory.
|
static String |
getTemporaryFileDirectory()
Gets the directory for temporary files, as returned by the JVM system property "java.io.tmpdir".
|
static String |
getVersion()
Returns the version of the code as String.
|
static void |
logEnvironmentInfo(org.slf4j.Logger log,
String componentName,
String[] commandLineArgs)
Logs information about the environment, like code revision, current user, Java version,
and JVM parameters.
|
public static final String UNKNOWN
public static String getVersion()
public static EnvironmentInformation.RevisionInformation getRevisionInformation()
public static String getHadoopUser()
public static long getMaxJvmHeapMemory()
This method uses the -Xmx value of the JVM, if set. If not set, it returns (as a heuristic) 1/4th of the physical memory size.
public static long getSizeOfFreeHeapMemoryWithDefrag()
getSizeOfFreeHeapMemory()
.public static long getSizeOfFreeHeapMemory()
getSizeOfFreeHeapMemoryWithDefrag()
.public static String getJvmVersion()
public static String getJvmStartupOptions()
public static String[] getJvmStartupOptionsArray()
public static String getTemporaryFileDirectory()
public static long getOpenFileHandlesLimit()
If the number of max open file handles cannot be determined, this method returns -1
.
-1
, if the limit could not be determined.public static void logEnvironmentInfo(org.slf4j.Logger log, String componentName, String[] commandLineArgs)
log
- The logger to log the information to.componentName
- The component name to mention in the log.commandLineArgs
- The arguments accompanying the starting the component.public static String getHadoopVersionString()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.