You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2012/03/05 21:23:12 UTC
svn commit: r1297218 -
/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Author: cwiklik
Date: Mon Mar 5 20:23:12 2012
New Revision: 1297218
URL: http://svn.apache.org/viewvc?rev=1297218&view=rev
Log:
UIMA-2180 Adds performance stats to the input CAS
Modified:
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java?rev=1297218&r1=1297217&r2=1297218&view=diff
==============================================================================
--- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java (original)
+++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java Mon Mar 5 20:23:12 2012
@@ -857,6 +857,24 @@ public class PrimitiveAnalysisEngineCont
inputCASReturned = true;
UimaTransport transport = getTransport(anEndpoint.getEndpoint());
+ if (getInProcessCache() != null && getInProcessCache().getSize() > 0
+ && getInProcessCache().entryExists(aCasReferenceId)) {
+ try {
+ CacheEntry ancestor =
+ getInProcessCache().
+ getTopAncestorCasEntry(getInProcessCache().getCacheEntryForCAS(aCasReferenceId));
+ if ( ancestor != null ) {
+ // Set a flag on the input CAS to indicate that the processing was aborted
+ ancestor.addDelegateMetrics(getKey(), performanceList);
+ }
+ } catch (Exception e) {
+ // An exception be be thrown here if the service is being stopped.
+ // The top level controller may have already cleaned up the cache
+ // and the getCacheEntryForCAS() will throw an exception. Ignore it
+ // here, we are shutting down.
+ }
+ }
+
UimaMessage message = transport.produceMessage(AsynchAEMessage.Process,
AsynchAEMessage.Response, getName());
message.addStringProperty(AsynchAEMessage.CasReference, aCasReferenceId);
@@ -875,6 +893,18 @@ public class PrimitiveAnalysisEngineCont
dropStats(aCasReferenceId, getName());
}
} else {
+ try {
+
+ CacheEntry entry =
+ getInProcessCache().getCacheEntryForCAS(aCasReferenceId);
+ entry.addDelegateMetrics(getKey(), performanceList);
+ } catch (Exception e) {
+ // An exception be be thrown here if the service is being stopped.
+ // The top level controller may have already cleaned up the cache
+ // and the getCacheEntryForCAS() will throw an exception. Ignore it
+ // here, we are shutting down.
+ }
+
if (!stopped && !clientUnreachable ) {
getOutputChannel().sendReply(getInProcessCache().getCacheEntryForCAS(aCasReferenceId), anEndpoint);
}