Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Java 11 support #3399

Merged
merged 4 commits into from
Nov 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dist: trusty
language: java

jdk:
- oraclejdk8
- oraclejdk11

addons:
apt:
Expand Down
13 changes: 12 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ maven_jar(

maven_jar(
name = "javax_annotation_javax_annotation_api",
artifact = "javax.annotation:javax.annotation-api:1.2",
artifact = "javax.annotation:javax.annotation-api:1.3.2",
)

maven_jar(
Expand Down Expand Up @@ -735,6 +735,17 @@ maven_jar(
artifact = "org.apache.commons:commons-compress:1.14",
)

maven_jar(
name = "javax_xml_bind_jaxb",
artifact = "javax.xml.bind:jaxb-api:2.3.0",
)

maven_jar(
name = "javax_activation_activation",
artifact = "javax.activation:activation:1.1.1",
)


# bookkeeper & distributedlog dependencies
maven_jar(
name = "org_apache_distributedlog_core",
Expand Down
3 changes: 2 additions & 1 deletion heron/api/src/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ api_deps_files = \
heron_java_api_proto_files() + [
":classification",
"//heron/common/src/java:basics-java",
"@javax_xml_bind_jaxb//jar",
]

# Low Level Api
Expand Down Expand Up @@ -46,7 +47,7 @@ java_library(
srcs = glob(["org/apache/heron/api/**/*.java", "org/apache/heron/streamlet/**/*.java"]),
deps = api_deps_files + [
"//third_party/java:kryo-neverlink",
"@org_apache_commons_commons_lang3//jar"
"@org_apache_commons_commons_lang3//jar",
]
)

Expand Down
1 change: 1 addition & 0 deletions heron/common/src/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ java_library(
srcs = glob(["**/config/*.java"]),
deps = [
":basics-java",
"@javax_xml_bind_jaxb//jar",
"@org_yaml_snakeyaml//jar",
],
)
Expand Down
117 changes: 40 additions & 77 deletions heron/executor/src/python/heron_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,21 +432,7 @@ def _get_metricsmgr_cmd(self, metricsManagerId, sink_config_file, port):
# 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,
Expand All @@ -473,21 +459,7 @@ def _get_metrics_cache_cmd(self):
# 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,
Expand Down Expand Up @@ -515,21 +487,7 @@ def _get_healthmgr_cmd(self):
# 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,
Expand Down Expand Up @@ -619,6 +577,41 @@ def _get_java_instance_cmd(self, instance_info):
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
Expand All @@ -645,24 +638,8 @@ def _get_jvm_instance_options(self, instance_id, component_name, remote_debugger
'-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)]
Expand Down Expand Up @@ -850,21 +827,7 @@ def _get_ckptmgr_process(self):
'-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,
Expand Down
1 change: 1 addition & 0 deletions heron/scheduler-core/src/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ common_deps_files = [
"//heron/api/src/java:classification",
"@commons_cli_commons_cli//jar",
"@com_google_guava_guava//jar",
"@javax_xml_bind_jaxb//jar",
"@org_apache_commons_commons_lang3//jar",
"//third_party/java:jackson",
]
Expand Down
1 change: 1 addition & 0 deletions heron/simulator/src/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ simulator_deps_files = \
"//heron/common/src/java:config-java",
"//heron/common/src/java:utils-java",
"//heron/instance/src/java:instance-java",
"@javax_xml_bind_jaxb//jar",
"@org_yaml_snakeyaml//jar",
]

Expand Down
5 changes: 4 additions & 1 deletion heron/tools/apiserver/src/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ apiserver_deps_files = \
packing_deps_files + \
uploader_deps_files + [
"//third_party/java:cli",
"@org_yaml_snakeyaml//jar",
"//third_party/java:jetty-jersey-java",
"//third_party/java:commons-compress",
"//third_party/java:jackson",
"//third_party/java:logging",
"@javax_activation_activation//jar",
"@javax_annotation_javax_annotation_api//jar",
"@javax_xml_bind_jaxb//jar",
"@org_yaml_snakeyaml//jar",
]

java_binary(
Expand Down