collection_java_xmx allows to declare the heap size allocated for the java actions involved in the metadata collectionw workflow

This commit is contained in:
Claudio Atzori 2021-02-08 18:07:23 +01:00
parent bebc54d5bf
commit bae029f828
3 changed files with 21 additions and 1 deletions

View File

@ -45,6 +45,8 @@ public class MDStoreActionNode {
"/eu/dnetlib/dhp/collection/mdstore_action_parameters.json"))); "/eu/dnetlib/dhp/collection/mdstore_action_parameters.json")));
argumentParser.parseArgument(args); argumentParser.parseArgument(args);
log.info("Java Xmx: {}m", Runtime.getRuntime().maxMemory() / (1024 * 1024));
final MDAction action = MDAction.valueOf(argumentParser.get("action")); final MDAction action = MDAction.valueOf(argumentParser.get("action"));
log.info("Current action is {}", action); log.info("Current action is {}", action);

View File

@ -41,11 +41,13 @@ public class CollectorWorkerApplication {
final ArgumentApplicationParser argumentParser = new ArgumentApplicationParser( final ArgumentApplicationParser argumentParser = new ArgumentApplicationParser(
IOUtils IOUtils
.toString( .toString(
CollectorWorker.class CollectorWorkerApplication.class
.getResourceAsStream( .getResourceAsStream(
"/eu/dnetlib/dhp/collection/collector_worker_input_parameter.json"))); "/eu/dnetlib/dhp/collection/collector_worker_input_parameter.json")));
argumentParser.parseArgument(args); argumentParser.parseArgument(args);
log.info("Java Xmx: {}m", Runtime.getRuntime().maxMemory() / (1024 * 1024));
final String hdfsuri = argumentParser.get("namenode"); final String hdfsuri = argumentParser.get("namenode");
log.info("hdfsURI is {}", hdfsuri); log.info("hdfsURI is {}", hdfsuri);

View File

@ -41,6 +41,14 @@
<name>collectionMode</name> <name>collectionMode</name>
<description>Should be REFRESH or INCREMENTAL</description> <description>Should be REFRESH or INCREMENTAL</description>
</property> </property>
<property>
<name>collection_java_xmx</name>
<value>-Xmx200m</value>
<description>Used to configure the heap size for the map JVM process. Should be 80% of mapreduce.map.memory.mb.</description>
</property>
</parameters> </parameters>
<global> <global>
@ -65,6 +73,7 @@
<action name="BeginRead"> <action name="BeginRead">
<java> <java>
<main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class> <main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--action</arg><arg>READ_LOCK</arg> <arg>--action</arg><arg>READ_LOCK</arg>
<arg>--mdStoreID</arg><arg>${mdStoreID}</arg> <arg>--mdStoreID</arg><arg>${mdStoreID}</arg>
<arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg> <arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg>
@ -77,6 +86,7 @@
<action name="StartTransaction"> <action name="StartTransaction">
<java> <java>
<main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class> <main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--action</arg><arg>NEW_VERSION</arg> <arg>--action</arg><arg>NEW_VERSION</arg>
<arg>--mdStoreID</arg><arg>${mdStoreID}</arg> <arg>--mdStoreID</arg><arg>${mdStoreID}</arg>
<arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg> <arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg>
@ -89,6 +99,7 @@
<action name="CollectionWorker"> <action name="CollectionWorker">
<java> <java>
<main-class>eu.dnetlib.dhp.collection.worker.CollectorWorkerApplication</main-class> <main-class>eu.dnetlib.dhp.collection.worker.CollectorWorkerApplication</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--apidescriptor</arg><arg>${apiDescription}</arg> <arg>--apidescriptor</arg><arg>${apiDescription}</arg>
<arg>--namenode</arg><arg>${nameNode}</arg> <arg>--namenode</arg><arg>${nameNode}</arg>
<arg>--workflowId</arg><arg>${workflowId}</arg> <arg>--workflowId</arg><arg>${workflowId}</arg>
@ -108,6 +119,7 @@
<action name="CollectorReport"> <action name="CollectorReport">
<java> <java>
<main-class>eu.dnetlib.dhp.collection.worker.CollectorWorkerReporter</main-class> <main-class>eu.dnetlib.dhp.collection.worker.CollectorWorkerReporter</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--mdStoreVersion</arg><arg>${wf:actionData('StartTransaction')['mdStoreVersion']}</arg> <arg>--mdStoreVersion</arg><arg>${wf:actionData('StartTransaction')['mdStoreVersion']}</arg>
<arg>--namenode</arg><arg>${nameNode}</arg> <arg>--namenode</arg><arg>${nameNode}</arg>
</java> </java>
@ -153,6 +165,7 @@
<action name="EndRead"> <action name="EndRead">
<java> <java>
<main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class> <main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--action</arg><arg>READ_UNLOCK</arg> <arg>--action</arg><arg>READ_UNLOCK</arg>
<arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg> <arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg>
<arg>--readMDStoreId</arg><arg>${wf:actionData('BeginRead')['mdStoreReadLockVersion']}</arg> <arg>--readMDStoreId</arg><arg>${wf:actionData('BeginRead')['mdStoreReadLockVersion']}</arg>
@ -164,6 +177,7 @@
<action name="CommitVersion"> <action name="CommitVersion">
<java> <java>
<main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class> <main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--action</arg><arg>COMMIT</arg> <arg>--action</arg><arg>COMMIT</arg>
<arg>--namenode</arg><arg>${nameNode}</arg> <arg>--namenode</arg><arg>${nameNode}</arg>
<arg>--mdStoreVersion</arg><arg>${wf:actionData('StartTransaction')['mdStoreVersion']}</arg> <arg>--mdStoreVersion</arg><arg>${wf:actionData('StartTransaction')['mdStoreVersion']}</arg>
@ -184,6 +198,7 @@
<action name="EndReadRollBack"> <action name="EndReadRollBack">
<java> <java>
<main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class> <main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--action</arg><arg>READ_UNLOCK</arg> <arg>--action</arg><arg>READ_UNLOCK</arg>
<arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg> <arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg>
<arg>--readMDStoreId</arg><arg>${wf:actionData('BeginRead')['mdStoreReadLockVersion']}</arg> <arg>--readMDStoreId</arg><arg>${wf:actionData('BeginRead')['mdStoreReadLockVersion']}</arg>
@ -195,6 +210,7 @@
<action name="RollBack"> <action name="RollBack">
<java> <java>
<main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class> <main-class>eu.dnetlib.dhp.aggregation.mdstore.MDStoreActionNode</main-class>
<java-opts>${collection_java_xmx}</java-opts>
<arg>--action</arg><arg>ROLLBACK</arg> <arg>--action</arg><arg>ROLLBACK</arg>
<arg>--mdStoreVersion</arg><arg>${wf:actionData('StartTransaction')['mdStoreVersion']}</arg> <arg>--mdStoreVersion</arg><arg>${wf:actionData('StartTransaction')['mdStoreVersion']}</arg>
<arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg> <arg>--mdStoreManagerURI</arg><arg>${mdStoreManagerURI}</arg>