Author: schor
Date: Thu Dec 20 14:50:11 2018
New Revision: 1849401
URL: http://svn.apache.org/viewvc?rev=1849401&view=rev
Log:
[UIMA-5937] update pom version and scm, merge v2 updates, record merge
Added:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsPriorityBasedThreadFactory.java
- copied unchanged from r1846917,
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsPriorityBasedThreadFactory.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/message/MessageWrapper.java
- copied unchanged from r1846917,
uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/message/MessageWrapper.java
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/ (props changed)
uima/uv3/uima-as-v3/trunk/uimaj-as-core/pom.xml
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InputChannel.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/ParallelStep.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UIDGenerator.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatus.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatusImpl.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsBaseCallbackListener.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineController.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePool.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/ControllerDelegate.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/Delegate.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/CpcErrorHandler.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/GetMetaErrorHandler.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfo.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManagement.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManager.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/PrimitiveServiceInfo.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/ServicePerformance.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/monitor/JmxMonitorListener.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/message/AsynchAEMessage.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/message/UimaEEShutdownTriggerEvent.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/message/UimaMessageValidator.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/monitor/statistics/AnalysisEnginePerformanceMetrics.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/DeploymentDescriptorFactory.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/resourceSpecifier/factory/Import.java
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties
Propchange: uima/uv3/uima-as-v3/trunk/uimaj-as-core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 20 14:50:11 2018
@@ -1,2 +1,3 @@
/uima/uima-as/branches/depend-on-parent-pom-4/uimaj-as-core:961335-961760
/uima/uima-as/branches/mavenAlign/uimaj-as-core:941450-944450
+/uima/uima-as/trunk/uimaj-as-core:1786000-1846917
Modified: uima/uv3/uima-as-v3/trunk/uimaj-as-core/pom.xml
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/pom.xml?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
--- uima/uv3/uima-as-v3/trunk/uimaj-as-core/pom.xml (original)
+++ uima/uv3/uima-as-v3/trunk/uimaj-as-core/pom.xml Thu Dec 20 14:50:11 2018
@@ -15,7 +15,7 @@
<parent>
<groupId>org.apache.uima</groupId>
<artifactId>uima-as-parent</artifactId>
- <version>3.0.0-SNAPSHOT</version>
+ <version>3.0.1-SNAPSHOT</version>
<relativePath>../uima-as-parent/pom.xml</relativePath>
</parent>
@@ -30,13 +30,13 @@
cutting/pasting the <scm> element, and just changing the
following two properties -->
<scm>
<connection>
- scm:svn:http://svn.apache.org/repos/asf/uima/uima-as/trunk/uimaj-as-core
+
scm:svn:http://svn.apache.org/repos/asf/uima/uv3/uima-as-v3/trunk/uimaj-as-core
</connection>
<developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/uima/uima-as/trunk/uimaj-as-core
+
scm:svn:https://svn.apache.org/repos/asf/uima/uv3/uima-as-v3/trunk/uimaj-as-core
</developerConnection>
<url>
- http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core
+ http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core
</url>
</scm>
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InProcessCache.java
Thu Dec 20 14:50:11 2018
@@ -78,6 +78,8 @@ public class InProcessCache implements I
state. In this state the controller waits for
the cache to send notification when all CASes have been
processed.
+
+ @param ctrl - controller reference
**/
public void registerController(BaseAnalysisEngineController ctrl) {
controller = ctrl;
@@ -129,9 +131,9 @@ public class InProcessCache implements I
* processed, *but* its subordinate CASes are still in play. Input CAS is
only returned back to
* the client if all if its subordinate CASes are fully processed.
*
- * @param anInputCASReferenceId
- * @return
- * @throws Exception
+ * @param anInputCASReferenceId - input CAS id
+ * @return true/false
+ * @throws Exception on failure
*/
public boolean isInputCASPendingReply(String anInputCASReferenceId) throws
Exception {
if (anInputCASReferenceId == null) {
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InputChannel.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InputChannel.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InputChannel.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/InputChannel.java
Thu Dec 20 14:50:11 2018
@@ -22,6 +22,7 @@ package org.apache.uima.aae;
import org.apache.uima.aae.controller.Endpoint;
import org.apache.uima.aae.jmx.ServiceInfo;
import org.apache.uima.aae.message.MessageContext;
+import org.apache.uima.aae.message.MessageWrapper;
public interface InputChannel extends Channel {
public int getSessionAckMode();
@@ -44,6 +45,8 @@ public interface InputChannel extends Ch
public void createListener(String aDelegateKey, Endpoint endpointToUpdate)
throws Exception;
+ public void createListenerForTargetedMessages() throws Exception;
+
public boolean isFailed(String aDelegateKey);
public boolean isListenerForDestination(String anEndpointName);
@@ -55,4 +58,6 @@ public interface InputChannel extends Ch
public void terminate();
public void disconnectListenersFromQueue() throws Exception;
+
+ public void onMessage(MessageWrapper message);
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/ParallelStep.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/ParallelStep.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/ParallelStep.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/ParallelStep.java
Thu Dec 20 14:50:11 2018
@@ -41,9 +41,8 @@ public class ParallelStep extends Step {
* user's Flow implementation can (but is not required to) reuse the same
SimpleStep object
* multiple times.
*
- * @return an Analysis Engine key. This must be one of the keys in the
FlowController's
- * {@link FlowControllerContext#getAnalysisEngineMetaDataMap()}.
- */
+ * @param aKeys - saves keys to the AE
+ */
public void setAnalysisEngineKeys(String[] aKeys) {
mKeys = aKeys;
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UIDGenerator.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UIDGenerator.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UIDGenerator.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UIDGenerator.java
Thu Dec 20 14:50:11 2018
@@ -19,11 +19,24 @@
package org.apache.uima.aae;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.rmi.server.UID;
public class UIDGenerator implements UniqueIdGenerator {
- public String nextId() {
- return new UID().toString();
- }
+ public String nextId() {
+ return new UID().toString();
+ }
+ public static String getGUID() {
+ String localhost = "unknown_local_host";
+ try {
+ localhost = InetAddress.getLocalHost().getHostName();
+ } catch (UnknownHostException e) {
+ }
+ return localhost +"-" +new UID().toString();
+ }
+ public static void main(String[] args) {
+ System.out.println(UIDGenerator.getGUID());
+ }
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaAsThreadFactory.java
Thu Dec 20 14:50:11 2018
@@ -60,12 +60,7 @@ public class UimaAsThreadFactory impleme
public UimaAsThreadFactory(ThreadGroup tGroup) {
this(tGroup,null);
}
- /**
- *
- *
- * @param tGroup
- * @param aController
- */
+
public UimaAsThreadFactory(ThreadGroup tGroup,
PrimitiveAnalysisEngineController aController) {
this( tGroup, aController, null);
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaClassFactory.java
Thu Dec 20 14:50:11 2018
@@ -52,13 +52,12 @@ public class UimaClassFactory {
/**
* Creates a resource specifier from a given file
*
- * @param aFileResource
- * - resource filename
+ * @param aFileResource resource filename
* @return ResourceSpecifier - new instance
*
- * @throws InvalidXMLException
- * @throws ResourceInitializationException
- * @throws IOException
+ * @throws InvalidXMLException invalid xml
+ * @throws ResourceInitializationException init failed
+ * @throws IOException io failed
*/
public static ResourceSpecifier produceResourceSpecifier(String
aFileResource)
throws InvalidXMLException, ResourceInitializationException,
IOException {
@@ -95,20 +94,18 @@ public class UimaClassFactory {
/**
* Produces and initializes new FlowController
*
- * @param aeSpecifier
+ * @param aeSpecifier resource specifix
* -
- * @param aFlowControllerDescriptor
- * @param anAggregateMergedTypeSystem
- * - Merged type system from all delegates
- * @param aParentContext
- * - reference to parent context
- * @param aSofaMappings
- * -
- * @param aJmxManagementInterface
- * @return
- * @throws InvalidXMLException
- * @throws ResourceInitializationException
- * @throws IOException
+ * @param aFlowControllerDescriptor FC descriptor
+ * @param anAggregateMergedTypeSystem Merged type system from all delegates
+ * @param aParentContext reference to parent context
+ * @param aSofaMappings SOFA mappings
+ * @param aJmxManagementInterface jmx API
+ * @return initialized FlowContainer
+ *
+ * @throws InvalidXMLException bad xml
+ * @throws ResourceInitializationException init failure
+ * @throws IOException io failure
*/
public static FlowControllerContainer
produceAggregateFlowControllerContainer(
AnalysisEngineDescription aeSpecifier, String
aFlowControllerDescriptor,
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaSerializer.java
Thu Dec 20 14:50:11 2018
@@ -29,6 +29,7 @@ import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
+import java.util.Properties;
import javax.xml.parsers.FactoryConfigurationError;
import javax.xml.parsers.ParserConfigurationException;
@@ -50,74 +51,30 @@ import org.apache.uima.cas.impl.TypeSyst
import org.apache.uima.cas.impl.XmiCasDeserializer;
import org.apache.uima.cas.impl.XmiCasSerializer;
import org.apache.uima.cas.impl.XmiSerializationSharedData;
+import org.apache.uima.internal.util.XMLUtils;
import org.apache.uima.util.XMLSerializer;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.XMLReaderFactory;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
-//import java.util.concurrent.ConcurrentHashMap;
public class UimaSerializer {
private final ThreadLocal<XMLReader> localXmlReader = new
ThreadLocal<XMLReader>();
-// /**
-// * deserializes XCas into CAS
-// *
-// * @param anXcas
-// * @param aCas
-// * @throws Exception
-// */
-// public OutOfTypeSystemData deSerialiazeFromXCAS(String anXcas, CAS aCas)
throws Exception {
-// OutOfTypeSystemData otsd = new OutOfTypeSystemData();
-// TypeSystem typesToLoad2 = aCas.getTypeSystem();
-// ByteArrayInputStream bis = new ByteArrayInputStream(anXcas.getBytes());
-// XCASDeserializer deser2 = new XCASDeserializer(typesToLoad2);
-// ContentHandler deserHandler2 = deser2.getXCASHandler(aCas, otsd);
-//
-// SAXParserFactory fact2 = SAXParserFactory.newInstance();
-// SAXParser parser2;
-// parser2 = fact2.newSAXParser();
-// XMLReader xmlReader2 = parser2.getXMLReader();
-// xmlReader2.setContentHandler(deserHandler2);
-// xmlReader2.parse(new InputSource(bis));
-// return otsd;
-// }
-
-// /**
-// * Serializes CAS into a given OutputStream in XCAS format
-// *
-// * @param stream
-// * @param aCAS
-// * @param encoding
-// * @param typeSystem
-// * @throws IOException
-// * @throws SAXException
-// */
-// public void serializeToXCAS(OutputStream stream, CAS aCAS, String encoding,
-// TypeSystem typeSystem, OutOfTypeSystemData otsd) throws
IOException, SAXException {
-//
-// if (typeSystem == null)
-// typeSystem = aCAS.getTypeSystem();
-// XMLSerializer xmlSer = new XMLSerializer(stream, false);
-// if (encoding != null)
-// xmlSer.setOutputProperty(OutputKeys.ENCODING, encoding);
-// XCASSerializer ser = new XCASSerializer(typeSystem);
-// ser.serialize(aCAS, xmlSer.getContentHandler(), false, otsd);
-// }
/**
* Serializes CAS into a given OutputStream in Xmi format
*
- * @param stream
- * @param aCAS
- * @param encoding
- * @param typeSystem
- * @throws IOException
- * @throws SAXException
+ * @param stream output stream
+ * @param aCAS CAS to serialize
+ * @param encoding encoding to use
+ * @param typeSystem type system
+ * @param otsd type system
+ * @throws IOException io failure
+ * @throws SAXException parsing error
*/
public void serializeToXMI(OutputStream stream, CAS aCAS, String encoding,
TypeSystem typeSystem,
OutOfTypeSystemData otsd) throws IOException, SAXException {
@@ -135,6 +92,12 @@ public class UimaSerializer {
/**
* Utility method for serializing a CAS to an XMI String
+ *
+ * @param aCAS CAS to serialize
+ * @param serSharedData shared data
+ *
+ * @throws Exception on error
+ * @return serialized CAS
*/
public String serializeCasToXmi(CAS aCAS, XmiSerializationSharedData
serSharedData)
throws Exception {
@@ -170,15 +133,26 @@ public class UimaSerializer {
* Utility method for deserializing a CAS from an XMI String
* Does both processing of requests arriving to this service
* and responses returning to this service, or to a client.
+ *
+ * @param anXmlStr serialized CAS
+ * @param aCAS cas instance
+ * @param aSharedData shared data
+ * @param aLenient true or false
+ * @param aMergePoint merge point
+ *
+ * @throws FactoryConfigurationError factory error
+ * @throws ParserConfigurationException parser error
+ * @throws SAXException parsing error
+ * @throws IOException io error
*/
public void deserializeCasFromXmi(String anXmlStr, CAS aCAS,
XmiSerializationSharedData aSharedData, boolean aLenient, int
aMergePoint)
throws FactoryConfigurationError, ParserConfigurationException,
SAXException, IOException {
if (localXmlReader.get() == null) {
- localXmlReader.set(XMLReaderFactory.createXMLReader());
+ localXmlReader.set(XMLUtils.createXMLReader());
}
- XMLReader xmlReader = XMLReaderFactory.createXMLReader(); //
localXmlReader.get();
+ XMLReader xmlReader = XMLUtils.createXMLReader(); // localXmlReader.get();
Reader reader = new StringReader(anXmlStr);
XmiCasDeserializer deser = new XmiCasDeserializer(aCAS.getTypeSystem());
@@ -197,6 +171,18 @@ public class UimaSerializer {
* ignore - for parallel, with no delta cas being returned
* because earlier version of client wasn't supporting
delta cas
* See above method for requests and responses
+ *
+ * @param anXmlStr cas to deserialize
+ * @param aCAS target cas
+ * @param aSharedData shared data
+ * @param aLenient lenient or not
+ * @param aMergePoint merge point
+ * @param allow na
+ *
+ * @throws FactoryConfigurationError config error
+ * @throws ParserConfigurationException parsing error
+ * @throws SAXException parsing error
+ * @throws IOException io error
*/
public void deserializeCasFromXmi(String anXmlStr, CAS aCAS,
XmiSerializationSharedData aSharedData, boolean aLenient, int
aMergePoint,
@@ -204,7 +190,7 @@ public class UimaSerializer {
SAXException, IOException {
if (localXmlReader.get() == null) {
- localXmlReader.set(XMLReaderFactory.createXMLReader());
+ localXmlReader.set(XMLUtils.createXMLReader());
}
XMLReader xmlReader = localXmlReader.get();
Reader reader = new StringReader(anXmlStr);
@@ -215,7 +201,15 @@ public class UimaSerializer {
xmlReader.parse(new InputSource(reader));
}
- /** Utility method for deserializing a CAS from a binary */
+ /** Utility method for deserializing a CAS from a binary
+ *
+ * @param binarySource serialized cas
+ * @param aCAS target cas
+ *
+ * @throws Exception on error
+ *
+ * @return SerialFormat success
+ * */
public SerialFormat deserializeCasFromBinary(byte[] binarySource, CAS aCAS)
throws Exception {
ByteArrayInputStream fis = null;
try {
@@ -295,8 +289,14 @@ public class UimaSerializer {
// return an empty list
return new ArrayList<AnalysisEnginePerformanceMetrics>();
}
+
XStream xstream = new XStream(new DomDriver());
+ initXStream(xstream);
return
(List<AnalysisEnginePerformanceMetrics>)xstream.fromXML(serializedComponentStats);
}
-
+ public static void initXStream(XStream xstreamInstance) {
+ Class<?>[] classes = new Class[] {
Properties.class,ArrayList.class,List.class,AnalysisEnginePerformanceMetrics.class};
+ XStream.setupDefaultSecurity(xstreamInstance);
+ xstreamInstance.allowTypes(classes);
+ }
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatus.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatus.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatus.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatus.java
Thu Dec 20 14:50:11 2018
@@ -60,4 +60,10 @@ public interface UimaASProcessStatus ext
* @return a list of {@link AnalysisEnginePerformanceMetrics}
*/
public List<AnalysisEnginePerformanceMetrics> getPerformanceMetricsList();
+ /*
+ * Returns service target ID where client wanted to process a CAS
+ *
+ * @return service target ID
+ */
+ public String getServiceTargetId();
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatusImpl.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatusImpl.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatusImpl.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaASProcessStatusImpl.java
Thu Dec 20 14:50:11 2018
@@ -56,6 +56,9 @@ public class UimaASProcessStatusImpl imp
private List<AnalysisEnginePerformanceMetrics> performanceMetricsList;
+ private String serviceTargetID;
+
+
public UimaASProcessStatusImpl(ProcessTrace p) {
this(p, null, null);
}
@@ -202,4 +205,11 @@ public class UimaASProcessStatusImpl imp
return sb.toString();
}
+
+ public void setServiceTargetID(String sid) {
+ serviceTargetID = sid;
+ }
+ public String getServiceTargetId() {
+ return serviceTargetID;
+ }
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsBaseCallbackListener.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsBaseCallbackListener.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsBaseCallbackListener.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsBaseCallbackListener.java
Thu Dec 20 14:50:11 2018
@@ -32,8 +32,7 @@ public abstract class UimaAsBaseCallback
/**
* Called by Uima AS client API just before the CAS is send to the service.
*
- * @param status
- * - status object containing id of the CAS being send.
+ * @param status status object containing id of the CAS being send.
*/
public void onBeforeMessageSend(UimaASProcessStatus status) {
// to be overridden
@@ -42,9 +41,9 @@ public abstract class UimaAsBaseCallback
* Called by Uima AS client API before CAS processing begins at the remote
* UIMA AS service
*
- * @param status
- * @param nodeIP
- * @param pid
+ * @param status uima as status object
+ * @param nodeIP node ip
+ * @param pid process id
*/
public void onBeforeProcessCAS(UimaASProcessStatus status, String nodeIP,
String pid) {
// to be overridden
@@ -53,9 +52,9 @@ public abstract class UimaAsBaseCallback
* Called by Uima AS client API before GetMeta processing begins at the
remote
* UIMA AS service
*
- * @param nodeIP - Node IP where GetMeta request is handled
- * @param pid - Remote Service PID where GetMeta request is handled. The
- * has the following syntax: <PID:THREADID>
+ * @param nodeIP Node IP where GetMeta request is handled
+ * @param pid Remote Service PID where GetMeta request is handled. The
+ * has the following syntax: PID:THREADID
*/
public void onBeforeProcessMeta(String nodeIP, String pid) {
// to be overridden
@@ -69,8 +68,7 @@ public abstract class UimaAsBaseCallback
* The callback used to inform the application that the initialization
request has completed. On
* success aStatus will be null; on failure use the EntityProcessStatus
class to get the details.
*
- * @param aStatus
- * the status of the processing. This object contains a record of
any Exception that
+ * @param aStatus the status of the processing. This object contains a
record of any Exception that
* occurred, as well as timing information.
*/
public void initializationComplete(EntityProcessStatus aStatus) {
@@ -80,10 +78,8 @@ public abstract class UimaAsBaseCallback
/**
* Called when the processing of each entity has completed.
*
- * @param aCas
- * the CAS containing the processed entity and the analysis results
- * @param aStatus
- * the status of the processing. This object contains a record of
any Exception that
+ * @param aCas the CAS containing the processed entity and the analysis
results
+ * @param aStatus the status of the processing. This object contains a
record of any Exception that
* occurred, as well as timing information.
*/
public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
@@ -94,8 +90,7 @@ public abstract class UimaAsBaseCallback
* The callback used to inform the application that the CPC request has
completed. On success
* aStatus will be null; on failure use the EntityProcessStatus class to get
the details.
*
- * @param aStatus
- * the status of the processing. This object contains a record of
any Exception that
+ * @param aStatus the status of the processing. This object contains a
record of any Exception that
* occurred, as well as timing information.
*/
public void collectionProcessComplete(EntityProcessStatus aStatus) {
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/client/UimaAsynchronousEngine.java
Thu Dec 20 14:50:11 2018
@@ -44,7 +44,7 @@ import org.apache.uima.resource.metadata
* registered, and {@link #initialize(Map)} method is called, the application
may call
* {@link #process()} method.
*
- * <p>
+ *
* This API enables the application to dynamically deploy UIMA AS services
that it intends to use
* for processing. These services are deployed in a container and are
collocated in the same JVM as
* the application. The services are considered private and used exclusively
by the application. To
@@ -53,20 +53,20 @@ import org.apache.uima.resource.metadata
* descriptor or an array thereof. The application must deploy its "private"
services *before*
* calling {@link #initialize(Map)} method.
*
- * <p>
+ *
* The application may stop the UIMA AS client in the middle of processing by
calling
* {@link #stop()} method.
*
- * <p>
+ *
* Listeners can register with the <code>UimaAsynchronousEngine</code> by
calling the
* {@link #addStatusCallbackListener(UimaAsBaseCallbackListener)} method.
These listeners receive
* status callbacks during the processing. An exception to that is the
synchronous processing via
* {@link #sendAndReceiveCAS(CAS)} method. This method returns either a CAS
containing results of
* analysis or an exception. No callbacks are made while processing CASes
synchronously.
- * <p>
+ *
* An application may choose to implement parallelization of the processing,
calling either
* {@link #sendAndReceiveCAS(CAS)} or {@link #sendCAS(CAS)} methods from
multiple threads.
- * <p>
+ *
*
*
*/
@@ -80,7 +80,7 @@ public interface UimaAsynchronousEngine
* Name of an application that uses Uima AS client. The application provides
it to the Uima AS client
* in a Map which is an argument in {@link #initialize(Map)} .This name is
used to register Uima AS
* client MBean with JMX. To make the name unique, provided string is
prepended to a UUID to form
- * <ApplicationName>_www_xxxx_yyyy_zzzz
+ * ApplicationName_www_xxxx_yyyy_zzzz
*/
public final String ApplicationName = "ApplicationName";
@@ -144,7 +144,7 @@ public interface UimaAsynchronousEngine
/**
* Path to the XSLT processor to use when processing a deployment
descriptor. The application provides it to the Uima AS
* client via System property, either on a command line using -D, or
explicitly by using java's
- * System.setProperty(DD2SpringXsltFilePath,<value>). This path is required
only if the Uima AS Client is used to deploy
+ * System.setProperty(DD2SpringXsltFilePath,value). This path is required
only if the Uima AS Client is used to deploy
* Uima AS service.
*/
public static final String DD2SpringXsltFilePath = "DD2SpringXsltFilePath";
@@ -157,7 +157,7 @@ public interface UimaAsynchronousEngine
/**
* Saxon classpath to use when processing a deployment descriptor. The
application provides it to the Uima AS
* client via System property, either on a command line using -D, or
explicitly by using java's
- * System.setProperty(SaxonClasspath,<value>). This path is required only if
the Uima AS Client is used to deploy
+ * System.setProperty(SaxonClasspath,value). This path is required only if
the Uima AS Client is used to deploy
* Uima AS service.
*/
public static final String SaxonClasspath = "SaxonClasspath";
@@ -166,7 +166,7 @@ public interface UimaAsynchronousEngine
* Debug flag to use when processing a deployment descriptor. If set, the
dd2spring processor will not remove generated
* spring configuration file on client exit. The application provides it to
the Uima AS
* client via System property, either on a command line using -D, or
explicitly by using java's
- * System.setProperty(UimaEeDebug,<value>). This setting is only relevant if
the Uima AS Client is used to deploy
+ * System.setProperty(UimaEeDebug,value). This setting is only relevant if
the Uima AS Client is used to deploy
* Uima AS service.
*/
public static final String UimaEeDebug = "-uimaEeDebug";
@@ -205,6 +205,9 @@ public interface UimaAsynchronousEngine
*/
public static final String TimerPerCAS = "TimerPerCAS";
+
+ public static final String TargetSelectorProperty ="TargetServiceId";
+
/**
* Initializes UIMA asynchronous client using configuration parameters
provided in a Map object.
* It creates a connection to a service queue managed by a Broker as
specified in the parameters.
@@ -219,7 +222,7 @@ public interface UimaAsynchronousEngine
* - configuration containing UIMA EE Service Broker URI, service
queue name, timeout
* value, reply window size, and CAS Pool size.
*
- * @throws ResourceInitializationException
+ * @throws ResourceInitializationException init error
*/
public void initialize(Map anApplicationContext) throws
ResourceInitializationException;
@@ -230,7 +233,7 @@ public interface UimaAsynchronousEngine
* @param aCollectionReader
* - instance of a <code>CollectionReader</code>
*
- * @throws ResourceInitializationException
+ * @throws ResourceInitializationException init error
*/
public void setCollectionReader(CollectionReader aCollectionReader)
throws ResourceInitializationException;
@@ -257,14 +260,14 @@ public interface UimaAsynchronousEngine
* Stops the asynchronous client. Cleans up resources, drops connection to
UIMA AS service queue
* and stops listening on a response queue.
*
- * @throws Exception
+ * @throws Exception error
*/
public void stop() throws Exception;
/**
* Not implemented
*
- * @return null
+ * @return performance report
*/
public String getPerformanceReport();
@@ -297,16 +300,33 @@ public interface UimaAsynchronousEngine
* - a CAS to analyze.
*
* @return - returns a unique identifier associated with the sent CAS
- * @throws ResourceProcessException
+ * @throws ResourceProcessException error
*/
public String sendCAS(CAS aCAS) throws ResourceProcessException;
+
+ /**
+ * Sends a given CAS for analysis to a specific instance of UIMA AS Service.
This method may block if the client is
+ * configured to use a reply window which prevents sending too many CASes to
the service. Assuming
+ * the window is large enough to send the CAS, this method returns as soon
as the CAS is sent.
+ * Before sending the CAS, a timer starts that will expire if a reply
doesn't arrive in a given
+ * interval.
+ *
+ * @param aCAS
+ * - a CAS to analyze.
+ * @param targetServiceId
+ * - Id of a service which should process the CAS
+ *
+ * @return - returns a unique identifier associated with the sent CAS
+ * @throws ResourceProcessException error
+ */
+ public String sendCAS(CAS aCAS, String targetServiceId) throws
ResourceProcessException;
/**
* Requests new CAS instance from a CAS pool. This method blocks until a
free instance of CAS is
* available in a CAS pool.
*
* @return - new CAS instance fetched from the CAS pool
- * @throws Exception
+ * @throws Exception error
*/
public CAS getCAS() throws Exception;
@@ -316,7 +336,7 @@ public interface UimaAsynchronousEngine
* this method will notify an application of completing the Collection
Processing Complete request
* using registered listener
*
- * @throws ResourceProcessException
+ * @throws ResourceProcessException error
*/
public void collectionProcessingComplete() throws ResourceProcessException;
@@ -327,7 +347,9 @@ public interface UimaAsynchronousEngine
* returns - an ProcessingResourceMetadata received from an asynchronous
Analysis Engine service,
* or null if initialize() has not yet been called.
*
- * @throws ResourceInitializationException
+ * @throws ResourceInitializationException error
+ *
+ * @return ProcessingResourceMetaData metadata
*/
public ProcessingResourceMetaData getMetaData() throws
ResourceInitializationException;
@@ -339,7 +361,7 @@ public interface UimaAsynchronousEngine
* @param aCAS
* - a CAS to analyze.
* @return - a unique id assigned to the CAS
- * @throws ResourceProcessException
+ * @throws ResourceProcessException error
*/
public String sendAndReceiveCAS(CAS aCAS) throws ResourceProcessException;
/**
@@ -352,9 +374,24 @@ public interface UimaAsynchronousEngine
* @param aCAS - a CAS to analyze.
* @param componentMetricsList - empty list to be filled with per AE
performance metrics
* @return - a unique id assigned to the CAS
- * @throws ResourceProcessException
+ * @throws ResourceProcessException error
*/
public String sendAndReceiveCAS(CAS aCAS,
List<AnalysisEnginePerformanceMetrics> componentMetricsList) throws
ResourceProcessException;
+
+ /**
+ * This synchronous method sends a given CAS to a UIMA AS service and waits
for response. The
+ * method either returns a CAS with the result of analysis or throws an
exception. It doesn't
+ * use call-backs through a registered application listener. If there is
+ * no exception, the method also returns per Analysis Engine performance
breakdown for the CAS.
+ * This breakdown can be used to identify how much time each AE took to
process the CAS.
+ *
+ * @param aCAS - a CAS to analyze.
+ * @param componentMetricsList - empty list to be filled with per AE
performance metrics
+ * @param targetServiceId - Id of a specific service which should process
the CAS
+ * @return - a unique id assigned to the CAS
+ * @throws ResourceProcessException error
+ */
+ public String sendAndReceiveCAS(CAS aCAS,
List<AnalysisEnginePerformanceMetrics> componentMetricsList, String
targetServiceId) throws ResourceProcessException;
/**
* Deploys a UIMA AS container and all services defined in the provided
deployment descriptor.
* The deployment is within the same JVM.
@@ -404,7 +441,7 @@ public interface UimaAsynchronousEngine
* @param aSpringContainerId
* - an id of the container to be destroyed.
*
- * @throws Exception
+ * @throws Exception error
*/
public void undeploy(String aSpringContainerId) throws Exception;
@@ -415,8 +452,8 @@ public interface UimaAsynchronousEngine
*
* @param aSpringContainerId
* - an id of the container to be destroyed.
- *
- * @throws Exception
+ * @param stop_level stop
+ * @throws Exception error
*/
public void undeploy(String aSpringContainerId, int stop_level) throws
Exception;
@@ -441,6 +478,7 @@ public interface UimaAsynchronousEngine
* service is a Cas Multiplier, it will stop producing new CASes, will wait
until all child CASes
* finish and finally returns the input CAS.
*
+ * @param aCasReferenceId cas id
*/
public void stopProducingCases(String aCasReferenceId);
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
Thu Dec 20 14:50:11 2018
@@ -23,6 +23,7 @@ import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -86,8 +87,12 @@ import org.apache.uima.flow.ParallelStep
import org.apache.uima.flow.SimpleStep;
import org.apache.uima.flow.Step;
import org.apache.uima.resource.ResourceInitializationException;
+import org.apache.uima.resource.metadata.FsIndexCollection;
+import org.apache.uima.resource.metadata.FsIndexDescription;
import org.apache.uima.resource.metadata.ProcessingResourceMetaData;
import org.apache.uima.resource.metadata.ResourceMetaData;
+import org.apache.uima.resource.metadata.TypePriorities;
+import org.apache.uima.resource.metadata.TypePriorityList;
import org.apache.uima.resource.metadata.TypeSystemDescription;
import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.util.Level;
@@ -181,32 +186,12 @@ public class AggregateAnalysisEngineCont
private Lock mergeLock = new ReentrantLock();
- /**
- *
- * @param anEndpointName
- * @param aDescriptor
- * @param aCasManager
- * @param anInProcessCache
- * @param aDestinationMap
- * @throws Exception
- */
- public AggregateAnalysisEngineController_impl(String anEndpointName, String
aDescriptor,
+ public AggregateAnalysisEngineController_impl(String anEndpointName,
String aDescriptor,
AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map
aDestinationMap)
throws Exception {
this(null, anEndpointName, aDescriptor, aCasManager, anInProcessCache,
aDestinationMap);
}
- /**
- *
- *
- * @param aParentController
- * @param anEndpointName
- * @param aDescriptor
- * @param aCasManager
- * @param anInProcessCache
- * @param aDestinationMap
- * @throws Exception
- */
public AggregateAnalysisEngineController_impl(AnalysisEngineController
aParentController,
String anEndpointName, String aDescriptor, AsynchAECasManager
aCasManager,
InProcessCache anInProcessCache, Map aDestinationMap) throws
Exception {
@@ -241,9 +226,7 @@ public class AggregateAnalysisEngineCont
delegateStats.put(delegateKey, aServiceStats);
}
- /**
- *
- */
+
public void addMessageOrigin(String aCasReferenceId, Endpoint anEndpoint) {
if (anEndpoint == null) {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
@@ -285,10 +268,7 @@ public class AggregateAnalysisEngineCont
return false;
}
- /**
- *
- * @param anEndpointName
- */
+
public void setServiceEndpointName(String anEndpointName) {
serviceEndpointName = anEndpointName;
if (this.isTopLevelComponent()) {
@@ -297,17 +277,12 @@ public class AggregateAnalysisEngineCont
}
}
- /**
- *
- */
+
public String getServiceEndpointName() {
return serviceEndpointName;
}
- /**
- *
- * @param aBeanName
- */
+
public void setControllerBeanName(String aBeanName) {
controllerBeanName = aBeanName;
if (this.isTopLevelComponent()) {
@@ -315,9 +290,7 @@ public class AggregateAnalysisEngineCont
}
}
- /**
- *
- */
+
public Endpoint getMessageOrigin(String aCasReferenceId) {
if (originMap.containsKey(aCasReferenceId)) {
return (Endpoint) originMap.get(aCasReferenceId);
@@ -337,9 +310,6 @@ public class AggregateAnalysisEngineCont
}
}
- /**
- *
- */
public void dropCAS(String aCasReferenceId, boolean dropCacheEntry) {
FlowContainer flow = lookupFlow(aCasReferenceId);
@@ -363,9 +333,6 @@ public class AggregateAnalysisEngineCont
}
- /**
- *
- */
public void mapEndpointsToKeys(ConcurrentHashMap aDestinationMap) {
destinationMap = aDestinationMap;
Set set = destinationMap.entrySet();
@@ -410,10 +377,7 @@ public class AggregateAnalysisEngineCont
}
}
- /**
- *
- * @return
- */
+
private synchronized boolean allDelegatesCompletedCollection() {
Set set = destinationMap.entrySet();
for (Iterator it = set.iterator(); it.hasNext();) {
@@ -434,9 +398,7 @@ public class AggregateAnalysisEngineCont
return delegateStats;
}
- /**
- *
- */
+
public void processCollectionCompleteReplyFromDelegate(String aDelegateKey,
boolean sendReply)
throws AsynchAEException {
@@ -513,19 +475,12 @@ public class AggregateAnalysisEngineCont
clearStats();
}
- /**
- *
- * @param aFlowControllerDescriptor
- */
+
public synchronized void setFlowControllerDescriptor(String
aFlowControllerDescriptor) {
flowControllerDescriptor = aFlowControllerDescriptor;
}
- /**
- *
- * @param anEndpoint
- * @throws AsynchAEException
- */
+
private void waitUntilAllCasesAreProcessed(Endpoint anEndpoint) throws
AsynchAEException {
try {
boolean cacheNotEmpty = true;
@@ -551,9 +506,7 @@ public class AggregateAnalysisEngineCont
}
}
- /**
- *
- */
+
public void takeAction(String anAction, String anEndpointName, ErrorContext
anErrorContext) {
try {
handleAction(anAction, anEndpointName, anErrorContext);
@@ -863,8 +816,6 @@ public class AggregateAnalysisEngineCont
* - reference id of the CAS created by the CAS multiplier
* @param newCASProducedBy
* - name of the multiplier that created the CAS
- * @throws AnalysisEngineProcessException
- * @throws AsynchAEException
*/
public void process(CAS aCAS, String anInputCasReferenceId, String
aNewCasReferenceId,
String newCASProducedBy) // throws AnalysisEngineProcessException,
AsynchAEException
@@ -1100,7 +1051,8 @@ public class AggregateAnalysisEngineCont
/**
* This is a process method that is executed for CASes not created by a
Multiplier in this
* aggregate.
- *
+ * @param aCAS cas
+ * @param aCasReferenceId cas id
*/
public void process(CAS aCAS, String aCasReferenceId) {
boolean handlingDelayedStep = false;
@@ -1388,6 +1340,9 @@ public class AggregateAnalysisEngineCont
* gives the string feature to use. An example of type and feature names
to use would be
* "org.apache.uima.examples.SourceDocumentInformation" and "uri".
*
+ * @param analysisEngineKey key
+ * @param cas CAS
+ * @throws Exception error
*/
private void logCasForEndpoint(String analysisEngineKey, CAS cas) throws
Exception {
synchronized (enableCasLogMap) {
@@ -2211,15 +2166,6 @@ public class AggregateAnalysisEngineCont
}
}
- if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
- UIMAFramework.getLogger(CLASS_NAME).logrb(
- Level.FINE,
- CLASS_NAME.getName(),
- "sendReplyToRemoteClient",
- UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
- "UIMAEE_client_dead__FINE",
- new Object[] { getComponentName(),
replyEndpoint.getDestination().toString(), casStateEntry.getCasReferenceId()});
- }
dropCAS(casStateEntry.getCasReferenceId(), true);
// If the cache is empty change the state of the Aggregate to idle
if (getInProcessCache().isEmpty()) {
@@ -2358,6 +2304,9 @@ public class AggregateAnalysisEngineCont
}
/**
Check if a given destination exists in the DeadClient Map
+
+ @param destination destination
+ @return true if client is dead false otherwise
**/
private boolean isClientDead(String destination) {
if ( super.deadClientDestinationMap.containsKey(destination)) {
@@ -2560,6 +2509,13 @@ public class AggregateAnalysisEngineCont
* a list of CASes pending dispatch. The delegate is in a questionable state
and the aggregate
* sends a ping message to check delegate's availability. If the delegate
responds to the ping,
* all CASes in the pending dispatch list will be immediately dispatched.
+ *
+ * @param aCasReferenceId cas id
+ * @param aDelegateKey delegate key
+ * @param casHashcode hashcode
+ *
+ * @return true if cas in timed out state
+ * @throws AsynchAEException error
**/
public boolean delayCasIfDelegateInTimedOutState(String aCasReferenceId,
String aDelegateKey, long casHashcode)
throws AsynchAEException {
@@ -2668,6 +2624,11 @@ public class AggregateAnalysisEngineCont
/**
* Returns a delegate key given an endpoint (queue) name and a server uri.
If a server is null,
* only the endpoint name will be used for matching.
+ *
+ * @param anEndpointName enadpoint name
+ * @param server server id
+ *
+ * @return delegate key
*/
public String lookUpDelegateKey(String anEndpointName, String server) {
String key = null;
@@ -2927,6 +2888,10 @@ public class AggregateAnalysisEngineCont
}
AnalysisEngineDescription specifier = (AnalysisEngineDescription)
super.getResourceSpecifier();
aggregateMetadata = specifier.getAnalysisEngineMetaData();
+
+// String myCurrentDir = System.getProperty("user.dir");// + File.separator
+ System.getProperty("sun.java.command") .substring(0,
System.getProperty("sun.java.command").lastIndexOf(".")) .replace(".",
File.separator);
+ System.out.println(">>>>!!!!! "+flowControllerDescriptor);
+
flowControllerContainer =
UimaClassFactory.produceAggregateFlowControllerContainer(specifier,
flowControllerDescriptor, analysisEngineMetaDataMap,
getUimaContextAdmin(),
((AnalysisEngineDescription)
getResourceSpecifier()).getSofaMappings(), super
@@ -2934,15 +2899,23 @@ public class AggregateAnalysisEngineCont
super.addUimaObject(flowControllerContainer.getMBean().getUniqueMBeanName());
if (isTopLevelComponent()) {
- // Add FC's meta
+ // Merge FC's meta with meta from all delegates
getCasManagerWrapper().addMetadata((ProcessingResourceMetaData)flowControllerContainer.getMetaData());
// Top level component is the outer most component in the containment
hierarchy.
getCasManagerWrapper().initialize("AggregateContext");
-
aggregateMetadata.setTypeSystem(getCasManagerWrapper().getMetadata().getTypeSystem());
-
aggregateMetadata.setTypePriorities(getCasManagerWrapper().getMetadata().getTypePriorities());
-
aggregateMetadata.setFsIndexCollection(getCasManagerWrapper().getMetadata()
- .getFsIndexCollection());
+ // merge this aggregate type system description with its delegate TSD's
+ TypeSystemDescription aggTypeDesc = mergeTypeSystem();
+ aggregateMetadata.setTypeSystem(aggTypeDesc);
+
+ // merge this aggregate type priorities with its delegate TP's
+ TypePriorities aggTypePriorities = mergeTypePriorities();
+ aggregateMetadata.setTypePriorities(aggTypePriorities);
+
+ // merge this aggregate FsIndexes with its delegate FS's
+ FsIndexCollection aggIndexColl = mergeFsIndexes();
+ aggregateMetadata.setFsIndexCollection(aggIndexColl);
+
}
if (disabledDelegateList.size() > 0) {
flowControllerContainer.removeAnalysisEngines(disabledDelegateList);
@@ -2973,7 +2946,57 @@ public class AggregateAnalysisEngineCont
startProcessing();
}
}
+ private TypeSystemDescription mergeTypeSystem() throws
ResourceInitializationException {
+ List<TypeSystemDescription> tsl =
+ new ArrayList<TypeSystemDescription>();
+ if ( aggregateMetadata.getTypeSystem() != null ) {
+ tsl.add(aggregateMetadata.getTypeSystem());
+ }
+ if ( getCasManagerWrapper().getMetadata().getTypeSystem() != null ) {
+ tsl.add(getCasManagerWrapper().getMetadata().getTypeSystem());
+ }
+
+ return CasCreationUtils.mergeTypeSystems(tsl,
+ getCasManagerWrapper().getResourceManager());
+ }
+ private FsIndexCollection mergeFsIndexes() throws
ResourceInitializationException {
+ FsIndexCollection aggIndexColl =
+ getCasManagerWrapper().getMetadata()
+ .getFsIndexCollection();
+
+ if ( aggregateMetadata.getFsIndexes() != null ) {
+ for ( FsIndexDescription fid :
aggregateMetadata.getFsIndexes() ) {
+ getCasManagerWrapper().getMetadata()
+ .getFsIndexCollection().addFsIndex(fid);
+ }
+ List<FsIndexCollection> cl = new
ArrayList<FsIndexCollection>();
+
cl.add(getCasManagerWrapper().getMetadata().getFsIndexCollection());
+
+ aggIndexColl =
+ CasCreationUtils.
+ mergeFsIndexes(cl,
getCasManagerWrapper().getResourceManager());
+
+ }
+ return aggIndexColl;
+ }
+ private TypePriorities mergeTypePriorities() throws
ResourceInitializationException {
+ TypePriorities aggTypePriorities =
+
getCasManagerWrapper().getMetadata().getTypePriorities();
+ if ( aggregateMetadata.getTypePriorities() != null &&
aggregateMetadata.getTypePriorities().getPriorityLists() != null) {
+ for( TypePriorityList pl :
aggregateMetadata.getTypePriorities().getPriorityLists()) {
+ getCasManagerWrapper().
+ getMetadata().
+ getTypePriorities().
+ addPriorityList(pl);
+ }
+ List<? extends TypePriorities> tpl =
+
Arrays.asList(getCasManagerWrapper().getMetadata().getTypePriorities());
+ aggTypePriorities = CasCreationUtils.mergeTypePriorities(tpl,
+ getCasManagerWrapper().getResourceManager());
+ }
+ return aggTypePriorities;
+ }
protected void startProcessing() throws Exception {
// Open latch to allow messages to be processed. The
@@ -3192,7 +3215,7 @@ public class AggregateAnalysisEngineCont
/**
* Accumulate analysis time for the aggregate
*
- * @param anAnalysisTime
+ * @param anAnalysisTime time
*/
public synchronized void incrementAnalysisTime(long anAnalysisTime) {
servicePerformance.incrementAnalysisTime(anAnalysisTime);
@@ -3444,10 +3467,7 @@ public class AggregateAnalysisEngineCont
return localCache;
}
- /**
- * Return {@link Delegate} object for a given delegate key.
- *
- */
+
public Delegate lookupDelegate(String aDelegateKey) {
for (Delegate delegate : delegates) {
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineController.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineController.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineController.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineController.java
Thu Dec 20 14:50:11 2018
@@ -226,10 +226,7 @@ public interface AnalysisEngineControlle
public String getKey();
public void dumpState(StringBuffer buffer, String lbl1);
- /**
- * Return UIMA AS process PID
- * @return
- */
+
public String getPID();
public void warmUp(String warmUpDataPath, CountDownLatch warmUpLatch) throws
Exception;
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePool.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePool.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePool.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AnalysisEngineInstancePool.java
Thu Dec 20 14:50:11 2018
@@ -29,7 +29,7 @@ public interface AnalysisEngineInstanceP
*
* @param anAnalysisEngine
* - AnalysisEngine instance to be added to the pool
- * @throws Exception
+ * @throws Exception error
*/
public void checkin(AnalysisEngine anAnalysisEngine) throws Exception;
@@ -37,21 +37,21 @@ public interface AnalysisEngineInstanceP
* Borrows an instance of AnalysisEngine from the pool
*
* @return AnalysisEngine instance
- * @throws Exception
+ * @throws Exception error
*/
public AnalysisEngine checkout() throws Exception;
/**
* Destroys Analysis Engine instance pool.
*
- * @throws Exception
+ * @throws Exception error
*/
public void destroy() throws Exception;
/**
* Checks if the current Thread is assigned to an AE instance
*
- * @return
+ * @return true or false
*/
public boolean exists();
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
Thu Dec 20 14:50:11 2018
@@ -94,7 +94,7 @@ import org.apache.uima.analysis_engine.m
import org.apache.uima.analysis_engine.metadata.SofaMapping;
import org.apache.uima.cas.CAS;
import org.apache.uima.collection.CollectionReaderDescription;
-import org.apache.uima.impl.UimaVersion;
+import org.apache.uima.resource.CustomResourceSpecifier;
import org.apache.uima.resource.PearSpecifier;
import org.apache.uima.resource.Resource;
import org.apache.uima.resource.ResourceCreationSpecifier;
@@ -934,9 +934,7 @@ public abstract class BaseAnalysisEngine
}
}
- /**
- * Override the default JmxManager
- */
+
public void setJmxManagement(JmxManagement aJmxManagement) {
jmxManagement = aJmxManagement;
}
@@ -966,46 +964,68 @@ public abstract class BaseAnalysisEngine
public boolean isTopLevelComponent() {
return (parentController == null);
}
+
+ private String getDelegateServiceName() {
+ String svcName = null;
+ try {
+ UimaContext childContext =
parentController.getChildUimaContext(endpointName);
+ svcName = ((UimaContextAdmin)
childContext).getQualifiedContextName();
+ if (svcName != null) {
+ if (svcName.startsWith("/")) {
+ svcName = svcName.substring(1);
+ svcName = svcName.replaceAll("/", "_");
// normalize
+ if (svcName.endsWith("_")) {
+ svcName = svcName.substring(0,
serviceName.length() - 1);
+ }
+ }
+ }
+ } catch (Exception e) {
+ svcName = delegateKey;
+ }
+ return svcName;
+ }
+ private String getTopLevelServiceName() {
+ String svcName = null;
+ if (isPrimitive()) {
+ String implementationName = "";
+ if (resourceSpecifier instanceof
ResourceCreationSpecifier) {
+ implementationName =
((ResourceCreationSpecifier) resourceSpecifier).getImplementationName();
+ } else if (resourceSpecifier instanceof
CustomResourceSpecifier) {
+ implementationName = ((CustomResourceSpecifier)
resourceSpecifier).getResourceClassName();
+ }
+
+ if (implementationName.indexOf(".") > 0) {
+ implementationName =
implementationName.substring(implementationName.lastIndexOf(".") + 1);
+ }
+ svcName = implementationName;
+ } else {
+ svcName = "Top Level Aggregate Service";
+ }
+ return svcName;
+ }
private String setupName() {
- //return ((ResourceCreationSpecifier)
resourceSpecifier).getMetaData().getName();
- String serviceName = ((ResourceCreationSpecifier)
resourceSpecifier).getMetaData().getName();
- if ( serviceName == null || serviceName.trim().length() == 0 ) {
-
- if ( isTopLevelComponent() ) {
- if ( isPrimitive() ) {
- String implementationName = ((ResourceCreationSpecifier)
resourceSpecifier).getImplementationName();
- if ( implementationName.indexOf(".") > 0) {
- implementationName =
implementationName.substring(implementationName.lastIndexOf(".")+1);
- }
- serviceName = implementationName;
- } else {
- serviceName = "Top Level Aggregate Service";
- }
- } else {
- try {
- UimaContext childContext =
parentController.getChildUimaContext(endpointName);
- serviceName =
((UimaContextAdmin)childContext).getQualifiedContextName();
- if ( serviceName != null ) {
- if ( serviceName.startsWith("/")) {
- serviceName = serviceName.substring(1);
- serviceName = serviceName.replaceAll("/", "_"); // normalize
- if ( serviceName.endsWith("_")) {
- serviceName = serviceName.substring(0, serviceName.length()-1);
- }
- }
- }
- } catch( Exception e){
- serviceName = delegateKey;
- }
- }
- if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
- UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO,
CLASS_NAME.getName(),
- "setupName", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
- "UIMAEE_using_generated_name_INFO", new Object[] { serviceName
});
- }
-
- }
- return serviceName;
+ String svcName = null;
+
+ if (!(resourceSpecifier instanceof CustomResourceSpecifier)) {
+ svcName = ((ResourceCreationSpecifier)
resourceSpecifier).getMetaData().getName();
+ }
+
+ if (svcName == null || svcName.trim().length() == 0) {
+
+ if (isTopLevelComponent()) {
+ svcName = getTopLevelServiceName();
+ } else {
+ svcName = getDelegateServiceName();
+ }
+
+ }
+
+ if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO))
{
+ UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO,
CLASS_NAME.getName(), "setupName",
+
UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_using_generated_name_INFO",
+ new Object[] { svcName });
+ }
+ return svcName;
}
/**
* Returns the name of the component. The name comes from the analysis
engine descriptor
@@ -1105,6 +1125,7 @@ public abstract class BaseAnalysisEngine
}
public void addInputChannel(InputChannel anInputChannel) {
+ inputChannelLatch.countDown();
if (!inputChannelMap.containsKey(anInputChannel.getInputQueueName())) {
inputChannelMap.put(anInputChannel.getInputQueueName(), anInputChannel);
if (!inputChannelList.contains(anInputChannel)) {
@@ -1657,6 +1678,8 @@ public abstract class BaseAnalysisEngine
* statistics. A key to the map is the CAS id. This method creates a new
instance of
* ServicePerformance object if one doesnt exist in the map for a given CAS
id.
*
+ * @param aCasReferenceId cas id
+ * @return ServicePerformance performance stats
*/
public ServicePerformance getCasStatistics(String aCasReferenceId) {
ServicePerformance casStats = null;
@@ -1672,8 +1695,8 @@ public abstract class BaseAnalysisEngine
/**
* Logs statistics
*
- * @param aDelegateKey
- * @param aDelegateServicePerformance
+ * @param aDelegateKey delegate key
+ * @param aServicePerformance performance stats
*/
protected void logStats(String aDelegateKey, ServicePerformance
aServicePerformance) {
if (aServicePerformance != null) {
@@ -1848,17 +1871,13 @@ public abstract class BaseAnalysisEngine
return clientEndpoint;
}
- /**
- *
- * @param anEndpoint
- */
- public void cacheClientEndpoint(Endpoint anEndpoint) {
+ public void cacheClientEndpoint(Endpoint anEndpoint) {
clientEndpoint = anEndpoint;
}
/**
* Return true if this service is in the shutdown state
- *
+ * @return true if shutting down
*/
public boolean isStopped() {
return stopped;
@@ -1893,6 +1912,8 @@ public abstract class BaseAnalysisEngine
/**
* Stops input channel(s) and initiates a shutdown of all delegates ( if
this is an aggregate ).
* At the end sends an Exception to the client and closes an output channel.
+ *
+ * @param shutdownNow stop this service
*/
public void stop(boolean shutdownNow) {
this.stop(null, null,shutdownNow);
@@ -2007,7 +2028,7 @@ public abstract class BaseAnalysisEngine
if (inputChannelList != null) {
inputChannelList.clear();
}
- inputChannel = null;
+ //inputChannel = null;
if (serviceErrorMap != null) {
serviceErrorMap.clear();
@@ -2151,7 +2172,6 @@ public abstract class BaseAnalysisEngine
}
public void terminate(Throwable cause, String aCasReferenceId) {
-
if (stopLatch.getCount() > 0) {
if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO,
getClass().getName(), "terminate",
@@ -2299,7 +2319,7 @@ public abstract class BaseAnalysisEngine
/**
* Stops a listener on the main input channel
- *
+ * @param shutdownNow stop
*/
protected void stopInputChannel(boolean shutdownNow) {
InputChannel iC = getInputChannel(endpointName);
@@ -2409,7 +2429,9 @@ public abstract class BaseAnalysisEngine
/**
* Aggregates have more than one Listener channel. This method stops all
configured input channels
* this service is configured with.
+ * @param cmKey cas multiplier key
*
+ * @return AnalysisEngineController CM controller
*/
public AnalysisEngineController getCasMultiplierController(String cmKey) {
@@ -2431,9 +2453,9 @@ public abstract class BaseAnalysisEngine
public InputChannel getInputChannel(String anEndpointName) {
for (int i = 0; inputChannelList != null && i < inputChannelList.size();
i++) {
- InputChannel iC = (InputChannel) inputChannelList.get(i);
- if (iC.isListenerForDestination(anEndpointName)) {
- return (InputChannel) inputChannelList.get(i);
+ InputChannel iC = inputChannelList.get(i);
+ if (iC != null && iC.isListenerForDestination(anEndpointName)) {
+ return inputChannelList.get(i);
}
}
return null;
@@ -2536,8 +2558,16 @@ public abstract class BaseAnalysisEngine
((ControllerCallbackListener)
controllerListeners.get(i)).notifyOnInitializationFailure(
this, e);
} else if ( this.isTopLevelComponent() ) {
- ((ControllerCallbackListener) controllerListeners.get(i))
- .notifyOnInitializationSuccess(this);
+
+ InputChannel ic = getInputChannel();
+ try {
+ ic.createListenerForTargetedMessages();
+ ((ControllerCallbackListener) controllerListeners.get(i))
+ .notifyOnInitializationSuccess(this);
+ } catch( Exception ex) {
+ ((ControllerCallbackListener)
controllerListeners.get(i)).notifyOnInitializationFailure(
+ this, ex);
+ }
}
}
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Thu Dec 20 14:50:11 2018
@@ -750,8 +750,7 @@ public class PrimitiveAnalysisEngineCont
* @param aCasReferenceId
* - Id of an input CAS. The client wants to stop generation of
child CASes from this
* CAS.
- *
- * @return
+ * @param anEndpoint endpoint
*/
public void process(CAS aCAS, String aCasReferenceId, Endpoint anEndpoint) {
@@ -1200,10 +1199,29 @@ public class PrimitiveAnalysisEngineCont
}
} else {
try {
-
+ List<AnalysisEnginePerformanceMetrics> perfMetrics =
+ new
ArrayList<AnalysisEnginePerformanceMetrics>();
+ String aeName = getMetaData().getName();
+
CacheEntry entry =
getInProcessCache().getCacheEntryForCAS(aCasReferenceId);
- entry.addDelegateMetrics(getKey(), performanceList);
+ for( AnalysisEnginePerformanceMetrics m : performanceList ) {
+ // System.out.println("...............BEFORE:
Name:"+m.getName()+" UniqueName:"+m.getUniqueName()+" How
Many="+m.getNumProcessed());
+ boolean aggregate =
m.getUniqueName().startsWith("/"+aeName);
+ int pos = m.getUniqueName().indexOf("/",1);
+ String uName = m.getUniqueName();
+ if ( pos > -1 && aeInstancePool.size() > 1 &&
aeName != null && aggregate) {
+ String st =
m.getUniqueName().substring(pos);
+ uName = "/"+aeName+st;
+ }
+ AnalysisEnginePerformanceMetrics newMetrics =
+ new
AnalysisEnginePerformanceMetrics(m.getName(),uName,m.getAnalysisTime(),
m.getNumProcessed());
+ // System.out.println("... Metrics -
AE:"+metrics.getUniqueName()+" AE Analysis Time:"+metrics.getAnalysisTime());
+ perfMetrics.add(newMetrics);
+// System.out.println("...............AFTER:
Name:"+newMetrics.getName()+" UniqueName:"+newMetrics.getUniqueName()+" How
Many="+newMetrics.getNumProcessed());
+
+ }
+ entry.addDelegateMetrics(getKey(), perfMetrics); //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
@@ -1499,7 +1517,7 @@ public class PrimitiveAnalysisEngineCont
/**
* The HeapDumpTimer is optionally used to dump the heap if a task takes too
much time to finish.
- * It is enabled from the System property -DheapDumpThreshold=<x> where x is
a number of seconds
+ * It is enabled from the System property -DheapDumpThreshold=x where x is a
number of seconds
* the task is allowed to complete. If the task is not completed, the heap
dump will be created.
*
*
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/UimacppServiceController.java
Thu Dec 20 14:50:11 2018
@@ -135,7 +135,7 @@ public class UimacppServiceController ex
* @param envVarMap
* - enviroment variables to be set. These settings are valid only
for the new process in
* which C++ service will run.
- * @throws UIMAException
+ * @throws UIMAException error
*/
public UimacppServiceController(String aeDescriptorFileName, String
queueName, String brokerURL,
int numInstances, int prefetchSize, Map<String, String> envVarMap,
@@ -244,20 +244,21 @@ public class UimacppServiceController ex
* Communication via sockets is established between this Controller and the
C++ service through
* which logging, JMX and administrative messages are transmitted.
*
- * @param uimaLogger
- * @param aeDescriptorFileName
- * @param mqQueueName
- * @param mqHostName
- * @param mqPort
- * @param mqChannel
- * @param mqQueueMgr
- * @param numInstances
- * @param envVarMap
- * @param processCasErrorThreshhold
- * @param processCasErrorWindow
- * @param terminateOnCPCError
- * @param mBeanServer
- * @throws ResourceInitializationException
+ * @param uimaLogger logger
+ * @param aeDescriptorFileName descriptor
+ * @param queueName queue name
+ * @param mqHostName host name
+ * @param mqPort port
+ * @param mqChannel channel
+ * @param mqQueueMgr queue manager
+ * @param numInstances how many
+ * @param envVarMap environment
+ * @param processCasErrorThreshhold threshold
+ * @param processCasErrorWindow error threshold
+ * @param terminateOnCPCError termination
+ * @param jmxManagement JMX server
+ * @param initialFsHeapSize heap size
+ * @throws ResourceInitializationException error
*/
public UimacppServiceController(org.apache.uima.util.Logger uimaLogger,
String aeDescriptorFileName, String queueName, String mqHostName,
int mqPort,
@@ -636,10 +637,8 @@ public class UimacppServiceController ex
/**
* Shuts down the UIMA C++ service process.
*
- * @param force
- * - force or allow service to shutdown gracefully.
- * @throws IOException
- * @throws InterruptedException
+ * @throws IOException error
+ * @throws InterruptedException error
*/
public void shutdown() throws IOException, InterruptedException {
mbean.shutdown();
@@ -688,11 +687,7 @@ public class UimacppServiceController ex
}
}
- /**
- * test
- *
- * @param args
- */
+
public static void main(String[] args) {
HashMap<String, String> envVarMap = new HashMap<String, String>();
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/ControllerDelegate.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/ControllerDelegate.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/ControllerDelegate.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/ControllerDelegate.java
Thu Dec 20 14:50:11 2018
@@ -31,7 +31,8 @@ public class ControllerDelegate extends
/**
* Initializes this instance with a unique delegate key
*
- * @param aDelegateKey
+ * @param aDelegateKey delegate key
+ * @param aController controller
*/
public ControllerDelegate(String aDelegateKey, AnalysisEngineController
aController) {
super.delegateKey = aDelegateKey;
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/Delegate.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/Delegate.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/Delegate.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/delegate/Delegate.java
Thu Dec 20 14:50:11 2018
@@ -122,14 +122,14 @@ public abstract class Delegate {
/**
* Returns delegate key
*
- * @return
+ * @return key
*/
public String getKey() {
return delegateKey;
}
/**
- * Sets an {@link Endpoint} object
+ * Sets an { Endpoint} object
*
* @param anEndpoint
* - an endpoint object
@@ -139,9 +139,9 @@ public abstract class Delegate {
}
/**
- * Returns an {@link Endpoint} object
+ * Returns an { Endpoint} object
*
- * @return
+ * @return endpoint
*/
public Endpoint getEndpoint() {
return endpoint;
@@ -181,7 +181,7 @@ public abstract class Delegate {
/**
* Restarts timer for a given CAS
*
- * @param entry
+ * @param entry delegate meta
*/
private void restartTimerForCas(DelegateEntry entry) {
if (getCasProcessTimeout() > 0) {
@@ -248,11 +248,12 @@ public abstract class Delegate {
/**
* Adds a given Cas ID to the list of CASes pending reply. A new timer will
be started to handle
* delegate's timeout if either: 1) the list of CASes pending reply is empty
AND delegate timeout
- * > 0 2) the list already contains the CAS ID AND delegate timeout > 0.
This is a retry logic.
+ * greater 0 2) the list already contains the CAS ID AND delegate timeout
greater 0. This is a retry logic.
*
* @param aCasReferenceId
* - CAS ID to add to pending list if not already there
- *
+ * @param casHashcode hashcode
+ * @param useTimerThreadPerCAS yes or no
*/
public void addCasToOutstandingList(String aCasReferenceId, int casHashcode,
boolean useTimerThreadPerCAS) {
synchronized (outstandingCasList) {
@@ -320,6 +321,9 @@ public abstract class Delegate {
*
* @param aCasReferenceId
* - CAS ID to add to the delayed list
+ * @param casHashCode hash code
+ * @param useTimerThreadPerCAS yn
+ * @return how many pending in dispatch list
*/
public int addCasToPendingDispatchList(String aCasReferenceId, long
casHashCode, boolean useTimerThreadPerCAS) {
synchronized (pendingDispatchList) {
@@ -405,7 +409,7 @@ public abstract class Delegate {
/**
* Increments retry count
*
- * @param aCasReferenceId
+ * @param aCasReferenceId cas id
*/
public void incrementRetryCount(String aCasReferenceId) {
synchronized (outstandingCasList) {
@@ -427,11 +431,12 @@ public abstract class Delegate {
}
/**
- * Returns {@link DelegateEntry} instance that matches given CAS ID pending
reply.
+ * Returns {DelegateEntry} instance that matches given CAS ID pending reply.
*
* @param aCasReferenceId
* - unique id of a CAS to be searched for
- * @return
+ * @param delegate list
+ * @return delegate meta info
*/
private DelegateEntry lookupEntry(String aCasReferenceId,
List<DelegateEntry> list) {
for (DelegateEntry entry : list) {
@@ -450,6 +455,7 @@ public abstract class Delegate {
* delegate one at a time.
*
* @return - ID of the oldest CAS in the list
+ * @return oldest entry
*/
public String removeOldestFromPendingDispatchList() {
synchronized (pendingDispatchList) {
@@ -478,7 +484,9 @@ public abstract class Delegate {
* OR the PING times out, all CASes are delayed. When the PING is acked by
the delegate ALL
* delayed CASes are sent to the delegate one at a time.
*
- * @return - ID of the oldest CAS in the list
+ * @param aCasReferenceId id
+ * @return true if removed false otherwise
+ *
*/
public boolean removeCasFromPendingDispatchList(String aCasReferenceId) {
synchronized (pendingDispatchList) {
@@ -502,12 +510,14 @@ public abstract class Delegate {
}
/**
- * Removes {@link DelegateEntry} from the list of CASes pending reply. The
entry is removed when
+ * Removes {DelegateEntry} from the list of CASes pending reply. The entry
is removed when
* either: 1) reply is received from the delegate before the timeout 2) the
timeout occurs with no
* retry 3) an error occurs and the CAS is dropped as part of Error Handling
*
* @param aCasReferenceId
* - id of the CAS to remove from the list
+ *
+ * @return true on success false otherwise
*/
public boolean removeCasFromOutstandingList(String aCasReferenceId) {
synchronized (outstandingCasList) {
@@ -525,6 +535,8 @@ public abstract class Delegate {
*
* @param aCasReferenceId
* - id of a CAS to find in an outstandingCasList
+ *
+ * @return true if pending false otherwise
*/
public boolean isCasPendingReply(String aCasReferenceId) {
synchronized (outstandingCasList) {
@@ -537,12 +549,11 @@ public abstract class Delegate {
}
/**
- * Removes {@link DelegateEntry} from the list of CASes pending reply. The
entry is removed when
+ * Removes { DelegateEntry} from the list of CASes pending reply. The entry
is removed when
* either: 1) reply is received from the delegate before the timeout 2) the
timeout occurs with no
* retry 3) an error occurs and the CAS is dropped as part of Error Handling
*
- * @param aCasReferenceId
- * - id of the CAS to remove from the list
+ * @return id of the CAS to remove from the list
*/
public String removeOldestCasFromOutstandingList() {
synchronized (outstandingCasList) {
@@ -558,12 +569,12 @@ public abstract class Delegate {
}
/**
- * Removes {@link DelegateEntry} from the list of CASes pending reply. If
the CAS removed was the
+ * Removes {DelegateEntry} from the list of CASes pending reply. If the CAS
removed was the
* oldest in the list (first in the list) AND there are other CASes in the
list pending reply AND
* the delegate timeout is configured ( timeout > 0) , restart the timer for
the next oldest CAS
* in the list.
*
- * @param aDelegateEntry
+ * @param aDelegateEntry delegate
*/
private void removeCasFromOutstandingList(DelegateEntry aDelegateEntry) {
// Before removing the entry check if this is the oldest in the list. This
will be
@@ -701,6 +712,8 @@ public abstract class Delegate {
}
/**
* Starts GetMeta Request timer
+ *
+ * @param casReferenceId cas id
*/
public void startGetMetaRequestTimer(String casReferenceId) {
startDelegateGetMetaTimer(casReferenceId, AsynchAEMessage.GetMeta);
@@ -709,10 +722,8 @@ public abstract class Delegate {
/**
* Starts a timer for a given command
*
- * @param aCasReferenceId
- * - id of a CAS if command = Process, null otherwise
- * @param aCommand
- * - command for which the timer is started
+ * @param delegateEntry delegate Object
+ *
*/
// private void startDelegateTimer(final String aCasReferenceId, final int
aCommand) {
private void startDelegateTimer(final DelegateEntry delegateEntry) {
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/CpcErrorHandler.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/CpcErrorHandler.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/CpcErrorHandler.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/CpcErrorHandler.java
Thu Dec 20 14:50:11 2018
@@ -117,9 +117,7 @@ public class CpcErrorHandler extends Err
return true;
}
- /**
- * @param args
- */
+
public static void main(String[] args) {
// TODO Auto-generated method stub
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/GetMetaErrorHandler.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/GetMetaErrorHandler.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/GetMetaErrorHandler.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/error/handler/GetMetaErrorHandler.java
Thu Dec 20 14:50:11 2018
@@ -123,9 +123,7 @@ public class GetMetaErrorHandler extends
return true;
}
- /**
- * @param args
- */
+
public static void main(String[] args) {
// TODO Auto-generated method stub
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfo.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfo.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfo.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/AggregateServiceInfo.java
Thu Dec 20 14:50:11 2018
@@ -24,10 +24,7 @@ import org.apache.uima.aae.controller.An
public class AggregateServiceInfo extends ServiceInfo implements
AggregateServiceInfoMBean {
private static final long serialVersionUID = 6076764724935117459L;
- /**
- *
- */
-
+
public AggregateServiceInfo(AnalysisEngineController controller) {
super(false, controller);
}
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManagement.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManagement.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManagement.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManagement.java
Thu Dec 20 14:50:11 2018
@@ -35,28 +35,28 @@ public interface JmxManagement {
*
* @param anInitMap
* - properties required during initialization
- * @throws Exception
+ * @throws Exception error
*/
public void initialize(Map anInitMap) throws Exception;
/**
* Returns instance of an MBeanServer
*
- * @return
+ * @return MBeanServer the server
*/
public MBeanServer getMBeanServer();
/**
* Returns configured Jmx Domain
*
- * @return
+ * @return jmx Domain
*/
public String getJmxDomain();
/**
* Sets the Jmx Domain
*
- * @param aJmxDomain
+ * @param aJmxDomain domain
*/
public void setJmxDomain(String aJmxDomain);
@@ -67,21 +67,21 @@ public interface JmxManagement {
* - instance of MBean to register
* @param anMBeanName
* - name of the MBean
- * @throws Exception
+ * @throws Exception error
*/
public void registerMBean(Object anMBean, ObjectName anMBeanName) throws
Exception;
/**
* Removed an MBean from the MBeanServer registry
*
- * @param anMBeanName
+ * @param anMBeanName mbean name
*/
public void unregisterMBean(ObjectName anMBeanName);
/**
* Performs cleanup when object goes out of scope
*
- * @throws Exception
+ * @throws Exception error
*/
public void destroy() throws Exception;
Modified:
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManager.java
URL:
http://svn.apache.org/viewvc/uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManager.java?rev=1849401&r1=1849400&r2=1849401&view=diff
==============================================================================
---
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManager.java
(original)
+++
uima/uv3/uima-as-v3/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/jmx/JmxManager.java
Thu Dec 20 14:50:11 2018
@@ -47,7 +47,7 @@ public class JmxManager implements JmxMa
/**
* Removes all objects from the MBeanServer with t
*
- * @param aDomain
+ * @param aDomain domain
*/
public void unregisterDomainObjects(String aDomain) {
// use class level locking to make sure one thread at time executes the
code