You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by nw...@apache.org on 2019/11/11 06:58:08 UTC
[incubator-heron] branch java_11_support updated: Java 11 support
(#3399)
This is an automated email from the ASF dual-hosted git repository.
nwang pushed a commit to branch java_11_support
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git
The following commit(s) were added to refs/heads/java_11_support by this push:
new 1294a04 Java 11 support (#3399)
1294a04 is described below
commit 1294a04ee3aafe26fcfe109e5d20537b417213b3
Author: se choi <th...@gmail.com>
AuthorDate: Mon Nov 11 15:57:57 2019 +0900
Java 11 support (#3399)
* Support Java 11
* config travis to use oracle jdk 11
* Add check jdk version
---
heron/executor/src/python/heron_executor.py | 117 ++++++++++------------------
1 file changed, 40 insertions(+), 77 deletions(-)
diff --git a/heron/executor/src/python/heron_executor.py b/heron/executor/src/python/heron_executor.py
index 01f59a9..aac24c2 100755
--- a/heron/executor/src/python/heron_executor.py
+++ b/heron/executor/src/python/heron_executor.py
@@ -432,21 +432,7 @@ class HeronExecutor(object):
# for instance, the default -Xmx in Twitter mesos machine is around 18GB
'-Xmx1024M',
'-XX:+PrintCommandLineFlags',
- '-verbosegc',
- '-XX:+PrintGCDetails',
- '-XX:+PrintGCTimeStamps',
- '-XX:+PrintGCDateStamps',
- '-XX:+PrintGCCause',
- '-XX:+UseGCLogFileRotation',
- '-XX:NumberOfGCLogFiles=5',
- '-XX:GCLogFileSize=100M',
- '-XX:+PrintPromotionFailure',
- '-XX:+PrintTenuringDistribution',
- '-XX:+PrintHeapAtGC',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:+UseConcMarkSweepGC',
- '-XX:+PrintCommandLineFlags',
- '-Xloggc:log-files/gc.' + metricsManagerId + '.log',
+ self._get_java_gc_instance_cmd(metricsManagerId),
'-Djava.net.preferIPv4Stack=true',
'-cp',
self.metrics_manager_classpath,
@@ -473,21 +459,7 @@ class HeronExecutor(object):
# for instance, the default -Xmx in Twitter mesos machine is around 18GB
'-Xmx1024M',
'-XX:+PrintCommandLineFlags',
- '-verbosegc',
- '-XX:+PrintGCDetails',
- '-XX:+PrintGCTimeStamps',
- '-XX:+PrintGCDateStamps',
- '-XX:+PrintGCCause',
- '-XX:+UseGCLogFileRotation',
- '-XX:NumberOfGCLogFiles=5',
- '-XX:GCLogFileSize=100M',
- '-XX:+PrintPromotionFailure',
- '-XX:+PrintTenuringDistribution',
- '-XX:+PrintHeapAtGC',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:+UseConcMarkSweepGC',
- '-XX:+PrintCommandLineFlags',
- '-Xloggc:log-files/gc.metricscache.log',
+ self._get_java_gc_instance_cmd('metricscache'),
'-Djava.net.preferIPv4Stack=true',
'-cp',
self.metricscache_manager_classpath,
@@ -515,21 +487,7 @@ class HeronExecutor(object):
# for instance, the default -Xmx in Twitter mesos machine is around 18GB
'-Xmx1024M',
'-XX:+PrintCommandLineFlags',
- '-verbosegc',
- '-XX:+PrintGCDetails',
- '-XX:+PrintGCTimeStamps',
- '-XX:+PrintGCDateStamps',
- '-XX:+PrintGCCause',
- '-XX:+UseGCLogFileRotation',
- '-XX:NumberOfGCLogFiles=5',
- '-XX:GCLogFileSize=100M',
- '-XX:+PrintPromotionFailure',
- '-XX:+PrintTenuringDistribution',
- '-XX:+PrintHeapAtGC',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:+UseConcMarkSweepGC',
- '-XX:+PrintCommandLineFlags',
- '-Xloggc:log-files/gc.healthmgr.log',
+ self._get_java_gc_instance_cmd('healthmgr'),
'-Djava.net.preferIPv4Stack=true',
'-cp', self.health_manager_classpath,
healthmgr_main_class,
@@ -619,6 +577,41 @@ class HeronExecutor(object):
def _get_jvm_instance_cmd(self):
return Command(os.path.join(self.heron_java_home, 'bin/java'), self.shell_env)
+ def _get_java_major_version(self):
+ return int(self._get_jvm_version().split(".")[0])
+
+ def _get_java_gc_instance_cmd(self, instance_id):
+ if self._get_java_major_version() >= 9:
+ return ' '.join([
+ '-verbosegc',
+ '-XX:MaxGCPauseMillis=100',
+ '-XX:InitiatingHeapOccupancyPercent=30',
+ '-XX:+HeapDumpOnOutOfMemoryError',
+ '-XX:+UseG1GC',
+ '-XX:+ParallelRefProcEnabled',
+ '-XX:+UseStringDeduplication',
+ '-Xlog:gc=info:file=log-files/gc.%s.log:time,uptime,pid:filecount=5,filesize=100M'
+ % instance_id])
+ else:
+ return ' '.join([
+ '-XX:+CMSScavengeBeforeRemark',
+ '-XX:TargetSurvivorRatio=90',
+ '-verbosegc',
+ '-XX:+PrintGCDetails',
+ '-XX:+PrintGCTimeStamps',
+ '-XX:+PrintGCDateStamps',
+ '-XX:+PrintGCCause',
+ '-XX:+UseGCLogFileRotation',
+ '-XX:NumberOfGCLogFiles=5',
+ '-XX:GCLogFileSize=100M',
+ '-XX:+PrintPromotionFailure',
+ '-XX:+PrintTenuringDistribution',
+ '-XX:+PrintHeapAtGC',
+ '-XX:+HeapDumpOnOutOfMemoryError',
+ '-XX:+UseConcMarkSweepGC',
+ '-XX:ParallelGCThreads=4',
+ '-Xloggc:log-files/gc.%s.log' % instance_id])
+
def _get_jvm_instance_options(self, instance_id, component_name, remote_debugger_port):
code_cache_size_mb = 64
java_metasize_mb = 128
@@ -645,24 +638,8 @@ class HeronExecutor(object):
'-XX:Max%s=%dM' % (java_metasize_param, java_metasize_mb),
'-XX:%s=%dM' % (java_metasize_param, java_metasize_mb),
'-XX:ReservedCodeCacheSize=%dM' % code_cache_size_mb,
- '-XX:+CMSScavengeBeforeRemark',
- '-XX:TargetSurvivorRatio=90',
'-XX:+PrintCommandLineFlags',
- '-verbosegc',
- '-XX:+PrintGCDetails',
- '-XX:+PrintGCTimeStamps',
- '-XX:+PrintGCDateStamps',
- '-XX:+PrintGCCause',
- '-XX:+UseGCLogFileRotation',
- '-XX:NumberOfGCLogFiles=5',
- '-XX:GCLogFileSize=100M',
- '-XX:+PrintPromotionFailure',
- '-XX:+PrintTenuringDistribution',
- '-XX:+PrintHeapAtGC',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:+UseConcMarkSweepGC',
- '-XX:ParallelGCThreads=4',
- '-Xloggc:log-files/gc.%s.log' % instance_id,
+ self._get_java_gc_instance_cmd(instance_id),
'-Djava.net.preferIPv4Stack=true',
'-cp',
'%s:%s'% (self.instance_classpath, self.classpath)]
@@ -850,21 +827,7 @@ class HeronExecutor(object):
'-Xms%dM' % ckptmgr_ram_mb,
'-Xmx%dM' % ckptmgr_ram_mb,
'-XX:+PrintCommandLineFlags',
- '-verbosegc',
- '-XX:+PrintGCDetails',
- '-XX:+PrintGCTimeStamps',
- '-XX:+PrintGCDateStamps',
- '-XX:+PrintGCCause',
- '-XX:+UseGCLogFileRotation',
- '-XX:NumberOfGCLogFiles=5',
- '-XX:GCLogFileSize=100M',
- '-XX:+PrintPromotionFailure',
- '-XX:+PrintTenuringDistribution',
- '-XX:+PrintHeapAtGC',
- '-XX:+HeapDumpOnOutOfMemoryError',
- '-XX:+UseConcMarkSweepGC',
- '-XX:+UseConcMarkSweepGC',
- '-Xloggc:log-files/gc.' + ckptmgr_id + '.log',
+ self._get_java_gc_instance_cmd(ckptmgr_id),
'-Djava.net.preferIPv4Stack=true',
'-cp',
self.checkpoint_manager_classpath,