You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ea...@apache.org on 2008/06/18 20:07:21 UTC

svn commit: r669238 - in /incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main: java/org/apache/uima/aae/ java/org/apache/uima/aae/controller/ java/org/apache/uima/aae/handler/input/ resources/

Author: eae
Date: Wed Jun 18 11:07:21 2008
New Revision: 669238

URL: http://svn.apache.org/viewvc?rev=669238&view=rev
Log:
UIMA-1019 commit of Jerry's patch-3 files.

Modified:
    incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java
    incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
    incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
    incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/resources/uimaee_messages.properties

Modified: incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java?rev=669238&r1=669237&r2=669238&view=diff
==============================================================================
--- incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java (original)
+++ incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java Wed Jun 18 11:07:21 2008
@@ -247,7 +247,7 @@
 				}
 				if ( entry.isWaitingForRelease() )
 				{
-					sb.append(" <<< Waiting For Release Request From Client");
+					sb.append(" <<< Reached Final State in Controller:"+aControllerName);
 				}
 				sb.append("\n");
 			}
@@ -504,6 +504,22 @@
 		}
 		return true;
 	}
+
+	public Endpoint getTopAncestorEndpoint(CacheEntry anEntry) throws Exception
+	{
+		if ( anEntry == null )
+		{
+			return null;
+		}
+		
+		if ( anEntry.getInputCasReferenceId() == null )
+		{
+			return anEntry.getMessageOrigin();
+		}
+		CacheEntry parentEntry = getCacheEntryForCAS(anEntry.getInputCasReferenceId());
+		return getTopAncestorEndpoint(parentEntry);
+	}
+	
 	public void setNumberOfParallelDelegates(int aParallelDelegateCount, String aCasReferenceId)
 	throws AsynchAEException
 	{

Modified: incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java?rev=669238&r1=669237&r2=669238&view=diff
==============================================================================
--- incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java (original)
+++ incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java Wed Jun 18 11:07:21 2008
@@ -190,6 +190,23 @@
 	public void addMessageOrigin(String aCasReferenceId, Endpoint anEndpoint)
 	{
 		originMap.put(aCasReferenceId, anEndpoint);
+		if ( UIMAFramework.getLogger().isLoggable(Level.FINE))
+		{
+			Iterator it = originMap.keySet().iterator();
+			StringBuffer sb = new StringBuffer();
+			while( it.hasNext())
+			{
+				String key = (String) it.next();
+				Endpoint e = (Endpoint) originMap.get(key);
+				if ( e != null )
+				{
+					sb.append("\t\nCAS:"+key+" Origin:"+e.getEndpoint());
+				}
+			}
+			UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(),
+	                "addMessageOrigin", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_dump_msg_origin__FINE",
+	                new Object[] {getComponentName(), sb.toString()});
+		}
 	}
 
 
