public abstract class BaseAnalysisEngineController extends org.apache.uima.resource.Resource_ImplBase implements AnalysisEngineController, EventSubscriber
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseAnalysisEngineController.ServiceState |
AEInstanceCount, CasPoolSize| Constructor and Description |
|---|
BaseAnalysisEngineController() |
BaseAnalysisEngineController(AnalysisEngineController aParentController,
int aComponentCasPoolSize,
long anInitialCasHeapSize,
String anEndpointName,
String aDescriptor,
AsynchAECasManager aCasManager,
InProcessCache anInProcessCache,
Map aDestinationMap,
JmxManagement aJmxManagement) |
BaseAnalysisEngineController(AnalysisEngineController aParentController,
int aComponentCasPoolSize,
String anEndpointName,
String aDescriptor,
AsynchAECasManager aCasManager,
InProcessCache anInProcessCache) |
BaseAnalysisEngineController(AnalysisEngineController aParentController,
int aComponentCasPoolSize,
String anEndpointName,
String aDescriptor,
AsynchAECasManager aCasManager,
InProcessCache anInProcessCache,
Map aDestinationMap) |
BaseAnalysisEngineController(AnalysisEngineController aParentController,
int aComponentCasPoolSize,
String anEndpointName,
String aDescriptor,
AsynchAECasManager aCasManager,
InProcessCache anInProcessCache,
Map aDestinationMap,
JmxManagement aJmxManagement) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
abortGeneratingCASes(String aCasReferenceId)
Returns true if a given CAS id is in the list of aborted CASes.
|
void |
addAbortedCasReferenceId(String aCasReferenceId) |
void |
addControllerCallbackListener(ControllerCallbackListener aListener)
Register one or more listeners through which the controller can send notification of events.
|
void |
addInputChannel(InputChannel anInputChannel) |
void |
addServiceInfo(ServiceInfo aServiceInfo) |
void |
beginProcess(int msgType) |
void |
cacheClientEndpoint(Endpoint anEndpoint) |
void |
changeState(BaseAnalysisEngineController.ServiceState state) |
protected void |
cleanUp() |
protected void |
clearStats()
Clears controller statistics.
|
void |
dropCAS(org.apache.uima.cas.CAS aCAS) |
void |
dropCAS(String aCasReferenceId,
boolean deleteCacheEntry) |
protected void |
dropCasStatistics(String aCasReferenceId) |
void |
dropStats(String aCasReferenceId,
String anEndpointName)
Removes statistics from the global Map
|
abstract void |
dumpState(StringBuffer buffer,
String lbl1) |
void |
endProcess(int msgType) |
protected boolean |
exceedsThresholdWithinWindow(int threshold,
long docCount,
int windowSize) |
void |
forceTimeoutOnPendingCases(String key) |
long |
getAnalysisTime()
Returns the total CPU time all processing threads spent in analysis.
|
String |
getBrokerURL() |
AsynchAECasManager |
getCasManagerWrapper() |
AnalysisEngineController |
getCasMultiplierController(String cmKey)
Aggregates have more than one Listener channel.
|
ServicePerformance |
getCasStatistics(String aCasReferenceId)
Returns stats associated with a given CAS.
|
org.apache.uima.UimaContext |
getChildUimaContext(String aDelegateEndpointName) |
Endpoint |
getClientEndpoint() |
String |
getComponentName()
Returns the name of the component.
|
long |
getCpuTime()
Returns CPU Time with nanosecond precision (not nanosecond accuracy).
|
Map<String,String> |
getDeadClientMap() |
String |
getDeploymentDescriptor() |
String |
getDeploymentMode() |
ErrorHandlerChain |
getErrorHandlerChain() |
EventSubscriber |
getEventListener()
Returns interface via which this instance receives callbacks
|
long |
getIdleTime() |
long |
getIdleTimeBetweenProcessCalls(int msgType) |
int |
getIndex()
Returns a unique id for each component in the service hierarchy.
|
InProcessCache |
getInProcessCache() |
InputChannel |
getInputChannel() |
InputChannel |
getInputChannel(String anEndpointName) |
String |
getInputQueue() |
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.
|
String |
getJMXDomain()
Get the domain for Uima JMX.
|
String |
getKey() |
LocalCache |
getLocalCache() |
JmxManagement |
getManagementInterface() |
String |
getName() |
OutputChannel |
getOutputChannel() |
AnalysisEngineController |
getParentController() |
InputChannel |
getReplyInputChannel(String aDelegateKey) |
long |
getReplyTime() |
protected org.apache.uima.resource.ResourceSpecifier |
getResourceSpecifier() |
ServiceErrors |
getServiceErrors() |
String |
getServiceName() |
ServicePerformance |
getServicePerformance() |
BaseAnalysisEngineController.ServiceState |
getState() |
Map |
getStats()
Returns a copy of the controller statistics.
|
long |
getTime(String aCasReferenceId,
String anEndpointName) |
long |
getTotalNumberOfCASesDropped() |
long |
getTotalNumberOfCASesProcessed() |
long |
getTotalNumberOfCASesReceived() |
long |
getTotalNumberOfErrors() |
long |
getTotalTimeSpendDeSerializingCAS() |
long |
getTotalTimeSpentSerializingCAS() |
long |
getTotalTimeSpentWaitingForFreeCASInstance() |
UimaTransport |
getTransport(String aKey) |
UimaTransport |
getTransport(UimaAsContext asContext) |
UimaTransport |
getTransport(UimaAsContext asContext,
String aKey) |
UimaEEAdminContext |
getUimaEEAdminContext() |
UimaMessageListener |
getUimaMessageListener(String aDelegateKey) |
protected void |
handleAction(String anAction,
String anEndpoint,
ErrorContext anErrorContext) |
void |
handleError(HashMap aMap,
Throwable e) |
void |
incrementDeserializationTime(long cpuTime)
Increments the time this thread spent in deserialization of a CAS
|
protected void |
incrementErrorCounter() |
void |
incrementSerializationTime(long cpuTime)
Increments the time this thread spent in serialization of a CAS
|
void |
initializeVMTransport(int parentControllerReplyConsumerCount)
Initializes transport used for internal messaging between collocated Uima AS services.
|
boolean |
isAwaitingCacheCallbackNotification() |
boolean |
isCasMultiplier() |
boolean |
isStopped()
Return true if this service is in the shutdown state
|
boolean |
isTopLevelComponent() |
protected void |
logStats() |
protected void |
logStats(String aDelegateKey,
ServicePerformance aServicePerformance)
Logs statistics
|
void |
notifyListenersWithInitializationStatus(Exception e) |
void |
onCacheEmpty()
Callback method called the InProcessCache becomes empty meaning ALL CASes are processed.
|
protected void |
plugInDefaultErrorHandlerChain() |
void |
process(org.apache.uima.cas.CAS aCas,
String aCasId) |
void |
process(org.apache.uima.cas.CAS aCAS,
String aCasReferenceId,
Endpoint anEndpoint) |
void |
process(org.apache.uima.cas.CAS aCAS,
String anInputCasReferenceId,
String aNewCasReferenceId,
String newCASProducedBy) |
void |
quiesceAndStop()
Stops input channel(s) and waits for CASes still in play to complete processing.
|
protected void |
registerServiceWithJMX(String key_value_list,
boolean remote) |
void |
registerVmQueueWithJMX(Object o,
String aName) |
protected void |
registerWithAgent(Object o,
String aName)
Register a component with a given name with JMX MBeanServer
|
void |
releaseNextCas(String casReferenceId) |
void |
removeControllerCallbackListener(ControllerCallbackListener aListener)
Removes named application listener.
|
protected void |
resetErrorCounter() |
void |
saveReplyTime(long snapshot,
String aKey) |
void |
saveTime(long aTime,
String aCasReferenceId,
String anEndpointName) |
void |
sendMetadata(Endpoint anEndpoint,
org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData metadata) |
void |
setCasManager(AsynchAECasManager casManager) |
void |
setDeployDescriptor(String aDeployDescriptor) |
void |
setErrorHandlerChain(ErrorHandlerChain errorHandlerChain) |
void |
setInputChannel(InputChannel anInputChannel) |
void |
setJmxManagement(JmxManagement aJmxManagement)
Override the default JmxManager
|
void |
setOutputChannel(OutputChannel outputChannel) |
void |
setStopped()
Called to set the state of the AnalysisEngineController to STOPPED.
|
void |
setUimaEEAdminContext(UimaEEAdminContext anAdminContext) |
void |
stop()
Stops input channel(s) and initiates a shutdown of all delegates ( if this is an aggregate ).
|
void |
stop(Throwable cause,
String aCasReferenceId) |
void |
stopCasMultiplier(Delegate casMultiplier,
String aCasReferenceId) |
void |
stopCasMultipliers() |
protected void |
stopDelegateTimers() |
protected void |
stopInputChannel()
Stops a listener on the main input channel
|
protected void |
stopInputChannels(int channelsToStop) |
protected void |
stopTransportLayer() |
void |
terminate()
Using a reference to its parent, propagates the terminate event to the top level controller.
|
void |
terminate(Throwable cause,
String aCasReferenceId) |
String |
toString()
Print the component name rather than the class name
|
destroy, getCasManager, getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger, setMetaDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcollectionProcessComplete, getControllerLatch, getMonitor, getServiceEndpointName, getServiceInfo, handleDelegateLifeCycleEvent, initialize, isPrimitive, onInitialize, sendMetadata, takeActionpublic static final boolean NO_RECOVERY
protected BaseAnalysisEngineController.ServiceState currentState
protected volatile ControllerLatch latch
protected ConcurrentHashMap<String,Long> statsMap
protected Monitor monitor
protected Endpoint clientEndpoint
protected AnalysisEngineController parentController
protected org.apache.uima.resource.ResourceSpecifier resourceSpecifier
protected HashMap paramsMap
protected InputChannel inputChannel
protected ErrorHandlerChain errorHandlerChain
protected long errorCount
protected List inputChannelList
protected ConcurrentHashMap inputChannelMap
protected int componentCasPoolSize
protected long replyTime
protected long idleTime
protected ConcurrentHashMap serviceErrorMap
protected String jmxContext
protected ServicePerformance servicePerformance
protected ServiceErrors serviceErrors
protected volatile boolean stopped
protected String delegateKey
protected List unregisteredDelegateList
protected volatile boolean allDelegatesAreRemote
protected List controllerListeners
protected volatile boolean serviceInitialized
protected ConcurrentHashMap perCasStatistics
protected Object syncObject
protected ConcurrentHashMap cmOutstandingCASes
protected final Object finalStepMux
protected ConcurrentHashMap<String,UimaTransport> transports
protected ConcurrentHashMap<String,UimaMessageListener> messageListeners
protected LocalCache localCache
protected String aeDescriptor
protected volatile boolean callbackReceived
protected Object callbackMonitor
protected volatile boolean awaitingCacheCallbackNotification
protected ConcurrentHashMap<String,String> abortedCasesMap
protected String processPid
protected ConcurrentHashMap<String,String> deadClientDestinationMap
public BaseAnalysisEngineController()
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache) throws Exception
Exceptionpublic BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap) throws Exception
Exceptionpublic BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap, JmxManagement aJmxManagement) throws Exception
Exceptionpublic BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, long anInitialCasHeapSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap, JmxManagement aJmxManagement) throws Exception
Exceptionpublic abstract void dumpState(StringBuffer buffer, String lbl1)
dumpState in interface AnalysisEngineControllerpublic AnalysisEngineController getParentController()
getParentController in interface AnalysisEngineControllerpublic UimaTransport getTransport(String aKey) throws Exception
getTransport in interface AnalysisEngineControllerExceptionpublic UimaTransport getTransport(UimaAsContext asContext) throws Exception
Exceptionpublic UimaTransport getTransport(UimaAsContext asContext, String aKey) throws Exception
getTransport in interface AnalysisEngineControllerExceptionpublic void initializeVMTransport(int parentControllerReplyConsumerCount)
throws Exception
initializeVMTransport in interface AnalysisEngineControllerExceptionpublic UimaMessageListener getUimaMessageListener(String aDelegateKey)
getUimaMessageListener in interface AnalysisEngineControllerpublic String getJMXDomain()
getJMXDomain in interface AnalysisEngineControllerpublic JmxManagement getManagementInterface()
getManagementInterface in interface AnalysisEngineControllerpublic int getIndex()
getIndex in interface AnalysisEngineControllerpublic String getJmxContext()
getJmxContext in interface AnalysisEngineControllerprotected void registerWithAgent(Object o, String aName)
o - - component to register with JMXaName - - full jmx context name for the componentpublic void registerVmQueueWithJMX(Object o, String aName) throws Exception
registerVmQueueWithJMX in interface AnalysisEngineControllerExceptionprotected void registerServiceWithJMX(String key_value_list, boolean remote)
public void setJmxManagement(JmxManagement aJmxManagement)
public boolean isTopLevelComponent()
isTopLevelComponent in interface AnalysisEngineControllerpublic String getComponentName()
getComponentName in interface AnalysisEngineControllerpublic String toString()
public void addServiceInfo(ServiceInfo aServiceInfo)
addServiceInfo in interface AnalysisEngineControllerpublic ServicePerformance getServicePerformance()
getServicePerformance in interface AnalysisEngineControllerpublic ServiceErrors getServiceErrors()
getServiceErrors in interface AnalysisEngineControllerpublic org.apache.uima.UimaContext getChildUimaContext(String aDelegateEndpointName) throws Exception
getChildUimaContext in interface AnalysisEngineControllerExceptionpublic void setInputChannel(InputChannel anInputChannel) throws Exception
setInputChannel in interface AnalysisEngineControllerExceptionpublic void addInputChannel(InputChannel anInputChannel)
addInputChannel in interface AnalysisEngineControllerpublic InputChannel getInputChannel()
getInputChannel in interface AnalysisEngineControllerpublic void dropCAS(org.apache.uima.cas.CAS aCAS)
dropCAS in interface AnalysisEngineControllerpublic void saveReplyTime(long snapshot,
String aKey)
saveReplyTime in interface AnalysisEngineControllerpublic long getReplyTime()
getReplyTime in interface AnalysisEngineControllerprotected void handleAction(String anAction, String anEndpoint, ErrorContext anErrorContext) throws Exception
Exceptionpublic void forceTimeoutOnPendingCases(String key)
forceTimeoutOnPendingCases in interface AnalysisEngineControllerprotected void plugInDefaultErrorHandlerChain()
public void setErrorHandlerChain(ErrorHandlerChain errorHandlerChain)
public ErrorHandlerChain getErrorHandlerChain()
getErrorHandlerChain in interface AnalysisEngineControllerpublic void dropCAS(String aCasReferenceId, boolean deleteCacheEntry)
dropCAS in interface AnalysisEngineControllerpublic void saveTime(long aTime,
String aCasReferenceId,
String anEndpointName)
saveTime in interface AnalysisEngineControllerpublic long getTime(String aCasReferenceId, String anEndpointName)
getTime in interface AnalysisEngineControllerprotected void resetErrorCounter()
protected void incrementErrorCounter()
protected boolean exceedsThresholdWithinWindow(int threshold,
long docCount,
int windowSize)
public OutputChannel getOutputChannel()
getOutputChannel in interface AnalysisEngineControllerpublic void setOutputChannel(OutputChannel outputChannel) throws Exception
setOutputChannel in interface AnalysisEngineControllerExceptionpublic AsynchAECasManager getCasManagerWrapper()
getCasManagerWrapper in interface AnalysisEngineControllerpublic void setCasManager(AsynchAECasManager casManager)
setCasManager in interface AnalysisEngineControllerpublic InProcessCache getInProcessCache()
getInProcessCache in interface AnalysisEngineControllerprotected org.apache.uima.resource.ResourceSpecifier getResourceSpecifier()
public String getName()
getName in interface AnalysisEngineControllerpublic String getKey()
getKey in interface AnalysisEngineControllerpublic void process(org.apache.uima.cas.CAS aCas,
String aCasId)
process in interface AnalysisEngineControllerpublic void process(org.apache.uima.cas.CAS aCAS,
String anInputCasReferenceId,
String aNewCasReferenceId,
String newCASProducedBy)
process in interface AnalysisEngineControllerpublic void process(org.apache.uima.cas.CAS aCAS,
String aCasReferenceId,
Endpoint anEndpoint)
process in interface AnalysisEngineControllerpublic void setUimaEEAdminContext(UimaEEAdminContext anAdminContext)
setUimaEEAdminContext in interface AnalysisEngineControllerpublic UimaEEAdminContext getUimaEEAdminContext()
getUimaEEAdminContext in interface AnalysisEngineControllerpublic void dropStats(String aCasReferenceId, String anEndpointName)
dropStats in interface AnalysisEngineControllerprotected void logStats()
public ServicePerformance getCasStatistics(String aCasReferenceId)
getCasStatistics in interface AnalysisEngineControllerprotected void logStats(String aDelegateKey, ServicePerformance aServicePerformance)
aDelegateKey - aDelegateServicePerformance - protected void clearStats()
public Map getStats()
getStats in interface AnalysisEngineControllerpublic void setDeployDescriptor(String aDeployDescriptor)
setDeployDescriptor in interface AnalysisEngineControllerpublic String getServiceName()
public String getDeploymentDescriptor()
public String getDeploymentMode()
public String getBrokerURL()
public String getInputQueue()
public long getTotalTimeSpentSerializingCAS()
public long getTotalTimeSpendDeSerializingCAS()
public long getTotalTimeSpentWaitingForFreeCASInstance()
public long getTotalNumberOfCASesReceived()
public long getTotalNumberOfCASesProcessed()
public long getTotalNumberOfCASesDropped()
public long getTotalNumberOfErrors()
public Endpoint getClientEndpoint()
getClientEndpoint in interface AnalysisEngineControllerpublic void cacheClientEndpoint(Endpoint anEndpoint)
cacheClientEndpoint in interface AnalysisEngineControlleranEndpoint - public boolean isStopped()
isStopped in interface AnalysisEngineControllerpublic void setStopped()
AnalysisEngineControllersetStopped in interface AnalysisEngineControllerprotected void stopTransportLayer()
public void stop()
stop in interface AnalysisEngineControllerpublic void quiesceAndStop()
quiesceAndStop in interface AnalysisEngineControllerprotected void stopDelegateTimers()
public void terminate()
terminate in interface ControllerLifecyclepublic void stopCasMultipliers()
protected void stopInputChannel()
protected void stopInputChannels(int channelsToStop)
public AnalysisEngineController getCasMultiplierController(String cmKey)
public InputChannel getInputChannel(String anEndpointName)
getInputChannel in interface AnalysisEngineControllerpublic InputChannel getReplyInputChannel(String aDelegateKey)
getReplyInputChannel in interface AnalysisEngineControllerpublic void onCacheEmpty()
onCacheEmpty in interface EventSubscriberpublic EventSubscriber getEventListener()
getEventListener in interface AnalysisEngineControllerpublic void addControllerCallbackListener(ControllerCallbackListener aListener)
addControllerCallbackListener in interface ControllerLifecycleaListener - - application listener object to registerpublic void removeControllerCallbackListener(ControllerCallbackListener aListener)
removeControllerCallbackListener in interface ControllerLifecycleaListener - - application listener to removepublic void notifyListenersWithInitializationStatus(Exception e)
notifyListenersWithInitializationStatus in interface AnalysisEngineControllerprotected void dropCasStatistics(String aCasReferenceId)
public boolean isCasMultiplier()
isCasMultiplier in interface AnalysisEngineControllerpublic void releaseNextCas(String casReferenceId)
releaseNextCas in interface AnalysisEngineControllerpublic void beginProcess(int msgType)
beginProcess in interface AnalysisEngineControllerpublic void endProcess(int msgType)
endProcess in interface AnalysisEngineControllerpublic long getIdleTimeBetweenProcessCalls(int msgType)
getIdleTimeBetweenProcessCalls in interface AnalysisEngineControllerpublic long getIdleTime()
getIdleTime in interface AnalysisEngineControllerpublic long getCpuTime()
getCpuTime in interface AnalysisEngineControllerpublic long getAnalysisTime()
getAnalysisTime in interface AnalysisEngineControllerpublic void incrementSerializationTime(long cpuTime)
incrementSerializationTime in interface AnalysisEngineControllerpublic void incrementDeserializationTime(long cpuTime)
incrementDeserializationTime in interface AnalysisEngineControllerpublic void sendMetadata(Endpoint anEndpoint, org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData metadata)
public LocalCache getLocalCache()
getLocalCache in interface AnalysisEngineControllerpublic void addAbortedCasReferenceId(String aCasReferenceId)
addAbortedCasReferenceId in interface AnalysisEngineControllerprotected boolean abortGeneratingCASes(String aCasReferenceId)
aCasReferenceId - - id of the current input CAS being processedpublic boolean isAwaitingCacheCallbackNotification()
isAwaitingCacheCallbackNotification in interface AnalysisEngineControllerpublic void changeState(BaseAnalysisEngineController.ServiceState state)
changeState in interface AnalysisEngineControllerpublic BaseAnalysisEngineController.ServiceState getState()
getState in interface AnalysisEngineControllerpublic Map<String,String> getDeadClientMap()
getDeadClientMap in interface AnalysisEngineControllerCopyright © 2016. All rights reserved.