Package org.apache.uima.aae.controller
Class BaseAnalysisEngineController
- java.lang.Object
-
- org.apache.uima.resource.Resource_ImplBase
-
- org.apache.uima.aae.controller.BaseAnalysisEngineController
-
- All Implemented Interfaces:
AnalysisEngineController,ControllerLifecycle,EventSubscriber,org.apache.uima.resource.Resource
- Direct Known Subclasses:
AggregateAnalysisEngineController_impl,PrimitiveAnalysisEngineController_impl
public abstract class BaseAnalysisEngineController extends org.apache.uima.resource.Resource_ImplBase implements AnalysisEngineController, EventSubscriber
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBaseAnalysisEngineController.ServiceState
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String>abortedCasesMapprotected java.lang.StringaeDescriptorprotected booleanallDelegatesAreRemoteprotected booleanawaitingCacheCallbackNotificationprotected java.lang.ObjectcallbackMonitorprotected booleancallbackReceivedprotected EndpointclientEndpointprotected java.util.concurrent.ConcurrentHashMapcmOutstandingCASesprotected intcomponentCasPoolSizeprotected java.util.ListcontrollerListenersprotected BaseAnalysisEngineController.ServiceStatecurrentStateprotected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String>deadClientDestinationMapprotected java.lang.StringdelegateKeyprotected java.util.List<Delegate>delegatesprotected longerrorCountprotected ErrorHandlerChainerrorHandlerChainprotected java.lang.ObjectfinalStepMuxprotected longidleTimeprotected InputChannelinputChannelprotected java.util.ListinputChannelListprotected java.util.concurrent.ConcurrentHashMapinputChannelMapprotected java.lang.StringjmxContextprotected ControllerLatchlatchprotected LocalCachelocalCacheprotected java.util.concurrent.ConcurrentHashMap<java.lang.String,UimaMessageListener>messageListenersprotected Monitormonitorstatic booleanNO_RECOVERYprotected java.util.HashMapparamsMapprotected AnalysisEngineControllerparentControllerprotected java.util.concurrent.ConcurrentHashMapperCasStatisticsprotected java.lang.StringprocessPidprotected longreplyTimeprotected org.apache.uima.resource.ResourceSpecifierresourceSpecifierprotected java.util.concurrent.ConcurrentHashMapserviceErrorMapprotected ServiceErrorsserviceErrorsprotected booleanserviceInitializedprotected ServicePerformanceservicePerformanceprotected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Long>statsMapprotected booleanstoppedprotected java.lang.ObjectsyncObjectprotected java.util.concurrent.ConcurrentHashMap<java.lang.String,UimaTransport>transportsprotected java.util.ListunregisteredDelegateList-
Fields inherited from interface org.apache.uima.aae.controller.AnalysisEngineController
AEInstanceCount, CasPoolSize
-
-
Constructor Summary
Constructors Constructor Description BaseAnalysisEngineController()BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, long anInitialCasHeapSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, java.util.Map aDestinationMap, JmxManagement aJmxManagement)BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache)BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, java.util.Map aDestinationMap)BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, java.util.Map aDestinationMap, JmxManagement aJmxManagement)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleanabortGeneratingCASes(java.lang.String aCasReferenceId)Returns true if a given CAS id is in the list of aborted CASes.voidaddAbortedCasReferenceId(java.lang.String aCasReferenceId)voidaddControllerCallbackListener(ControllerCallbackListener aListener)Register one or more listeners through which the controller can send notification of events.voidaddInputChannel(InputChannel anInputChannel)voidaddServiceInfo(ServiceInfo aServiceInfo)voidbeginProcess(int msgType)voidcacheClientEndpoint(Endpoint anEndpoint)voidchangeState(BaseAnalysisEngineController.ServiceState state)protected voidcleanUp()protected voidclearStats()Clears controller statistics.voiddropCAS(java.lang.String aCasReferenceId, boolean deleteCacheEntry)voiddropCAS(org.apache.uima.cas.CAS aCAS)protected voiddropCasStatistics(java.lang.String aCasReferenceId)voiddropStats(java.lang.String aCasReferenceId, java.lang.String anEndpointName)Removes statistics from the global Mapabstract voiddumpState(java.lang.StringBuffer buffer, java.lang.String lbl1)voidendProcess(int msgType)protected booleanexceedsThresholdWithinWindow(int threshold, long docCount, int windowSize)voidforceTimeoutOnPendingCases(java.lang.String key)longgetAnalysisTime()Returns the total CPU time all processing threads spent in analysis.java.lang.StringgetBrokerURL()AsynchAECasManagergetCasManagerWrapper()AnalysisEngineControllergetCasMultiplierController(java.lang.String cmKey)Aggregates have more than one Listener channel.ServicePerformancegetCasStatistics(java.lang.String aCasReferenceId)Returns stats associated with a given CAS.org.apache.uima.UimaContextgetChildUimaContext(java.lang.String aDelegateEndpointName)EndpointgetClientEndpoint()java.lang.StringgetComponentName()Returns the name of the component.longgetCpuTime()Returns CPU Time with nanosecond precision (not nanosecond accuracy).java.util.Map<java.lang.String,java.lang.String>getDeadClientMap()java.lang.StringgetDeploymentDescriptor()java.lang.StringgetDeploymentMode()ErrorHandlerChaingetErrorHandlerChain()EventSubscribergetEventListener()Returns interface via which this instance receives callbackslonggetIdleTime()longgetIdleTimeBetweenProcessCalls(int msgType)intgetIndex()Returns a unique id for each component in the service hierarchy.InProcessCachegetInProcessCache()InputChannelgetInputChannel()InputChannelgetInputChannel(java.lang.String anEndpointName)java.lang.StringgetInputQueue()java.lang.StringgetJmxContext()This is called once during initialization to compute the position of the component in the JMX hierarchy and create a context path that will be used to register the component in the JMX registry.java.lang.StringgetJMXDomain()Get the domain for Uima JMX.java.lang.StringgetKey()LocalCachegetLocalCache()JmxManagementgetManagementInterface()java.lang.StringgetName()OutputChannelgetOutputChannel()AnalysisEngineControllergetParentController()InputChannelgetReplyInputChannel(java.lang.String aDelegateKey)longgetReplyTime()protected org.apache.uima.resource.ResourceSpecifiergetResourceSpecifier()ServiceErrorsgetServiceErrors()java.lang.StringgetServiceName()ServicePerformancegetServicePerformance()BaseAnalysisEngineController.ServiceStategetState()java.util.MapgetStats()Returns a copy of the controller statistics.longgetTime(java.lang.String aCasReferenceId, java.lang.String anEndpointName)longgetTotalNumberOfCASesDropped()longgetTotalNumberOfCASesProcessed()longgetTotalNumberOfCASesReceived()longgetTotalNumberOfErrors()longgetTotalTimeSpendDeSerializingCAS()longgetTotalTimeSpentSerializingCAS()longgetTotalTimeSpentWaitingForFreeCASInstance()UimaTransportgetTransport(java.lang.String aKey)UimaTransportgetTransport(UimaAsContext asContext)UimaTransportgetTransport(UimaAsContext asContext, java.lang.String aKey)UimaEEAdminContextgetUimaEEAdminContext()UimaMessageListenergetUimaMessageListener(java.lang.String aDelegateKey)protected voidhandleAction(java.lang.String anAction, java.lang.String anEndpoint, ErrorContext anErrorContext)voidhandleError(java.util.HashMap aMap, java.lang.Throwable e)voidincrementDeserializationTime(long cpuTime)Increments the time this thread spent in deserialization of a CASprotected voidincrementErrorCounter()voidincrementSerializationTime(long cpuTime)Increments the time this thread spent in serialization of a CASvoidinitializeVMTransport(int parentControllerReplyConsumerCount)Initializes transport used for internal messaging between collocated Uima AS services.booleanisAwaitingCacheCallbackNotification()booleanisCasMultiplier()booleanisStopped()Return true if this service is in the shutdown statebooleanisTopLevelComponent()protected voidlogStats()protected voidlogStats(java.lang.String aDelegateKey, ServicePerformance aServicePerformance)Logs statisticsvoidnotifyListenersWithInitializationStatus(java.lang.Exception e)voidonCacheEmpty()Callback method called the InProcessCache becomes empty meaning ALL CASes are processed.protected voidplugInDefaultErrorHandlerChain()voidprocess(org.apache.uima.cas.CAS aCas, java.lang.String aCasId)voidprocess(org.apache.uima.cas.CAS aCAS, java.lang.String anInputCasReferenceId, java.lang.String aNewCasReferenceId, java.lang.String newCASProducedBy)voidprocess(org.apache.uima.cas.CAS aCAS, java.lang.String aCasReferenceId, Endpoint anEndpoint)voidquiesceAndStop()Stops input channel(s) and waits for CASes still in play to complete processing.protected voidregisterServiceWithJMX(java.lang.String key_value_list, boolean remote)voidregisterVmQueueWithJMX(java.lang.Object o, java.lang.String aName)protected voidregisterWithAgent(java.lang.Object o, java.lang.String aName)Register a component with a given name with JMX MBeanServervoidreleaseNextCas(java.lang.String casReferenceId)voidremoveControllerCallbackListener(ControllerCallbackListener aListener)Removes named application listener.protected voidresetErrorCounter()voidsaveReplyTime(long snapshot, java.lang.String aKey)voidsaveTime(long aTime, java.lang.String aCasReferenceId, java.lang.String anEndpointName)voidsendMetadata(Endpoint anEndpoint, org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData metadata)voidsetCasManager(AsynchAECasManager casManager)voidsetDeployDescriptor(java.lang.String aDeployDescriptor)voidsetErrorHandlerChain(ErrorHandlerChain errorHandlerChain)voidsetInputChannel(InputChannel anInputChannel)voidsetJmxManagement(JmxManagement aJmxManagement)Override the default JmxManagervoidsetOutputChannel(OutputChannel outputChannel)voidsetStopped()Called to set the state of the AnalysisEngineController to STOPPED.voidsetUimaEEAdminContext(UimaEEAdminContext anAdminContext)voidstop()Stops input channel(s) and initiates a shutdown of all delegates ( if this is an aggregate ).voidstop(java.lang.Throwable cause, java.lang.String aCasReferenceId)voidstopCasMultiplier(Delegate casMultiplier, java.lang.String aCasReferenceId)voidstopCasMultipliers()protected voidstopDelegateTimers()protected voidstopInputChannel()Stops a listener on the main input channelprotected voidstopInputChannels(int channelsToStop)protected voidstopTransportLayer()voidterminate()Using a reference to its parent, propagates the terminate event to the top level controller.voidterminate(java.lang.Throwable cause, java.lang.String aCasReferenceId)java.lang.StringtoString()Print the component name rather than the class name-
Methods inherited from class org.apache.uima.resource.Resource_ImplBase
destroy, getCasManager, getLogger, getMetaData, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger, setMetaData
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.uima.aae.controller.AnalysisEngineController
collectionProcessComplete, getControllerLatch, getMonitor, getServiceEndpointName, getServiceInfo, handleDelegateLifeCycleEvent, initialize, isPrimitive, onInitialize, sendMetadata, takeAction
-
-
-
-
Field Detail
-
NO_RECOVERY
public static final boolean NO_RECOVERY
- See Also:
- Constant Field Values
-
currentState
protected BaseAnalysisEngineController.ServiceState currentState
-
latch
protected volatile ControllerLatch latch
-
statsMap
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.Long> statsMap
-
monitor
protected Monitor monitor
-
clientEndpoint
protected Endpoint clientEndpoint
-
parentController
protected AnalysisEngineController parentController
-
resourceSpecifier
protected org.apache.uima.resource.ResourceSpecifier resourceSpecifier
-
paramsMap
protected java.util.HashMap paramsMap
-
inputChannel
protected InputChannel inputChannel
-
errorHandlerChain
protected ErrorHandlerChain errorHandlerChain
-
errorCount
protected long errorCount
-
inputChannelList
protected java.util.List inputChannelList
-
inputChannelMap
protected java.util.concurrent.ConcurrentHashMap inputChannelMap
-
componentCasPoolSize
protected int componentCasPoolSize
-
replyTime
protected long replyTime
-
idleTime
protected long idleTime
-
serviceErrorMap
protected java.util.concurrent.ConcurrentHashMap serviceErrorMap
-
jmxContext
protected java.lang.String jmxContext
-
servicePerformance
protected ServicePerformance servicePerformance
-
serviceErrors
protected ServiceErrors serviceErrors
-
stopped
protected volatile boolean stopped
-
delegateKey
protected java.lang.String delegateKey
-
unregisteredDelegateList
protected java.util.List unregisteredDelegateList
-
allDelegatesAreRemote
protected volatile boolean allDelegatesAreRemote
-
controllerListeners
protected java.util.List controllerListeners
-
serviceInitialized
protected volatile boolean serviceInitialized
-
perCasStatistics
protected java.util.concurrent.ConcurrentHashMap perCasStatistics
-
syncObject
protected java.lang.Object syncObject
-
cmOutstandingCASes
protected java.util.concurrent.ConcurrentHashMap cmOutstandingCASes
-
finalStepMux
protected final java.lang.Object finalStepMux
-
transports
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,UimaTransport> transports
-
messageListeners
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,UimaMessageListener> messageListeners
-
localCache
protected LocalCache localCache
-
aeDescriptor
protected java.lang.String aeDescriptor
-
delegates
protected java.util.List<Delegate> delegates
-
callbackReceived
protected volatile boolean callbackReceived
-
callbackMonitor
protected java.lang.Object callbackMonitor
-
awaitingCacheCallbackNotification
protected volatile boolean awaitingCacheCallbackNotification
-
abortedCasesMap
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> abortedCasesMap
-
processPid
protected java.lang.String processPid
-
deadClientDestinationMap
protected java.util.concurrent.ConcurrentHashMap<java.lang.String,java.lang.String> deadClientDestinationMap
-
-
Constructor Detail
-
BaseAnalysisEngineController
public BaseAnalysisEngineController()
-
BaseAnalysisEngineController
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache) throws java.lang.Exception
- Throws:
java.lang.Exception
-
BaseAnalysisEngineController
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, java.util.Map aDestinationMap) throws java.lang.Exception
- Throws:
java.lang.Exception
-
BaseAnalysisEngineController
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, java.util.Map aDestinationMap, JmxManagement aJmxManagement) throws java.lang.Exception
- Throws:
java.lang.Exception
-
BaseAnalysisEngineController
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, long anInitialCasHeapSize, java.lang.String anEndpointName, java.lang.String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, java.util.Map aDestinationMap, JmxManagement aJmxManagement) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
dumpState
public abstract void dumpState(java.lang.StringBuffer buffer, java.lang.String lbl1)- Specified by:
dumpStatein interfaceAnalysisEngineController
-
getParentController
public AnalysisEngineController getParentController()
- Specified by:
getParentControllerin interfaceAnalysisEngineController
-
getTransport
public UimaTransport getTransport(java.lang.String aKey) throws java.lang.Exception
- Specified by:
getTransportin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
getTransport
public UimaTransport getTransport(UimaAsContext asContext) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getTransport
public UimaTransport getTransport(UimaAsContext asContext, java.lang.String aKey) throws java.lang.Exception
- Specified by:
getTransportin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
initializeVMTransport
public void initializeVMTransport(int parentControllerReplyConsumerCount) throws java.lang.ExceptionInitializes transport used for internal messaging between collocated Uima AS services.- Specified by:
initializeVMTransportin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
getUimaMessageListener
public UimaMessageListener getUimaMessageListener(java.lang.String aDelegateKey)
- Specified by:
getUimaMessageListenerin interfaceAnalysisEngineController
-
getJMXDomain
public java.lang.String getJMXDomain()
Get the domain for Uima JMX. The domain includes a fixed string plus the name of the top level component. All uima ee objects are rooted at this domain.- Specified by:
getJMXDomainin interfaceAnalysisEngineController
-
getManagementInterface
public JmxManagement getManagementInterface()
- Specified by:
getManagementInterfacein interfaceAnalysisEngineController
-
getIndex
public int getIndex()
Returns a unique id for each component in the service hierarchy. The top level component's id is always = 0- Specified by:
getIndexin interfaceAnalysisEngineController
-
getJmxContext
public java.lang.String getJmxContext()
This is called once during initialization to compute the position of the component in the JMX hierarchy and create a context path that will be used to register the component in the JMX registry.- Specified by:
getJmxContextin interfaceAnalysisEngineController
-
registerWithAgent
protected void registerWithAgent(java.lang.Object o, java.lang.String aName)Register a component with a given name with JMX MBeanServer- Parameters:
o- - component to register with JMXaName- - full jmx context name for the component
-
registerVmQueueWithJMX
public void registerVmQueueWithJMX(java.lang.Object o, java.lang.String aName) throws java.lang.Exception- Specified by:
registerVmQueueWithJMXin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
registerServiceWithJMX
protected void registerServiceWithJMX(java.lang.String key_value_list, boolean remote)
-
cleanUp
protected void cleanUp() throws java.lang.Exception- Throws:
java.lang.Exception
-
setJmxManagement
public void setJmxManagement(JmxManagement aJmxManagement)
Override the default JmxManager
-
isTopLevelComponent
public boolean isTopLevelComponent()
- Specified by:
isTopLevelComponentin interfaceAnalysisEngineController
-
getComponentName
public java.lang.String getComponentName()
Returns the name of the component. The name comes from the analysis engine descriptor- Specified by:
getComponentNamein interfaceAnalysisEngineController
-
toString
public java.lang.String toString()
Print the component name rather than the class name- Overrides:
toStringin classjava.lang.Object
-
addServiceInfo
public void addServiceInfo(ServiceInfo aServiceInfo)
- Specified by:
addServiceInfoin interfaceAnalysisEngineController
-
getServicePerformance
public ServicePerformance getServicePerformance()
- Specified by:
getServicePerformancein interfaceAnalysisEngineController
-
getServiceErrors
public ServiceErrors getServiceErrors()
- Specified by:
getServiceErrorsin interfaceAnalysisEngineController
-
getChildUimaContext
public org.apache.uima.UimaContext getChildUimaContext(java.lang.String aDelegateEndpointName) throws java.lang.Exception- Specified by:
getChildUimaContextin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
setInputChannel
public void setInputChannel(InputChannel anInputChannel) throws java.lang.Exception
- Specified by:
setInputChannelin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
addInputChannel
public void addInputChannel(InputChannel anInputChannel)
- Specified by:
addInputChannelin interfaceAnalysisEngineController
-
getInputChannel
public InputChannel getInputChannel()
- Specified by:
getInputChannelin interfaceAnalysisEngineController
-
dropCAS
public void dropCAS(org.apache.uima.cas.CAS aCAS)
- Specified by:
dropCASin interfaceAnalysisEngineController
-
saveReplyTime
public void saveReplyTime(long snapshot, java.lang.String aKey)- Specified by:
saveReplyTimein interfaceAnalysisEngineController
-
getReplyTime
public long getReplyTime()
- Specified by:
getReplyTimein interfaceAnalysisEngineController
-
handleAction
protected void handleAction(java.lang.String anAction, java.lang.String anEndpoint, ErrorContext anErrorContext) throws java.lang.Exception- Throws:
java.lang.Exception
-
forceTimeoutOnPendingCases
public void forceTimeoutOnPendingCases(java.lang.String key)
- Specified by:
forceTimeoutOnPendingCasesin interfaceAnalysisEngineController
-
plugInDefaultErrorHandlerChain
protected void plugInDefaultErrorHandlerChain()
-
setErrorHandlerChain
public void setErrorHandlerChain(ErrorHandlerChain errorHandlerChain)
-
getErrorHandlerChain
public ErrorHandlerChain getErrorHandlerChain()
- Specified by:
getErrorHandlerChainin interfaceAnalysisEngineController
-
handleError
public void handleError(java.util.HashMap aMap, java.lang.Throwable e)
-
dropCAS
public void dropCAS(java.lang.String aCasReferenceId, boolean deleteCacheEntry)- Specified by:
dropCASin interfaceAnalysisEngineController
-
saveTime
public void saveTime(long aTime, java.lang.String aCasReferenceId, java.lang.String anEndpointName)- Specified by:
saveTimein interfaceAnalysisEngineController
-
getTime
public long getTime(java.lang.String aCasReferenceId, java.lang.String anEndpointName)- Specified by:
getTimein interfaceAnalysisEngineController
-
resetErrorCounter
protected void resetErrorCounter()
-
incrementErrorCounter
protected void incrementErrorCounter()
-
exceedsThresholdWithinWindow
protected boolean exceedsThresholdWithinWindow(int threshold, long docCount, int windowSize)
-
getOutputChannel
public OutputChannel getOutputChannel()
- Specified by:
getOutputChannelin interfaceAnalysisEngineController
-
setOutputChannel
public void setOutputChannel(OutputChannel outputChannel) throws java.lang.Exception
- Specified by:
setOutputChannelin interfaceAnalysisEngineController- Throws:
java.lang.Exception
-
getCasManagerWrapper
public AsynchAECasManager getCasManagerWrapper()
- Specified by:
getCasManagerWrapperin interfaceAnalysisEngineController
-
setCasManager
public void setCasManager(AsynchAECasManager casManager)
- Specified by:
setCasManagerin interfaceAnalysisEngineController
-
getInProcessCache
public InProcessCache getInProcessCache()
- Specified by:
getInProcessCachein interfaceAnalysisEngineController
-
getResourceSpecifier
protected org.apache.uima.resource.ResourceSpecifier getResourceSpecifier()
-
getName
public java.lang.String getName()
- Specified by:
getNamein interfaceAnalysisEngineController
-
getKey
public java.lang.String getKey()
- Specified by:
getKeyin interfaceAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS aCas, java.lang.String aCasId)- Specified by:
processin interfaceAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS aCAS, java.lang.String anInputCasReferenceId, java.lang.String aNewCasReferenceId, java.lang.String newCASProducedBy)- Specified by:
processin interfaceAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS aCAS, java.lang.String aCasReferenceId, Endpoint anEndpoint)- Specified by:
processin interfaceAnalysisEngineController
-
setUimaEEAdminContext
public void setUimaEEAdminContext(UimaEEAdminContext anAdminContext)
- Specified by:
setUimaEEAdminContextin interfaceAnalysisEngineController
-
getUimaEEAdminContext
public UimaEEAdminContext getUimaEEAdminContext()
- Specified by:
getUimaEEAdminContextin interfaceAnalysisEngineController
-
dropStats
public void dropStats(java.lang.String aCasReferenceId, java.lang.String anEndpointName)Removes statistics from the global Map- Specified by:
dropStatsin interfaceAnalysisEngineController
-
logStats
protected void logStats()
-
getCasStatistics
public ServicePerformance getCasStatistics(java.lang.String aCasReferenceId)
Returns stats associated with a given CAS. A service uses a global map to store CAS level 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.- Specified by:
getCasStatisticsin interfaceAnalysisEngineController
-
logStats
protected void logStats(java.lang.String aDelegateKey, ServicePerformance aServicePerformance)Logs statistics- Parameters:
aDelegateKey-aDelegateServicePerformance-
-
clearStats
protected void clearStats()
Clears controller statistics.
-
getStats
public java.util.Map getStats()
Returns a copy of the controller statistics.- Specified by:
getStatsin interfaceAnalysisEngineController
-
setDeployDescriptor
public void setDeployDescriptor(java.lang.String aDeployDescriptor)
- Specified by:
setDeployDescriptorin interfaceAnalysisEngineController
-
getServiceName
public java.lang.String getServiceName()
-
getDeploymentDescriptor
public java.lang.String getDeploymentDescriptor()
-
getDeploymentMode
public java.lang.String getDeploymentMode()
-
getBrokerURL
public java.lang.String getBrokerURL()
-
getInputQueue
public java.lang.String getInputQueue()
-
getTotalTimeSpentSerializingCAS
public long getTotalTimeSpentSerializingCAS()
-
getTotalTimeSpendDeSerializingCAS
public long getTotalTimeSpendDeSerializingCAS()
-
getTotalTimeSpentWaitingForFreeCASInstance
public long getTotalTimeSpentWaitingForFreeCASInstance()
-
getTotalNumberOfCASesReceived
public long getTotalNumberOfCASesReceived()
-
getTotalNumberOfCASesProcessed
public long getTotalNumberOfCASesProcessed()
-
getTotalNumberOfCASesDropped
public long getTotalNumberOfCASesDropped()
-
getTotalNumberOfErrors
public long getTotalNumberOfErrors()
-
getClientEndpoint
public Endpoint getClientEndpoint()
- Specified by:
getClientEndpointin interfaceAnalysisEngineController
-
cacheClientEndpoint
public void cacheClientEndpoint(Endpoint anEndpoint)
- Specified by:
cacheClientEndpointin interfaceAnalysisEngineController- Parameters:
anEndpoint-
-
isStopped
public boolean isStopped()
Return true if this service is in the shutdown state- Specified by:
isStoppedin interfaceAnalysisEngineController- Returns:
- - true if stopped
-
setStopped
public void setStopped()
Description copied from interface:AnalysisEngineControllerCalled to set the state of the AnalysisEngineController to STOPPED. This method does not stop input or output channels.- Specified by:
setStoppedin interfaceAnalysisEngineController
-
stopTransportLayer
protected void stopTransportLayer()
-
stop
public void stop()
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.- Specified by:
stopin interfaceAnalysisEngineController
-
stop
public void stop(java.lang.Throwable cause, java.lang.String aCasReferenceId)
-
quiesceAndStop
public void quiesceAndStop()
Stops input channel(s) and waits for CASes still in play to complete processing. When the InProcessCache becomes empty, initiate the service shutdown.- Specified by:
quiesceAndStopin interfaceAnalysisEngineController
-
stopDelegateTimers
protected void stopDelegateTimers()
-
terminate
public void terminate()
Using a reference to its parent, propagates the terminate event to the top level controller. Typically invoked, when the error handling detects excessive errors and action=terminate. The top level controller, stops its input channel and instructs a colocated Cas Multiplier (it it has one) to stop generating new CASes. It then registers self as a listener with the InProcessCache. The callback will be called when the InProcessCache becomes empty. Only then, the top level controller will call stop() on each of a delegates (if the top level is an aggregate).- Specified by:
terminatein interfaceControllerLifecycle
-
terminate
public void terminate(java.lang.Throwable cause, java.lang.String aCasReferenceId)
-
stopCasMultipliers
public void stopCasMultipliers()
-
stopCasMultiplier
public void stopCasMultiplier(Delegate casMultiplier, java.lang.String aCasReferenceId)
-
stopInputChannel
protected void stopInputChannel()
Stops a listener on the main input channel
-
stopInputChannels
protected void stopInputChannels(int channelsToStop)
-
getCasMultiplierController
public AnalysisEngineController getCasMultiplierController(java.lang.String cmKey)
Aggregates have more than one Listener channel. This method stops all configured input channels this service is configured with.
-
getInputChannel
public InputChannel getInputChannel(java.lang.String anEndpointName)
- Specified by:
getInputChannelin interfaceAnalysisEngineController
-
getReplyInputChannel
public InputChannel getReplyInputChannel(java.lang.String aDelegateKey)
- Specified by:
getReplyInputChannelin interfaceAnalysisEngineController
-
onCacheEmpty
public void onCacheEmpty()
Callback method called the InProcessCache becomes empty meaning ALL CASes are processed. The callback is only active when the the top level component is in the process of shutting down.- Specified by:
onCacheEmptyin interfaceEventSubscriber
-
getEventListener
public EventSubscriber getEventListener()
Returns interface via which this instance receives callbacks- Specified by:
getEventListenerin interfaceAnalysisEngineController
-
addControllerCallbackListener
public void addControllerCallbackListener(ControllerCallbackListener aListener)
Register one or more listeners through which the controller can send notification of events.- Specified by:
addControllerCallbackListenerin interfaceControllerLifecycle- Parameters:
aListener- - application listener object to register
-
removeControllerCallbackListener
public void removeControllerCallbackListener(ControllerCallbackListener aListener)
Removes named application listener.- Specified by:
removeControllerCallbackListenerin interfaceControllerLifecycle- Parameters:
aListener- - application listener to remove
-
notifyListenersWithInitializationStatus
public void notifyListenersWithInitializationStatus(java.lang.Exception e)
- Specified by:
notifyListenersWithInitializationStatusin interfaceAnalysisEngineController
-
dropCasStatistics
protected void dropCasStatistics(java.lang.String aCasReferenceId)
-
isCasMultiplier
public boolean isCasMultiplier()
- Specified by:
isCasMultiplierin interfaceAnalysisEngineController
-
releaseNextCas
public void releaseNextCas(java.lang.String casReferenceId)
- Specified by:
releaseNextCasin interfaceAnalysisEngineController
-
beginProcess
public void beginProcess(int msgType)
- Specified by:
beginProcessin interfaceAnalysisEngineController
-
endProcess
public void endProcess(int msgType)
- Specified by:
endProcessin interfaceAnalysisEngineController
-
getIdleTimeBetweenProcessCalls
public long getIdleTimeBetweenProcessCalls(int msgType)
- Specified by:
getIdleTimeBetweenProcessCallsin interfaceAnalysisEngineController
-
getIdleTime
public long getIdleTime()
- Specified by:
getIdleTimein interfaceAnalysisEngineController
-
getCpuTime
public long getCpuTime()
Returns CPU Time with nanosecond precision (not nanosecond accuracy). If the OS/JVM does not support reporting the CPU Time, returns the wall clock time.- Specified by:
getCpuTimein interfaceAnalysisEngineController
-
getAnalysisTime
public long getAnalysisTime()
Returns the total CPU time all processing threads spent in analysis. This method subtracts the serialization and de-serialization time from the total. If this service is an aggregate, the return time is a sum of CPU utilization in each colocated delegate.- Specified by:
getAnalysisTimein interfaceAnalysisEngineController
-
incrementSerializationTime
public void incrementSerializationTime(long cpuTime)
Increments the time this thread spent in serialization of a CAS- Specified by:
incrementSerializationTimein interfaceAnalysisEngineController
-
incrementDeserializationTime
public void incrementDeserializationTime(long cpuTime)
Increments the time this thread spent in deserialization of a CAS- Specified by:
incrementDeserializationTimein interfaceAnalysisEngineController
-
sendMetadata
public void sendMetadata(Endpoint anEndpoint, org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData metadata)
-
getLocalCache
public LocalCache getLocalCache()
- Specified by:
getLocalCachein interfaceAnalysisEngineController
-
addAbortedCasReferenceId
public void addAbortedCasReferenceId(java.lang.String aCasReferenceId)
- Specified by:
addAbortedCasReferenceIdin interfaceAnalysisEngineController
-
abortGeneratingCASes
protected boolean abortGeneratingCASes(java.lang.String aCasReferenceId)
Returns true if a given CAS id is in the list of aborted CASes.- Parameters:
aCasReferenceId- - id of the current input CAS being processed- Returns:
- - true if the CAS is in the list of aborted CASes, false otherwise
-
isAwaitingCacheCallbackNotification
public boolean isAwaitingCacheCallbackNotification()
- Specified by:
isAwaitingCacheCallbackNotificationin interfaceAnalysisEngineController
-
changeState
public void changeState(BaseAnalysisEngineController.ServiceState state)
- Specified by:
changeStatein interfaceAnalysisEngineController
-
getState
public BaseAnalysisEngineController.ServiceState getState()
- Specified by:
getStatein interfaceAnalysisEngineController
-
getDeadClientMap
public java.util.Map<java.lang.String,java.lang.String> getDeadClientMap()
- Specified by:
getDeadClientMapin interfaceAnalysisEngineController
-
-