Skip to content

Commit

Permalink
Backporting the property in the pipeline runner configuration XML fil…
Browse files Browse the repository at this point in the history
…e. Allows to set the size of the heap for the actual pipeline run instead of only the boostrap runner which just launches the pipeline.
  • Loading branch information
khituras committed May 23, 2019
1 parent 90a10dc commit a8c284a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion jcore-pipeline-builder-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<parent>
<groupId>de.julielab</groupId>
<artifactId>jcore-pipeline-modules</artifactId>
<version>0.2.5</version>
<version>0.2.5.1</version>
<relativePath>../</relativePath>
</parent>

<build>
Expand Down
3 changes: 2 additions & 1 deletion jcore-pipeline-builder-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<parent>
<groupId>de.julielab</groupId>
<artifactId>jcore-pipeline-modules</artifactId>
<version>0.2.5</version>
<version>0.2.5.1</version>
<relativePath>../</relativePath>
</parent>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>jcore-pipeline-runner</artifactId>
<groupId>de.julielab</groupId>
<version>0.2.5</version>
<version>0.2.5.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
3 changes: 2 additions & 1 deletion jcore-pipeline-runner/jcore-pipeline-runner-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<parent>
<artifactId>jcore-pipeline-runner</artifactId>
<groupId>de.julielab</groupId>
<version>0.2.5</version>
<version>0.2.5.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ public void runPipeline(JCoReUIMAPipeline pipeline, HierarchicalConfiguration<Im
pipeline.load(false);
final String plp = pipeline.getLoadDirectory().getAbsolutePath();
int numThreads = runnerConfig.containsKey(NUMTHREADS) ? runnerConfig.getInt(NUMTHREADS) : 2;
String heapSize = runnerConfig.getString("heapsize", "2G");
final File cpeRunnerJar = findCpeRunnerJar();
Stream<File> classpathElements = pipeline.getClasspathElements();
classpathElements = Stream.concat(classpathElements, Stream.of(cpeRunnerJar, new File(plp + File.separator + JCoReUIMAPipeline.DIR_CONF), new File(plp + File.separator + "resources")));
String classpath = classpathElements.map(File::getAbsolutePath).collect(Collectors.joining(File.pathSeparator));

final String[] cmdarray = {"java", "-cp", classpath, "de.julielab.jcore.pipeline.runner.cpe.CPERunner", "-d", plp + File.separator + JCoReUIMAPipeline.DIR_DESC + File.separator + "CPE.xml", "-t", String.valueOf(numThreads)};
final String[] cmdarray = {"java", "-Xmx"+heapSize, "-cp", classpath, "de.julielab.jcore.pipeline.runner.cpe.CPERunner", "-d", plp + File.separator + JCoReUIMAPipeline.DIR_DESC + File.separator + "CPE.xml", "-t", String.valueOf(numThreads)};
log.info("Running the pipeline at {} with the following command line: {}", pipeline.getLoadDirectory(), Arrays.toString(cmdarray));
final Process exec = Runtime.getRuntime().exec(cmdarray);
new InputStreamGobbler(exec.getInputStream(), "StdInGobbler", "std").start();
Expand Down
2 changes: 1 addition & 1 deletion jcore-pipeline-runner/jcore-pipeline-runner-cpe/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>jcore-pipeline-runner</artifactId>
<groupId>de.julielab</groupId>
<version>0.2.5</version>
<version>0.2.5.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<build>
Expand Down
2 changes: 1 addition & 1 deletion jcore-pipeline-runner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>jcore-pipeline-modules</artifactId>
<groupId>de.julielab</groupId>
<version>0.2.5</version>
<version>0.2.5.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<artifactId>jcore-pipeline-modules</artifactId>
<packaging>pom</packaging>
<version>0.2.5</version>
<version>0.2.5.1</version>
<dependencies>
<dependency>
<groupId>de.julielab</groupId>
Expand Down

0 comments on commit a8c284a

Please sign in to comment.