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/05/14 22:39:01 UTC

svn commit: r656421 - in /incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima: adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java examples/as/RunRemoteAsyncAE.java

Author: eae
Date: Wed May 14 13:39:01 2008
New Revision: 656421

URL: http://svn.apache.org/viewvc?rev=656421&view=rev
Log:
UIMA-1031 Add casPool and fsHeapSize arguments to RunRemoteAsyncAE; Freeze replyWindow=0.

Modified:
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/examples/as/RunRemoteAsyncAE.java

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java?rev=656421&r1=656420&r2=656421&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngine_impl.java Wed May 14 13:39:01 2008
@@ -385,11 +385,11 @@
 		clientSideJmxStats.setEndpointName(endpoint);
 		int casPoolSize = 1;
 
-		if (anApplicationContext.containsKey(UimaAsynchronousEngine.ReplyWindow))
-		{
-			receiveWindow = ((Integer) anApplicationContext.get(UimaAsynchronousEngine.ReplyWindow)).intValue();
-			clientSideJmxStats.setReplyWindowSize(receiveWindow);
-		}
+//		if (anApplicationContext.containsKey(UimaAsynchronousEngine.ReplyWindow))
+//		{
+//			receiveWindow = ((Integer) anApplicationContext.get(UimaAsynchronousEngine.ReplyWindow)).intValue();
+//			clientSideJmxStats.setReplyWindowSize(receiveWindow);
+//		}
 
 		if (anApplicationContext.containsKey(UimaAsynchronousEngine.CasPoolSize))
 		{

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/examples/as/RunRemoteAsyncAE.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/examples/as/RunRemoteAsyncAE.java?rev=656421&r1=656420&r2=656421&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/examples/as/RunRemoteAsyncAE.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-activemq/src/main/java/org/apache/uima/examples/as/RunRemoteAsyncAE.java Wed May 14 13:39:01 2008
@@ -64,17 +64,12 @@
 /**
  * Example application that calls a Remote Asynchronous Analysis Engine on a collection.
  * <p>
- * Arguments: brokerUrl endpoint [-uimaEeDebug true] [-d deploymentDescriptorFile] [-c CollectionReaderDescriptorFile] [-w ReplyWindow] [-o OutputDir] 
+ * Arguments: brokerUrl endpoint [options] 
  *     [-t Timeout] [-i]
  * <p>
  * This connects to a remote AE at specified brokerUrl and endpoint (which must match what is in the
  * service's deployment descriptor. The following optional arguments are accepted:
  * <ul>
- * <li>-uimaEeDebug true causes various debugging things to happen, including *not* deleting the
- * generated spring file generated by running dd-2-spring.  This parameter only affects deployments 
- * specified using the -d parameter that follow
- * it in the command line sequence.</li>
-
  * <li>-d Specifies a deployment descriptor. The specified service will be deployed before processing
  * begin, and the service will be undeployed after processing completes. 
  * Multiple -d entries can be given.</li>
@@ -82,14 +77,18 @@
  * CollectionReader and send them to the service for processing. If this option is ommitted, one
  * empty CAS will be sent to the service (useful for services containing a CAS Multiplier acting as
  * a collection reader).</li>
- * <li>-w Specifies a "ReplyWindow", which is the maximum number of outstanding requests that the
- * client will send. This is only meaningful if the -c option is also used.</li>
+ * <li>-p  Specifies CAS pool size, which determines the maximum number of requests that can be outstanding.</li>
+ * <li>-f  Specifies the initial FS heap size in bytes of each CAS in the pool.</li>
  * <li>-o Specifies an Output Directory. All CASes received by the client's CallbackListener will
  * be serialized to XMI in the specified OutputDir. If ommitted, no XMI files will be output.</li>
  * <li>-t Specifies a timeout period in seconds.  If a CAS does not return within this time period it
  * is considered an error.  By default there is no timeout, so the client will wait forever.</li>
  * <li>-i Causes the client to ignore errors returned from the service.  If not specified, the client
  * terminates on the first error.</li>
+ * <li>-uimaEeDebug true causes various debugging things to happen, including *not* deleting the
+ * generated spring file generated by running dd-2-spring.  This parameter only affects deployments 
+ * specified using the -d parameter that follow
+ * it in the command line sequence.</li>
  * </ul>
  */
 public class RunRemoteAsyncAE {
@@ -99,7 +98,9 @@
 
   private File collectionReaderDescriptor = null;
 
-  private int replyWindow = 0;
+  private int casPoolSize = 2;
+
+  private int fsHeapSize = 2000000;
 
   private File outputDir = null;
   
@@ -147,8 +148,10 @@
               System.err.println("Collection Reader Descriptor file " + collectionReaderDescriptor.getPath() + " does not exist.");
               printUsageAndExit();
             }
-          } else if (args[i].equals("-w")) {
-            replyWindow = Integer.parseInt(args[++i]);
+          } else if (args[i].equals("-p")) {
+            casPoolSize = Integer.parseInt(args[++i]);
+          } else if (args[i].equals("-f")) {
+            fsHeapSize = Integer.parseInt(args[++i]);
           } else if (args[i].equals("-o")) {
             outputDir = new File(args[++i]);
             if (outputDir.exists()) {
@@ -230,17 +233,9 @@
     appCtx.put(UimaAsynchronousEngine.GetMetaTimeout, getmeta_timeout * 1000);
     appCtx.put(UimaAsynchronousEngine.CpcTimeout, cpc_timeout * 1000);
 
-    // Add the Cas Pool Size (2 should be the most that's ever needed, one
-    // for the request and one for the response)
-    appCtx.put(UimaAsynchronousEngine.CasPoolSize, 2);
-    
-    if (replyWindow > 0) {
-      // Allow so many outstanding CASes. This is used to gate how many CASes
-      // are sent to a service queue. When the max number of CASes in sent
-      // and no reply is received, the code will not send any more and will
-      // block the client.
-      appCtx.put(UimaAsynchronousEngine.ReplyWindow, replyWindow);
-    }
+    // Add the Cas Pool Size and initial FS heap size
+    appCtx.put(UimaAsynchronousEngine.CasPoolSize, casPoolSize);
+    appCtx.put(UIMAFramework.CAS_INITIAL_HEAP_SIZE, new Integer(fsHeapSize/4).toString());
 
     //initialize
     uimaEEEngine.initialize(appCtx);
@@ -264,16 +259,16 @@
    */
   private static void printUsageAndExit() {
     System.out.println(
-      "Usage: runRemoteAsyncAE brokerUrl endpoint [-c CollectionReaderDescriptorFile] [-w ReplyWindow] [-o OutputDir] [-t Timeout] [-p CasPoolSize] [-i]\n\n" +
+      "Usage: runRemoteAsyncAE brokerUrl endpoint [options]\n\n" +
       "This connects to a remote AE at specified brokerUrl and endpoint (which must match what is in the service's\n" +
-      "deployment descriptor.  The following optional arguments are accepted:\n\n" +
+      "deployment descriptor.\n\nThe following optional arguments are accepted:\n" +
       "-d  Specifies a deployment descriptor. The specified service will be deployed before processing begins." +
       " Multiple -d entries can be given.\n" +
       "-c  Specifies a CollectionReader descriptor.  The client will read CASes from the CollectionReader" +
       " and send them to the service for processing.  If this option is ommitted, one empty CAS will be" +
       " sent to the service (useful for services containing a CAS Multiplier acting as a collection reader).\n" +
-      "-w  Specifies a \"ReplyWindow\", which is the maximum number of outstanding requests that the client will send." +
-      " This is only meaningful if the -c option is also used.\n" +
+      "-p  Specifies CAS pool size, which determines the maximum number of requests that can be outstanding.\n" +
+      "-f  Specifies the initial FS heap size in bytes of each CAS in the pool.\n" +
       "-o  Specifies an Output Directory.  All CASes received by the client's CallbackListener will be serialized to XMI" +
       " in the specified OutputDir.  If ommitted, no XMI files will be output.\n" +
       "-t  Specifies a timeout period in seconds.  If a CAS does not return within this time period it" +