@@ -933,6 +950,7 @@
 	public void finalStep(FinalStep aStep,  String aCasReferenceId)
 	{
 		Endpoint endpoint=null;
+		boolean casDropped = false;
 
 		boolean subordinateCasInPlayCountDecremented=false;
 		CacheEntry cacheEntry = null;
@@ -962,8 +980,10 @@
 		{
 			endpoint = getInProcessCache().getEndpoint(null, aCasReferenceId);
 			//	Check if this CAS has children (subordinates)
-			if ( cacheEntry.getSubordinateCasInPlayCount() > 0 )
+			if ( getInProcessCache().hasNoSubordinates(aCasReferenceId) == false)
 			{
+				//	This CAS has child CASes still in play. This CAS will remain in the cache
+				//	until all its children are fully processed. 
 				UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(), 
 						"finalStep", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_final_step_parent_cas_child_count__FINEST", new Object[] { getComponentName(),aCasReferenceId,cacheEntry.getSubordinateCasInPlayCount()});
 				// Leave input CAS in pending state. It will be returned to the client
@@ -988,8 +1008,6 @@
 			//	CAS will be dropped. If this aggragate *is* a cas multiplier, the client
 			//	will send it a Release CAS request and only than the child count of the
 			//	parent CAS can be decremented.
-//			if ( freeCasEndpoint == null && cacheEntry.isSubordinate() )
-//			if ( !isCasMultiplier() && cacheEntry.isSubordinate() && isTopLevelComponent())
 			if ( cacheEntry.isSubordinate() && isTopLevelComponent())
 			{
 				//	 This is a subordinate CAS. First get cache entry for the input (parent) CAS
@@ -999,7 +1017,6 @@
 				subordinateCasInPlayCountDecremented = true;
 			}
 			Endpoint clientEndpoint = null;
-			boolean casDropped = false;
 			//	If the CAS was generated by this component but the Flow Controller wants to drop it OR this component
 			//	is not a Cas Multiplier
 			if ( forceToDropTheCas( cacheEntry, aStep ) )
@@ -1055,7 +1072,7 @@
 			UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINEST, CLASS_NAME.getName(), 
 					"finalStep", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_final_step_show_internal_stats__FINEST", new Object[] { getName(), flowMap.size(),getInProcessCache().getSize(),originMap.size(), super.statsMap.size()});
 			//	freeCasEndpoint is a special endpoint for sending Free CAS Notification.
-			if ( !isCasMultiplier() && freeCasEndpoint != null )
+			if (  casDropped && freeCasEndpoint != null )
 			{
 				freeCasEndpoint.setReplyEndpoint(true);
 				try
@@ -1299,7 +1316,8 @@
 		{
 			if ( cacheEntry.isSubordinate()) //getCasSequence() > 0 )
 			{
-				endpoint = getInProcessCache().getEndpoint(null, cacheEntry.getInputCasReferenceId());
+				endpoint = getInProcessCache().getTopAncestorEndpoint(cacheEntry);	
+//				endpoint = getInProcessCache().getEndpoint(null, cacheEntry.getInputCasReferenceId());
 			}
 			else
 			{

Modified: incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java?rev=669238&r1=669237&r2=669238&view=diff
==============================================================================
--- incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java (original)
+++ incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java Wed Jun 18 11:07:21 2008
@@ -25,6 +25,7 @@
 import org.apache.uima.aae.InProcessCache.CacheEntry;
 import org.apache.uima.aae.controller.AggregateAnalysisEngineController;
 import org.apache.uima.aae.controller.Endpoint;
+import org.apache.uima.aae.controller.Endpoint_impl;
 import org.apache.uima.aae.controller.PrimitiveAnalysisEngineController;
 import org.apache.uima.aae.error.AsynchAEException;
 import org.apache.uima.aae.error.ErrorContext;
@@ -275,6 +276,10 @@
 				//	instance of CM will have an endpoint where it expects Free CAS
 				// notifications.
 				freeCasEndpoint = aMessageContext.getEndpoint();
+				//	Clone an endpoint where Free Cas Request will be sent
+				freeCasEndpoint = (Endpoint)((Endpoint_impl)freeCasEndpoint).clone();
+				//	Reset the destination
+				aMessageContext.getEndpoint().setDestination(null);
 				//	This CAS came in from a CAS Multiplier. Treat it differently than the
 				//	input CAS. In case the Aggregate needs to send this CAS to the
 				//	client, retrieve the client destination by looking up the client endpoint

Modified: incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/resources/uimaee_messages.properties
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/resources/uimaee_messages.properties?rev=669238&r1=669237&r2=669238&view=diff
==============================================================================
--- incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/resources/uimaee_messages.properties (original)
+++ incubator/uima/sandbox/branches/uima-as-post1st/uimaj-as-core/src/main/resources/uimaee_messages.properties Wed Jun 18 11:07:21 2008
@@ -149,9 +149,6 @@
 UIMAEE_final_step_parent_cas_child_count__FINEST = Controller: {0} Final Step - Parent Cas Reference Id: {1} Has In-Play Subordinate CASes. Current Subordinate CAS Count: {2}
 UIMAEE_final_step_parent_cas_no_children__FINEST = Controller: {0} Final Step - Parent Cas Reference Id: {1} Has No Subordinate CASes Being Processed.
 UIMAEE_unable_to_check_ae_back_to_pool__WARNING = Controller: {0} Unable to Check In an Instance Of AE While Processing CPC. Exception {1} 
-<<<<<<< .mine
-UIMAEE_sending_fcq_req__FINE = Controller: {0} Sending Request To Release CAS: {1} To Cas Multiplier:{2} Queue: {3}
-UIMAEE_remove_cache_entry__INFO = Controller: {0} Releasing CASes Produced From Input CAS: {1}=======
 UIMAEE_sending_fcq_req__FINE = Controller: {0} Sending Request To Release CAS: {1} To Cas Multiplier:{2} Queue: {3}
 UIMAEE_remove_cache_entry__INFO = Controller: {0} Releasing CASes Produced From Input CAS: {1}
->>>>>>> .r661840
+UIMAEE_dump_msg_origin__FINE = Controller: {0} Origin Map Dump {1}