svn commit: r951508 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
Author: cwiklik Date: Fri Jun 4 17:53:54 2010 New Revision: 951508 URL: http://svn.apache.org/viewvc?rev=951508&view=rev Log: UIMA-1801 Removed Code that was sending useless STOP message to each of the colocated delegates Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java?rev=951508&r1=951507&r2=951508&view=diff == --- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java (original) +++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java Fri Jun 4 17:53:54 2010 @@ -1664,10 +1664,6 @@ public abstract class BaseAnalysisEngine for (Entry entry : set) { UimaTransport transport = entry.getValue(); try { - - UimaMessage message = transport.produceMessage(AsynchAEMessage.Stop, - AsynchAEMessage.Request, getName()); - transport.getUimaMessageDispatcher(entry.getKey()).dispatch(message); transport.stopIt(); System.out.println("Service:" + getComponentName() + " Stopped Delegate Transport:" + entry.getKey());
svn commit: r951473 - in /uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet: ResultMerger.java SimpleServerServlet.java
Author: schor Date: Fri Jun 4 16:13:21 2010 New Revision: 951473 URL: http://svn.apache.org/viewvc?rev=951473&view=rev Log: [UIMA-1795] remove csv option from help text - not supported Modified: uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/ResultMerger.java uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java Modified: uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/ResultMerger.java URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/ResultMerger.java?rev=951473&r1=951472&r2=951473&view=diff == --- uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/ResultMerger.java (original) +++ uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/ResultMerger.java Fri Jun 4 16:13:21 2010 @@ -94,12 +94,15 @@ public class ResultMerger extends Simple + "text - the value of this parameter is the text to analyze. Expected " + "encoding is UTF-8. This parameter must always be set." + "mode - the value of this parameter is either " -+ ""xml", "inline" or "csv". " ++ ""xml" or "inline"." +//+ " or "csv". " // Jira 1795 + "This parameter allows you to define, which view of the result should be returned. " -+ ""xml" means to output the result as a XML-document containing a list of found entities, " ++ ""xml" means to output the result as a XML-document containing a list of found entities, and" + ""inline" returns inline-xml containing the analyzed text in which all found entities are" -+ " represented by tags, and "csv" returns the found entities" -+ " in a comma-separated list. If this parameter is not set, xml output will be produced." ++ " represented by tags." +//+ ", and "csv" returns the found entities" //Jira 1795 +//+ " in a comma-separated list. " ++ "If this parameter is not set, xml output will be produced." + "" + "url1, url2, url3, etc. - the values of these parameters are the " + "URLs of other simple UIMA services which are to be invoked." Modified: uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java?rev=951473&r1=951472&r2=951473&view=diff == --- uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java (original) +++ uima/sandbox/trunk/SimpleServer/src/main/java/org/apache/uima/simpleserver/servlet/SimpleServerServlet.java Fri Jun 4 16:13:21 2010 @@ -120,7 +120,7 @@ public class SimpleServerServlet extends + "containing a list of found entities"); options.put("inline", "returns inline-xml containing the analyzed " + "text in which all found entities are represented by tags"); -options.put("csv", "returns the found entities in a comma-separated list"); +//options.put("csv", "returns the found entities in a comma-separated list"); // Jira 1795 this.servletPOSTParamOptions.put(MODE_PARAMETER, options); this.servletPOSTParameters.put("lang", "This parameter sets the language "
svn commit: r951437 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java
Author: cwiklik Date: Fri Jun 4 15:06:40 2010 New Revision: 951437 URL: http://svn.apache.org/viewvc?rev=951437&view=rev Log: UIMA-1799 added thread id and thread name to a log msg to help with debugging Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java?rev=951437&r1=951436&r2=951437&view=diff == --- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java (original) +++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java Fri Jun 4 15:06:40 2010 @@ -204,7 +204,7 @@ public class ProcessResponseHandler exte UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(), "handleProcessResponseFromRemote", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_number_parallel_delegates_FINE", -new Object[] { totalNumberOfParallelDelegatesProcessingCas }); +new Object[] { totalNumberOfParallelDelegatesProcessingCas, Thread.currentThread().getId(), Thread.currentThread().getName() }); } if (cas == null) { throw new AsynchAEException(Thread.currentThread().getName()
svn commit: r951434 - /uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java
Author: cwiklik Date: Fri Jun 4 15:04:51 2010 New Revision: 951434 URL: http://svn.apache.org/viewvc?rev=951434&view=rev Log: UIMA-1799 Modified to support prefetch override on a reply queue. The prefetch value equals number of consumers defined on a reply queue in the DD Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java?rev=951434&r1=951433&r2=951434&view=diff == --- uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java (original) +++ uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/UimaDefaultMessageListenerContainer.java Fri Jun 4 15:04:51 2010 @@ -565,6 +565,14 @@ public class UimaDefaultMessageListenerC */ public void afterPropertiesSet() { if (endpoint != null) { + + // Override the prefetch size. The dd2spring always sets this to 1 which + // may effect the throughput of a service. Change the prefetch size to + // number of consumer threads defined in DD. + if ( cc > 1 && endpoint.isTempReplyDestination() && connectionFactory instanceof ActiveMQConnectionFactory ) { + ((ActiveMQConnectionFactory)connectionFactory).getPrefetchPolicy().setQueuePrefetch(cc); + } + // Endpoint has been plugged in from spring xml. This means this is a listener // for a reply queue. We need to rewire things a bit. First make Spring use // one thread to make sure we receive messages in order. To fix a race condition @@ -579,7 +587,7 @@ public class UimaDefaultMessageListenerC super.setConcurrentConsumers(1); if (cc > 1) { try { - concurrentListener = new ConcurrentMessageListener(cc, ml); + concurrentListener = new ConcurrentMessageListener(cc, ml, getDestinationName()); super.setMessageListener(concurrentListener); } catch (Exception e) { if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) { @@ -770,7 +778,17 @@ public class UimaDefaultMessageListenerC super.setDestination(aDestination); if (endpoint != null) { endpoint.setDestination(aDestination); - if (aDestination instanceof TemporaryQueue) { + // Get the prefetch size. If > 1, it has been previously overriden. The override is done in + // the code since dd2spring alwys sets the prefetch on a reply queue to 1. This may slow down + // a throughput of a service. + int prefetchSize = ((ActiveMQConnectionFactory)connectionFactory).getPrefetchPolicy().getQueuePrefetch(); + if (aDestination instanceof TemporaryQueue && prefetchSize > 1) { +if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) { + UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(), +"setDestination", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, +"UIMAJMS_replyq_prefetch_override__INFO", new Object[] {aDestination,prefetchSize + }); +} endpoint.setTempReplyDestination(true); Object pojoListener = getPojoListener(); if (pojoListener != null && pojoListener instanceof InputChannel) {
svn commit: r951432 - /uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties
Author: cwiklik Date: Fri Jun 4 15:03:17 2010 New Revision: 951432 URL: http://svn.apache.org/viewvc?rev=951432&view=rev Log: UIMA-1799 Added new msg to show prefetch override Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties Modified: uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties?rev=951432&r1=951431&r2=951432&view=diff == --- uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties (original) +++ uima/uima-as/trunk/uimaj-as-jms/src/main/resources/jms_adapter_messages.properties Fri Jun 4 15:03:17 2010 @@ -188,4 +188,5 @@ UIMAJMS_client_connection_closed__INFO = UIMAJMS_client_shared_connection_not_closed__INFO = UIMA AS Client Terminated. Shared Connection Still Open. Current Client Count:{0} UIMAJMS_dropping_msg_client_is_dead__INFO = UIMA AS Service:{0} Received A Request Message From a Client Known To Be Dead. Its Reply Queue: {1} Was Deleted. Ignoring Request To Process CAS Id: {2} UIMAJMS_replyq__CONFIG = Remote Delegate {0} Reply Queue: {1} Reply Listener Configured With {2} Concurrent Consumer(s) -UIMAJMS_broker_no_jmx__INFO = UIMA AS Service: {0} Broker Running With No JMX Support. Running With No Optimization To Check For Presence of Client's Reply Queue \ No newline at end of file +UIMAJMS_broker_no_jmx__INFO = UIMA AS Service: {0} Broker Running With No JMX Support. Running With No Optimization To Check For Presence of Client's Reply Queue +UIMAJMS_replyq_prefetch_override__INFO = Overriding Reply Queue:{0} Default Prefetch Setting. The New Setting is: {1} \ No newline at end of file
svn commit: r951427 - /uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ConcurrentMessageListener.java
Author: cwiklik Date: Fri Jun 4 14:47:30 2010 New Revision: 951427 URL: http://svn.apache.org/viewvc?rev=951427&view=rev Log: UIMA-1800 Modified to use UimaBlockingExecutor Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ConcurrentMessageListener.java Modified: uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ConcurrentMessageListener.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ConcurrentMessageListener.java?rev=951427&r1=951426&r2=951427&view=diff == --- uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ConcurrentMessageListener.java (original) +++ uima/uima-as/trunk/uimaj-as-activemq/src/main/java/org/apache/uima/adapter/jms/activemq/ConcurrentMessageListener.java Fri Jun 4 14:47:30 2010 @@ -31,6 +31,7 @@ import javax.jms.Session; import org.apache.uima.UIMAFramework; import org.apache.uima.aae.UIMAEE_Constants; +import org.apache.uima.aae.UimaBlockingExecutor; import org.apache.uima.aae.controller.AggregateAnalysisEngineController; import org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl; import org.apache.uima.aae.controller.AnalysisEngineController; @@ -76,9 +77,15 @@ public class ConcurrentMessageListener i private ThreadPoolExecutor executor = null; + private UimaBlockingExecutor blockingExecutor; + private LinkedBlockingQueue workQueue; private CountDownLatch controllerLatch = new CountDownLatch(1); + public ConcurrentMessageListener(int concurrentThreads, Object delegateListener ) + throws InvalidClassException { + this(concurrentThreads, delegateListener, null); + } /** * Creates a listener with a given number of process threads. This listener is injected between @@ -95,7 +102,7 @@ public class ConcurrentMessageListener i * - JmsInputChannel instance to delegate CAS to * @throws InvalidClassException */ - public ConcurrentMessageListener(int concurrentThreads, Object delegateListener) + public ConcurrentMessageListener(int concurrentThreads, Object delegateListener, String destination) throws InvalidClassException { if (!(delegateListener instanceof SessionAwareMessageListener)) { throw new InvalidClassException("Invalid Delegate Listener. Expected Object of Type:" @@ -104,17 +111,24 @@ public class ConcurrentMessageListener i concurrentThreadCount = concurrentThreads; this.delegateListener = (SessionAwareMessageListener) delegateListener; if (concurrentThreads > 1) { - workQueue = new LinkedBlockingQueue(concurrentThreadCount); + // created an unbounded queue. The throttling is controlled by the + // semaphore in the UimaBlockingExecutor initialized below + workQueue = new LinkedBlockingQueue(); executor = new ThreadPoolExecutor(concurrentThreads, concurrentThreads, Long.MAX_VALUE, TimeUnit.NANOSECONDS, workQueue); - executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); executor.prestartAllCoreThreads(); + if ( destination != null ) { +blockingExecutor = new UimaBlockingExecutor(executor, concurrentThreads, destination); + } else { +blockingExecutor = new UimaBlockingExecutor(executor, concurrentThreads); + } } } public void stop() { if (executor != null) { executor.shutdownNow(); + blockingExecutor.stop(); while (!executor.isTerminated()) { try { executor.awaitTermination(200, TimeUnit.MILLISECONDS); @@ -188,23 +202,29 @@ public class ConcurrentMessageListener i } if (concurrentThreadCount > 1) { // Delegate meesage to the JmsInputChannel - executor.execute(new Runnable() { -public void run() { - try { -delegateListener.onMessage(message, session); - } catch (Exception e) { -if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) { - UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(), - "onMessage", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, - "UIMAEE_service_exception_WARNING", controller.getComponentName()); - - UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, CLASS_NAME.getName(), - "onMessage", JmsConstants.JMS_LOG_RESOURCE_BUNDLE, - "UIMAJMS_exception__WARNING", e); + try { +blockingExecutor.submitTask(new Runnable() { + public void run() { +try { + delegateListener.onMessage(message, session); +} catch (Exception e) { + if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) { +
svn commit: r951426 - /uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties
Author: cwiklik Date: Fri Jun 4 14:45:00 2010 New Revision: 951426 URL: http://svn.apache.org/viewvc?rev=951426&view=rev Log: UIMA-1800 Added new msgs Modified: uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties Modified: uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties?rev=951426&r1=951425&r2=951426&view=diff == --- uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties (original) +++ uima/uima-as/trunk/uimaj-as-core/src/main/resources/uimaee_messages.properties Fri Jun 4 14:45:00 2010 @@ -78,7 +78,7 @@ UIMAEE_show_time_spent_in_delegate__FINE UIMAEE_show_time_spent_in_comms__FINE = Cas: {0} Spent: {1} ms In Comms. Delegate: {2} \UIMAEE_cancel_timer__FINE = Cancelling Timer For Delegate: {0} Cas: {1} UIMAEE_endpoint_not_found__INFO = Endpoint Object Not Found For Delegate: {0} Cas: {1} -UIMAEE_number_parallel_delegates_FINE = Number of Parallel Delegates: {0} +UIMAEE_number_parallel_delegates_FINE = Number of Parallel Delegates: {0} Thread ID:{1} Thread Name:{2} UIMAEE_rcvd_reply_FINEST = Received Reply From: {0} Cas: {1} XMI: {2} UIMAEE_delegate_responded_count_FINEST = Number Of Delegates Responded So Far: {0} Cas: {1} UIMAEE_high_water_mark_FINEST = Deserializing Cas Using High Water Mark: {0} Cas: {1} @@ -224,3 +224,4 @@ UIMAEE_dropping_msg_client_is_dead__INFO UIMAEE_incompatible_version_WARNING = Controller: {0} Unable to Initialize. UIMA-AS Version is Incompatible with UIMA Core. UIMA-AS Version: {1} UIMA Core Version: {2} UIMAEE_multiple_deployment_not_allowed__WARNING = Controller: {0} Multiple Deployment of AE: {1} Is Not Allowed. Change OperationalProperties in the AE descriptor or remove scalout parameter from the deployment descriptor UIMAEE_invalid_step__SEVERE = Controller: {0} Invalid Step Object: {1} For CAS:{2}. Terminating Service. Check Your Descriptor For Invalid AE Keys. +UIMAEE_dump_threadpool_semaphore_info__FINEST = Time: {0} Thread Id: {1} Acquiring Executor Semaphore. {2} Current Available Permits= {3} \ No newline at end of file
svn commit: r951425 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmMessageDispatcher.java
Author: cwiklik Date: Fri Jun 4 14:43:58 2010 New Revision: 951425 URL: http://svn.apache.org/viewvc?rev=951425&view=rev Log: UIMA-1800 Modified to use UimaBlockingExecutor Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmMessageDispatcher.java Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmMessageDispatcher.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmMessageDispatcher.java?rev=951425&r1=951424&r2=951425&view=diff == --- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmMessageDispatcher.java (original) +++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmMessageDispatcher.java Fri Jun 4 14:43:58 2010 @@ -23,6 +23,7 @@ import java.util.concurrent.ThreadPoolEx import org.apache.uima.UIMAFramework; import org.apache.uima.aae.UIMAEE_Constants; +import org.apache.uima.aae.UimaBlockingExecutor; import org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl; import org.apache.uima.aae.spi.transport.UimaMessage; import org.apache.uima.aae.spi.transport.UimaMessageDispatcher; @@ -39,16 +40,15 @@ import org.apache.uima.util.Level; public class UimaVmMessageDispatcher implements UimaMessageDispatcher { private static final Class CLASS_NAME = UimaVmMessageDispatcher.class; - private ThreadPoolExecutor executor = null; - + private UimaBlockingExecutor blockingExecutor; // Message listener which will receive a new message private final UimaMessageListener targetListener; private String delegateKey; - public UimaVmMessageDispatcher(ThreadPoolExecutor anExecutor, UimaMessageListener aListener, + public UimaVmMessageDispatcher(UimaBlockingExecutor anExecutor, UimaMessageListener aListener, String aKey) { -executor = anExecutor; +blockingExecutor = anExecutor; delegateKey = aKey; targetListener = aListener; } @@ -59,33 +59,37 @@ public class UimaVmMessageDispatcher imp * the Executor. */ public void dispatch(final UimaMessage message) { -if (executor.isShutdown() || executor.isTerminating() || executor.isShutdown()) { +if ( !blockingExecutor.isReady() ) { return; } -executor.execute(new Runnable() { - public void run() { - -try { - if (targetListener instanceof UimaVmMessageListener) { -((UimaVmMessageListener) targetListener).onMessage(message); - } else { -System.out.println("!!! Wrong Type of UimaListener"); - } -} catch (Exception e) { - if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) { -UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), -"run", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, -"UIMAEE_exception__WARNING", e); +try { + blockingExecutor.submitTask(new Runnable() { +public void run() { + try { +if (targetListener instanceof UimaVmMessageListener) { + ((UimaVmMessageListener) targetListener).onMessage(message); +} else { + System.out.println("!!! Wrong Type of UimaListener"); +} + } catch (Exception e) { +if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) { + UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), + "run", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, + "UIMAEE_exception__WARNING", e); +} } } - } -}); + }); +} catch( Exception e) { + UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), + "run", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, + "UIMAEE_exception__WARNING", e); +} } public void stop() { -if (executor != null) { - executor.purge(); - executor.shutdownNow(); +if (blockingExecutor != null) { + blockingExecutor.stop(); } } }
svn commit: r951424 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java
Author: cwiklik Date: Fri Jun 4 14:43:17 2010 New Revision: 951424 URL: http://svn.apache.org/viewvc?rev=951424&view=rev Log: UIMA-1800 Modified to use UimaBlockingExecutor Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java?rev=951424&r1=951423&r2=951424&view=diff == --- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java (original) +++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/VmTransport.java Fri Jun 4 14:43:17 2010 @@ -36,6 +36,7 @@ import org.apache.uima.aae.UIDGenerator; import org.apache.uima.aae.UIMAEE_Constants; import org.apache.uima.aae.UimaAsContext; import org.apache.uima.aae.UimaAsThreadFactory; +import org.apache.uima.aae.UimaBlockingExecutor; import org.apache.uima.aae.controller.AggregateAnalysisEngineController; import org.apache.uima.aae.controller.AnalysisEngineController; import org.apache.uima.aae.controller.BaseAnalysisEngineController; @@ -66,6 +67,8 @@ public class VmTransport implements Uima private ThreadPoolExecutor executor = null; + private UimaBlockingExecutor blockingExecutor; + private ThreadGroup threadGroup = null; // Create a queue for work items. The queue has a JMX wrapper to expose the @@ -120,7 +123,7 @@ public class VmTransport implements Uima } public void startIt() throws UimaSpiException { -dispatcher = new UimaVmMessageDispatcher(executor, null, (String) context.get("EndpointName")); +dispatcher = new UimaVmMessageDispatcher(blockingExecutor, null, (String) context.get("EndpointName")); } public synchronized void stopIt() throws UimaSpiException { @@ -130,7 +133,9 @@ public class VmTransport implements Uima stopping.set(true); executor.purge(); executor.shutdownNow(); + workQueue.clear(); +blockingExecutor.stop(); Set> set = dispatchers.entrySet(); for (Entry entry : set) { UimaVmMessageDispatcher dispatcher = entry.getValue(); @@ -172,10 +177,13 @@ public class VmTransport implements Uima } } - protected ThreadPoolExecutor getExecutorInstance() { + protected UimaBlockingExecutor getExecutorInstance() { if (executor == null) { int concurrentConsumerCount = context.getConcurrentConsumerCount(); - workQueue = new UimaVmQueue(concurrentConsumerCount); + + // Create an unbounded queue. + workQueue = new UimaVmQueue(); + // Create a ThreadPoolExecutor with as many threads as needed. The pool has // a fixed number of threads that never expire and are never passivated. executor = new ThreadPoolExecutor(concurrentConsumerCount, concurrentConsumerCount, @@ -185,10 +193,16 @@ public class VmTransport implements Uima (PrimitiveAnalysisEngineController) controller); executor.setThreadFactory(tf); } + executor.prestartAllCoreThreads(); + // instantiate a blocking executor with a maximum number of concurrent threads. + // Internally the executor uses a Semaphore bounded by a max number of permits to + // throttle requests. If number of requests exceeds number of available permits, + // the submitting thread hangs until a permit becomes available. + blockingExecutor = new UimaBlockingExecutor(executor, concurrentConsumerCount); controller.changeState(ServiceState.RUNNING); } -return executor; +return blockingExecutor; } public void registerWithJMX(AnalysisEngineController aController, String queueKind ) {
svn commit: r951422 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmQueue.java
Author: cwiklik Date: Fri Jun 4 14:41:07 2010 New Revision: 951422 URL: http://svn.apache.org/viewvc?rev=951422&view=rev Log: UIMA-1800 Modified to make the queue unbounded. The throttling is done by using BoundedExecutor Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmQueue.java Modified: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmQueue.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmQueue.java?rev=951422&r1=951421&r2=951422&view=diff == --- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmQueue.java (original) +++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/spi/transport/vm/UimaVmQueue.java Fri Jun 4 14:41:07 2010 @@ -38,8 +38,8 @@ public class UimaVmQueue extends LinkedB private long dequeueCount = 0; - public UimaVmQueue(int size) { -// super(size); + // This is an unbounded queue + public UimaVmQueue() { } /**
svn commit: r951418 - /uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaBlockingExecutor.java
Author: cwiklik Date: Fri Jun 4 14:37:19 2010 New Revision: 951418 URL: http://svn.apache.org/viewvc?rev=951418&view=rev Log: UIMA-1800 Blocks the submitter thread until a thread in a thread pool becomes available Added: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaBlockingExecutor.java Added: uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaBlockingExecutor.java URL: http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaBlockingExecutor.java?rev=951418&view=auto == --- uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaBlockingExecutor.java (added) +++ uima/uima-as/trunk/uimaj-as-core/src/main/java/org/apache/uima/aae/UimaBlockingExecutor.java Fri Jun 4 14:37:19 2010 @@ -0,0 +1,122 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.uima.aae; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.Semaphore; +import java.util.concurrent.ThreadPoolExecutor; + +import org.apache.uima.UIMAFramework; +import org.apache.uima.util.Level; + +/** + * A wrapper around ThreadPoolExecutor that blocks a thread if number of executing threads exceeds + * provided maximum number of permits. The implementation uses a semaphore that is initialized with + * a max number of permits. Each thread grabs a permit and executes. If all permits are exhausted, a + * thread blocks on a semaphore until a permit is available. + * + */ +public class UimaBlockingExecutor { + + private static final Class CLASS_NAME = UimaBlockingExecutor.class; + + private final ThreadPoolExecutor executor; + + private final Semaphore semaphore; + + private volatile boolean stopping = false; + + private String destination = null; + + public UimaBlockingExecutor(ThreadPoolExecutor executor, int permits) { +this(executor, permits, null); + } + + public UimaBlockingExecutor(ThreadPoolExecutor executor, int permits, String destination) { +this.executor = executor; +this.destination = destination; +this.semaphore = new Semaphore(permits); + } + + public boolean isReady() { +if (executor.isShutdown() || executor.isTerminating() || executor.isShutdown()) { + return false; +} +return true; + } + + public void stop() { +stopping = true; +semaphore.release(); // in case we are blocking on acquire +executor.purge(); +executor.shutdownNow(); + } + + public void submitTask(final Runnable task) throws InterruptedException, + RejectedExecutionException { +// Check if we are stopping. No need to continue if this is true +if (stopping) { + return; +} +SimpleDateFormat timeFormatter = new SimpleDateFormat("H:mm:ss:SSS"); +if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) { + String extraInfo = ""; // changed if destination != null + if (destination != null) { +extraInfo = " Executor Handling Messages from Destination:" + destination; + } + UIMAFramework.getLogger(CLASS_NAME).logrb( + Level.FINEST, + CLASS_NAME.getName(), + "submitTask", + UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, + "UIMAEE_dump_threadpool_semaphore_info__FINEST", + new Object[] { timeFormatter.format(new Date()), Thread.currentThread().getId(), + extraInfo, semaphore.availablePermits() }); +} +// Get a permit. If one is not available BLOCK! +semaphore.acquire(); +// Check if we are stopping. We may have waited for awhile above. +// No need to continue if this is true +if (stopping) { + return; +} +try { + executor.execute(new Runnable() { +public void run() { + try { +task.run(); + } finally { +semaphore.release(); + } +} + }); +} catch (RejectedExecutionException e) { + // This should really never happen since we control number of executing threads + // with a
svn commit: r951407 - /uima/build/trunk/parent-poms/
Author: schor Date: Fri Jun 4 13:37:04 2010 New Revision: 951407 URL: http://svn.apache.org/viewvc?rev=951407&view=rev Log: no Jira - add target to svnignore Modified: uima/build/trunk/parent-poms/ (props changed) Propchange: uima/build/trunk/parent-poms/ -- --- svn:ignore (original) +++ svn:ignore Fri Jun 4 13:37:04 2010 @@ -1,2 +1,3 @@ .project .settings +target
svn commit: r951406 - /uima/build/trunk/parent-poms/target/
Author: schor Date: Fri Jun 4 13:36:14 2010 New Revision: 951406 URL: http://svn.apache.org/viewvc?rev=951406&view=rev Log: no Jira - target should not be checked into svn Removed: uima/build/trunk/parent-poms/target/
svn commit: r951405 - /uima/build/trunk/parent-poms/parent-pom-top/pom.xml
Author: schor Date: Fri Jun 4 13:33:48 2010 New Revision: 951405 URL: http://svn.apache.org/viewvc?rev=951405&view=rev Log: no Jira - fix spelling of jira url Modified: uima/build/trunk/parent-poms/parent-pom-top/pom.xml Modified: uima/build/trunk/parent-poms/parent-pom-top/pom.xml URL: http://svn.apache.org/viewvc/uima/build/trunk/parent-poms/parent-pom-top/pom.xml?rev=951405&r1=951404&r2=951405&view=diff == --- uima/build/trunk/parent-poms/parent-pom-top/pom.xml (original) +++ uima/build/trunk/parent-poms/parent-pom-top/pom.xml Fri Jun 4 13:33:48 2010 @@ -133,7 +133,10 @@ Jira -http://issues.apache.org/jira/uima + + +https://issues.apache.org/jira/browse/UIMA +
svn commit: r951352 - in /uima/sandbox/trunk: AlchemyAPIAnnotator/src/docbook/AlchemyAPIAnnotatorUserGuide.xml ConfigurableFeatureExtractor/src/docbook/CFE_UG.xml Tagger/src/docbook/hmmTaggerUsersGuid
Author: tommaso Date: Fri Jun 4 10:27:30 2010 New Revision: 951352 URL: http://svn.apache.org/viewvc?rev=951352&view=rev Log: [UIMA-1051] - fixed code snippets parts with longer lines going out of the margin of the page, fixed larger images going out of the margin of the page Modified: uima/sandbox/trunk/AlchemyAPIAnnotator/src/docbook/AlchemyAPIAnnotatorUserGuide.xml uima/sandbox/trunk/ConfigurableFeatureExtractor/src/docbook/CFE_UG.xml uima/sandbox/trunk/Tagger/src/docbook/hmmTaggerUsersGuide.xml Modified: uima/sandbox/trunk/AlchemyAPIAnnotator/src/docbook/AlchemyAPIAnnotatorUserGuide.xml URL: http://svn.apache.org/viewvc/uima/sandbox/trunk/AlchemyAPIAnnotator/src/docbook/AlchemyAPIAnnotatorUserGuide.xml?rev=951352&r1=951351&r2=951352&view=diff == --- uima/sandbox/trunk/AlchemyAPIAnnotator/src/docbook/AlchemyAPIAnnotatorUserGuide.xml (original) +++ uima/sandbox/trunk/AlchemyAPIAnnotator/src/docbook/AlchemyAPIAnnotatorUserGuide.xml Fri Jun 4 10:27:30 2010 @@ -34,7 +34,7 @@ AlchemyAPI ( http://www.alchemyapi.com";>http://www.alchemyapi.com) services provided by - Orchestr8 ( http://www.orchestr8.net ). + Orchestr8 ( http://www.orchestr8.net";>http://www.orchestr8.net ). To use AlchemyAPI Annotator, choose which service you want to @@ -168,102 +168,296 @@ Afrikaans ISO-639-3: afr + + Albanian ISO-639-3: sqi + + Amharic ISO-639-3: amh + + Amuzgo Guerrero ISO-639-3: amu + + Arabic ISO-639-3: ara + + Armenian ISO-639-3: hye + + Azerbaijani ISO-639-3: aze + + Basque ISO-639-3: eus + + Breton ISO-639-3: bre + + Bulgarian ISO-639-3: bul + + Catalan ISO-639-3: cat + + Cebuano ISO-639-3: ceb + + Central K'iche' ISO-639-3: qut + + Central Mam ISO-639-3: mvc + + Chamorro ISO-639-3: cha + + Cherokee ISO-639-3: chr + + Chinese ISO-639-3: zho + + Comaltepec Chinantec ISO-639-3: cco + + Comaltepec Chinantec ISO-639-3: cco + + Croatian ISO-639-3: hrv + + Cubulco Achi' ISO-639-3: acc + + Czech ISO-639-3: ces + + Dakota ISO-639-3: dak + + Danish ISO-639-3: dan + + Dutch ISO-639-3: nld + + English ISO-639-3: eng + + Esperanto ISO-639-3: epo + + Estonian ISO-639-3: est + + Faroese ISO-639-3: fao + + Fijian ISO-639-3: fij + + Finnish ISO-639-3: fin + + French ISO-639-3: fra + + Fulfulde Adamawa ISO-639-3: fub + + Georgian ISO-639-3: kat + + German ISO-639-3: deu + + Greek ISO-639-3: ell + + Guerrero Nahuatl ISO-639-3: ngu + + Gujarti ISO-639-3: guj + + Haitian Creole ISO-639-3: hat + + Hausa ISO-639-3: hau + + Hawaiian ISO-639-3: haw + + Hebrew ISO-639-3: heb + + Hiligaynon ISO-639-3: hil + + Hindi ISO-639-3: hin + + Hungarian ISO-639-3: hun + + Icelandic ISO-639-3: isl + + Indonesian ISO-639-3: ind + + Irish ISO-639-3: gle + + Italian ISO-639-3: ita + + Jacalteco ISO-639-3: jac + + Japanese ISO-639-3: jpn + + Kabyle ISO-639-3: kab + + Kaqchikel ISO-639-3: cak + + Kirghiz ISO-639-3: kir + + Kisongye ISO-639-3: sop + + Korean ISO-639-3: kor + + Latin ISO-639-3: lat + + Latvian ISO-639-3: lav +
svn commit: r951351 - /uima/uimaj/trunk/PearPackagingMavenPlugin/src/docbook/PearPackagingMavenPluginUserGuide.xml
Author: tommaso Date: Fri Jun 4 10:24:34 2010 New Revision: 951351 URL: http://svn.apache.org/viewvc?rev=951351&view=rev Log: [UIMA-1051] - fixed code snippets parts with longer lines going out of the margin of the page Modified: uima/uimaj/trunk/PearPackagingMavenPlugin/src/docbook/PearPackagingMavenPluginUserGuide.xml Modified: uima/uimaj/trunk/PearPackagingMavenPlugin/src/docbook/PearPackagingMavenPluginUserGuide.xml URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/PearPackagingMavenPlugin/src/docbook/PearPackagingMavenPluginUserGuide.xml?rev=951351&r1=951350&r2=951351&view=diff == --- uima/uimaj/trunk/PearPackagingMavenPlugin/src/docbook/PearPackagingMavenPluginUserGuide.xml (original) +++ uima/uimaj/trunk/PearPackagingMavenPlugin/src/docbook/PearPackagingMavenPluginUserGuide.xml Fri Jun 4 10:24:34 2010 @@ -62,20 +62,22 @@ org.apache.uima PearPackagingMavenPlugin - + - + true -package - - +package + + - + $main_root/lib-alternative/sample.jar @@ -271,7 +273,8 @@ clean - +