You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2013/04/03 23:49:46 UTC

svn commit: r1464213 - /uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/JobFactory.java

Author: degenaro
Date: Wed Apr  3 21:49:46 2013
New Revision: 1464213

URL: http://svn.apache.org/r1464213
Log:
UIMA-2793 Support driver and process common specification for each of classpath, environment and jvmargs

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/JobFactory.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/JobFactory.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/JobFactory.java?rev=1464213&r1=1464212&r2=1464213&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/JobFactory.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/JobFactory.java Wed Apr  3 21:49:46 2013
@@ -40,6 +40,7 @@ import org.apache.uima.ducc.transport.cm
 import org.apache.uima.ducc.transport.cmdline.NonJavaCommandLine;
 import org.apache.uima.ducc.transport.event.cli.JobRequestProperties;
 import org.apache.uima.ducc.transport.event.cli.JobSpecificationProperties;
+import org.apache.uima.ducc.transport.event.cli.PropertiesHelper;
 import org.apache.uima.ducc.transport.event.cli.ServiceRequestProperties;
 import org.apache.uima.ducc.transport.event.common.DuccProcess;
 import org.apache.uima.ducc.transport.event.common.DuccSchedulingInfo;
@@ -294,7 +295,7 @@ public class JobFactory {
 		driverCommandLine.addOption(IDuccCommand.arg_ducc_deploy_components);
 		driverCommandLine.addOption(IDuccCommand.arg_ducc_job_id+job.getDuccId().toString());
 		// classpath
-		String driverClasspath = jobRequestProperties.getProperty(JobSpecificationProperties.key_driver_classpath);
+		String driverClasspath = PropertiesHelper.getDriverClasspath(jobRequestProperties);
 		logger.debug(methodName, job.getDuccId(), "driver CP (spec):"+driverClasspath);
 		logger.debug(methodName, job.getDuccId(), "java CP:"+java_classpath);
 		if(driverClasspath != null) {
@@ -313,13 +314,13 @@ public class JobFactory {
 		}
 		logger.debug(methodName, job.getDuccId(), "driver CP (combined):"+driverClasspath);
 		driverCommandLine.setClasspath(driverClasspath);
-		String driver_jvm_args = jobRequestProperties.getProperty(JobRequestProperties.key_driver_jvm_args);
+		String driver_jvm_args = PropertiesHelper.getDriverJvmArgs(jobRequestProperties);
 		ArrayList<String> dTokens = parseJvmArgs(driver_jvm_args);
 		for(String token : dTokens) {
 			driverCommandLine.addOption(token);
 		}
 		// Environment
-		String driverEnvironmentVariables = jobRequestProperties.getProperty(JobRequestProperties.key_driver_environment);
+		String driverEnvironmentVariables = PropertiesHelper.getDriverEnvironment(jobRequestProperties);
 		int envCountDriver = addEnvironment(job, "driver", driverCommandLine, driverEnvironmentVariables);
 		logger.info(methodName, job.getDuccId(), "driver env vars: "+envCountDriver);
 		logger.debug(methodName, job.getDuccId(), "driver: "+driverCommandLine.getCommand());
@@ -381,7 +382,7 @@ public class JobFactory {
 		// log
 		jobRequestProperties.specification(logger);
 		// classpath
-		String processClasspath = jobRequestProperties.getProperty(JobSpecificationProperties.key_process_classpath);
+		String processClasspath = PropertiesHelper.getProcessClasspath(jobRequestProperties);
 		logger.debug(methodName, job.getDuccId(), "process CP (spec):"+processClasspath);
 		logger.debug(methodName, job.getDuccId(), "java CP:"+java_classpath);
 		if(processClasspath != null) {
@@ -486,12 +487,12 @@ public class JobFactory {
 			JavaCommandLine pipelineCommandLine = new JavaCommandLine(javaCmd);
 			pipelineCommandLine.setClassName("main:provided-by-Process-Manager");
 			pipelineCommandLine.setClasspath(processClasspath);
-			String process_jvm_args = jobRequestProperties.getProperty(JobRequestProperties.key_process_jvm_args);
+			String process_jvm_args = PropertiesHelper.getProcessJvmArgs(jobRequestProperties);
 			ArrayList<String> pTokens = parseJvmArgs(process_jvm_args);
 			for(String token : pTokens) {
 				pipelineCommandLine.addOption(token);
 			}
-			String processEnvironmentVariables = jobRequestProperties.getProperty(JobRequestProperties.key_process_environment);
+			String processEnvironmentVariables = PropertiesHelper.getProcessEnvironment(jobRequestProperties);
 			int envCountProcess = addEnvironment(job, "process", pipelineCommandLine, processEnvironmentVariables);
 			logger.info(methodName, job.getDuccId(), "process env vars: "+envCountProcess);
 			logger.debug(methodName, job.getDuccId(), "pipeline: "+pipelineCommandLine.getCommand());
@@ -502,7 +503,7 @@ public class JobFactory {
 			// ducclet (sometimes known as arbitrary process)
 			String process_executable = jobRequestProperties.getProperty(JobSpecificationProperties.key_process_executable);
 			NonJavaCommandLine executableProcessCommandLine = new NonJavaCommandLine(process_executable);
-			String processEnvironmentVariables = jobRequestProperties.getProperty(JobRequestProperties.key_process_environment);
+			String processEnvironmentVariables = PropertiesHelper.getProcessEnvironment(jobRequestProperties);
 			int envCountProcess = addEnvironment(job, "process", executableProcessCommandLine, processEnvironmentVariables);
 			logger.info(methodName, job.getDuccId(), "process env vars: "+envCountProcess);
 			logger.debug(methodName, job.getDuccId(), "ducclet: "+executableProcessCommandLine.getCommandLine());