热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.flink.runtime.util.EnvironmentInformation类的使用及代码示例

本文整理了Java中org.apache.flink.runtime.util.EnvironmentInformation类的一些代码示例,展示了Envi

本文整理了Java中org.apache.flink.runtime.util.EnvironmentInformation类的一些代码示例,展示了EnvironmentInformation类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EnvironmentInformation类的具体详情如下:
包路径:org.apache.flink.runtime.util.EnvironmentInformation
类名称:EnvironmentInformation

EnvironmentInformation介绍

[英]Utility class that gives access to the execution environment of the JVM, like the executing user, startup options, or the JVM version.
[中]提供对JVM执行环境的访问的实用程序类,如执行用户、启动选项或JVM版本。

代码示例

代码示例来源:origin: apache/flink

/**
* The entry point for the YARN task executor runner.
*
* @param args The command line arguments.
*/
public static void main(String[] args) {
EnvironmentInformation.logEnvironmentInfo(LOG, "YARN TaskExecutor runner", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
run(args);
}

代码示例来源:origin: apache/flink

case "-v":
case "--version":
String version = EnvironmentInformation.getVersion();
String commitID = EnvironmentInformation.getRevisionInformation().commitId;
System.out.print("Version: " + version);
System.out.println(commitID.equals(EnvironmentInformation.UNKNOWN) ? "" : ", Commit ID: " + commitID);

代码示例来源:origin: apache/flink

@SuppressWarnings("WeakerAccess")
public SerializingLongReceiver(InputGate inputGate, int expectedRepetitionsOfExpectedRecord) {
super(expectedRepetitionsOfExpectedRecord);
this.reader = new MutableRecordReader<>(
inputGate,
new String[]{
EnvironmentInformation.getTemporaryFileDirectory()
});
}

代码示例来源:origin: com.alibaba.blink/flink-runtime

RevisionInformation rev = getRevisionInformation();
String version = getVersion();
String jvmVersion = getJvmVersion();
String[] optiOns= getJvmStartupOptionsArray();
long maxHeapMegabytes = getMaxJvmHeapMemory() >>> 20;
+ "Rev:" + rev.commitId + ", " + "Date:" + rev.commitDate + ")");
log.info(" OS current user: " + System.getProperty("user.name"));
log.info(" Current Hadoop/Kerberos user: " + getHadoopUser());
log.info(" JVM: " + jvmVersion);
log.info(" Maximum heap size: " + maxHeapMegabytes + " MiBytes");
log.info(" JAVA_HOME: " + (javaHome == null ? "(not set)" : javaHome));
String hadoopVersiOnString= getHadoopVersionString();
if (hadoopVersionString != null) {
log.info(" Hadoop version: " + hadoopVersionString);

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

RevisionInformation rev = getRevisionInformation();
String version = getVersion();
String user = getUserRunning();
String jvmVersion = getJvmVersion();
String[] optiOns= getJvmStartupOptionsArray();
long maxHeapMegabytes = getMaxJvmHeapMemory() >>> 20;

代码示例来源:origin: org.apache.flink/flink-runtime

public static void main(String[] args) throws Exception {
EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit();

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

long relativeMemSize = (long) (EnvironmentInformation.getSizeOfFreeHeapMemoryWithDefrag() * memoryFraction);
if (preAllocateMemory) {
LOG.info("Using {} of the currently free heap space for managed heap memory ({} MB)." ,
long maxMemory = EnvironmentInformation.getMaxJvmHeapMemory();
long directMemorySize = (long) (maxMemory / (1.0 - memoryFraction) * memoryFraction);
if (preAllocateMemory) {

代码示例来源:origin: org.apache.flink/flink-runtime

/**
* Gets an estimate of the size of the free heap memory. The estimate may vary, depending on the current
* level of memory fragmentation and the number of dead objects. For a better (but more heavy-weight)
* estimate, use {@link #getSizeOfFreeHeapMemoryWithDefrag()}.
*
* @return An estimate of the size of the free heap memory, in bytes.
*/
public static long getSizeOfFreeHeapMemory() {
Runtime r = Runtime.getRuntime();
return getMaxJvmHeapMemory() - r.totalMemory() + r.freeMemory();
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

/**
* Gets an estimate of the size of the free heap memory.
*
* NOTE: This method is heavy-weight. It triggers a garbage collection to reduce fragmentation and get
* a better estimate at the size of free memory. It is typically more accurate than the plain version
* {@link #getSizeOfFreeHeapMemory()}.
*
* @return An estimate of the size of the free heap memory, in bytes.
*/
public static long getSizeOfFreeHeapMemoryWithDefrag() {
// trigger a garbage collection, to reduce fragmentation
System.gc();

return getSizeOfFreeHeapMemory();
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

long freeMemory = EnvironmentInformation.getSizeOfFreeHeapMemoryWithDefrag();

代码示例来源:origin: org.apache.flink/flink-runtime

RevisionInformation rev = getRevisionInformation();
String version = getVersion();
String jvmVersion = getJvmVersion();
String[] optiOns= getJvmStartupOptionsArray();
long maxHeapMegabytes = getMaxJvmHeapMemory() >>> 20;
+ "Rev:" + rev.commitId + ", " + "Date:" + rev.commitDate + ")");
log.info(" OS current user: " + System.getProperty("user.name"));
log.info(" Current Hadoop/Kerberos user: " + getHadoopUser());
log.info(" JVM: " + jvmVersion);
log.info(" Maximum heap size: " + maxHeapMegabytes + " MiBytes");
log.info(" JAVA_HOME: " + (javaHome == null ? "(not set)" : javaHome));
String hadoopVersiOnString= getHadoopVersionString();
if (hadoopVersionString != null) {
log.info(" Hadoop version: " + hadoopVersionString);

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

public static void main(String[] args) throws Exception {
EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit();

代码示例来源:origin: org.apache.flink/flink-runtime_2.10

final long relativeMemSize = EnvironmentInformation.getSizeOfFreeHeapMemoryWithDefrag();
networkBufBytes = Math.min(networkBufMax, Math.max(networkBufMin,
(long) (networkBufFraction * relativeMemSize)));
final long maxMemory = EnvironmentInformation.getMaxJvmHeapMemory();

代码示例来源:origin: com.alibaba.blink/flink-runtime

/**
* Gets an estimate of the size of the free heap memory. The estimate may vary, depending on the current
* level of memory fragmentation and the number of dead objects. For a better (but more heavy-weight)
* estimate, use {@link #getSizeOfFreeHeapMemoryWithDefrag()}.
*
* @return An estimate of the size of the free heap memory, in bytes.
*/
public static long getSizeOfFreeHeapMemory() {
Runtime r = Runtime.getRuntime();
return getMaxJvmHeapMemory() - r.totalMemory() + r.freeMemory();
}

代码示例来源:origin: org.apache.flink/flink-runtime

/**
* Gets an estimate of the size of the free heap memory.
*
* NOTE: This method is heavy-weight. It triggers a garbage collection to reduce fragmentation and get
* a better estimate at the size of free memory. It is typically more accurate than the plain version
* {@link #getSizeOfFreeHeapMemory()}.
*
* @return An estimate of the size of the free heap memory, in bytes.
*/
public static long getSizeOfFreeHeapMemoryWithDefrag() {
// trigger a garbage collection, to reduce fragmentation
System.gc();

return getSizeOfFreeHeapMemory();
}

代码示例来源:origin: apache/flink

/**
* The entry point for the YARN application master.
*
* @param args The command line arguments.
*/
public static void main(String[] args) {
EnvironmentInformation.logEnvironmentInfo(LOG, "YARN ApplicationMaster / ResourceManager / JobManager", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
// run and exit with the proper return code
int returnCode = new YarnApplicationMasterRunner().run(args);
System.exit(returnCode);
}

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

RevisionInformation rev = getRevisionInformation();
String version = getVersion();
String jvmVersion = getJvmVersion();
String[] optiOns= getJvmStartupOptionsArray();
long maxHeapMegabytes = getMaxJvmHeapMemory() >>> 20;
+ "Rev:" + rev.commitId + ", " + "Date:" + rev.commitDate + ")");
log.info(" OS current user: " + System.getProperty("user.name"));
log.info(" Current Hadoop/Kerberos user: " + getHadoopUser());
log.info(" JVM: " + jvmVersion);
log.info(" Maximum heap size: " + maxHeapMegabytes + " MiBytes");
log.info(" JAVA_HOME: " + (javaHome == null ? "(not set)" : javaHome));
String hadoopVersiOnString= getHadoopVersionString();
if (hadoopVersionString != null) {
log.info(" Hadoop version: " + hadoopVersionString);

代码示例来源:origin: apache/flink

json.writeStringField("version", EnvironmentInformation.getVersion());
json.writeStringField("commit ID", EnvironmentInformation.getRevisionInformation().commitId);
json.writeStringField("commit date", EnvironmentInformation.getRevisionInformation().commitDate);
json.writeEndObject();

代码示例来源:origin: com.alibaba.blink/flink-runtime

public static void main(String[] args) throws Exception {
EnvironmentInformation.logEnvironmentInfo(LOG, "TaskManager", args);
SignalHandler.register(LOG);
JvmShutdownSafeguard.installAsShutdownHook(LOG);
long maxOpenFileHandles = EnvironmentInformation.getOpenFileHandlesLimit();

代码示例来源:origin: org.apache.flink/flink-runtime_2.11

resourceID,
EnvironmentInformation.getSizeOfFreeHeapMemoryWithDefrag(),
EnvironmentInformation.getMaxJvmHeapMemory());

推荐阅读
author-avatar
2449978963潇潇
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有