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 |
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 |
getUserRunning()
Gets the name of the user that is running the JVM.
|
static String |
getVersion()
Returns the version of the code as String.
|
static void |
logEnvironmentInfo(org.slf4j.Logger log,
String componentName,
String[] commandLineArgs)
Logs a 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 getUserRunning()
public static long getMaxJvmHeapMemory()
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.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.