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/05/16 20:26:14 UTC

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

Author: degenaro
Date: Thu May 16 18:26:14 2013
New Revision: 1483490

URL: http://svn.apache.org/r1483490
Log:
UIMA-2916 once node inventory presents a PID for a DuccProcess, OR should enforce immutableness thereof

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

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/ProcessAccounting.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/ProcessAccounting.java?rev=1483490&r1=1483489&r2=1483490&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/ProcessAccounting.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-orchestrator/src/main/java/org/apache/uima/ducc/orchestrator/ProcessAccounting.java Thu May 16 18:26:14 2013
@@ -174,6 +174,34 @@ public class ProcessAccounting {
 		return retVal;
 	}
 	
+	public void copyInventoryPID(IDuccWork dw, IDuccProcess inventoryProcess, IDuccProcess process) {
+		String methodName = "copyInventoryPID";
+		logger.trace(methodName, null, messages.fetch("enter"));
+		String newValue = inventoryProcess.getPID();
+		String oldValue = process.getPID();
+		logger.debug(methodName, dw.getDuccId(), inventoryProcess.getDuccId(), ""+newValue);
+		if(newValue == null) {
+			if(oldValue != null) {
+				logger.warn(methodName, dw.getDuccId(), inventoryProcess.getDuccId(), "PID"+" "+"old:"+oldValue+" "+"new:"+newValue+" "+"keeping old");
+			}
+		}
+		else {
+			if(oldValue == null) {
+				process.setPID(newValue);
+			}
+			else {
+				if(oldValue.equals(newValue)) {
+					//OK
+				}
+				else {
+					logger.warn(methodName, dw.getDuccId(), inventoryProcess.getDuccId(), "PID"+" "+"old:"+oldValue+" "+"new:"+newValue+" "+"keeping old");
+				}
+			}
+		}
+		logger.trace(methodName, null, messages.fetch("exit"));
+		return;
+	}
+	
 	public void copyInventorySwapUsage(IDuccWork dw, IDuccProcess inventoryProcess, IDuccProcess process) {
 		String methodName = "copyInventorySwapUsage";
 		logger.trace(methodName, null, messages.fetch("enter"));
@@ -467,12 +495,7 @@ public class ProcessAccounting {
 						}
 						if(process != null) {
 							// PID
-							String iPID = inventoryProcess.getPID();
-							String pPID = process.getPID();
-							if(!compare(iPID, pPID)) {
-								process.setPID(iPID);
-								logger.info(methodName, jobId, processId, messages.fetchLabel("pPID")+pPID+" "+messages.fetchLabel("iPID")+iPID);
-							}
+							copyInventoryPID(job, inventoryProcess, process);
 							// Scheduler State
 							setResourceStateAndReason(job, inventoryProcess, process);
 							// Process State