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, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, initialize, setLogger, setMetaData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
collectionProcessComplete, getControllerLatch, getMonitor, getServiceEndpointName, getServiceInfo, handleDelegateLifeCycleEvent, initialize, isPrimitive, onInitialize, sendMetadata, takeAction
public 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
Exception
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap) throws Exception
Exception
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap, JmxManagement aJmxManagement) throws Exception
Exception
public BaseAnalysisEngineController(AnalysisEngineController aParentController, int aComponentCasPoolSize, long anInitialCasHeapSize, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap, JmxManagement aJmxManagement) throws Exception
Exception
public abstract void dumpState(StringBuffer buffer, String lbl1)
dumpState
in interface AnalysisEngineController
public AnalysisEngineController getParentController()
getParentController
in interface AnalysisEngineController
public UimaTransport getTransport(String aKey) throws Exception
getTransport
in interface AnalysisEngineController
Exception
public UimaTransport getTransport(UimaAsContext asContext) throws Exception
Exception
public UimaTransport getTransport(UimaAsContext asContext, String aKey) throws Exception
getTransport
in interface AnalysisEngineController
Exception
public void initializeVMTransport(int parentControllerReplyConsumerCount) throws Exception
initializeVMTransport
in interface AnalysisEngineController
Exception
public UimaMessageListener getUimaMessageListener(String aDelegateKey)
getUimaMessageListener
in interface AnalysisEngineController
public String getJMXDomain()
getJMXDomain
in interface AnalysisEngineController
public JmxManagement getManagementInterface()
getManagementInterface
in interface AnalysisEngineController
public int getIndex()
getIndex
in interface AnalysisEngineController
public String getJmxContext()
getJmxContext
in interface AnalysisEngineController
protected 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 AnalysisEngineController
Exception
protected void registerServiceWithJMX(String key_value_list, boolean remote)
public void setJmxManagement(JmxManagement aJmxManagement)
public boolean isTopLevelComponent()
isTopLevelComponent
in interface AnalysisEngineController
public String getComponentName()
getComponentName
in interface AnalysisEngineController
public String toString()
public void addServiceInfo(ServiceInfo aServiceInfo)
addServiceInfo
in interface AnalysisEngineController
public ServicePerformance getServicePerformance()
getServicePerformance
in interface AnalysisEngineController
public ServiceErrors getServiceErrors()
getServiceErrors
in interface AnalysisEngineController
public org.apache.uima.UimaContext getChildUimaContext(String aDelegateEndpointName) throws Exception
getChildUimaContext
in interface AnalysisEngineController
Exception
public void setInputChannel(InputChannel anInputChannel) throws Exception
setInputChannel
in interface AnalysisEngineController
Exception
public void addInputChannel(InputChannel anInputChannel)
addInputChannel
in interface AnalysisEngineController
public InputChannel getInputChannel()
getInputChannel
in interface AnalysisEngineController
public void dropCAS(org.apache.uima.cas.CAS aCAS)
dropCAS
in interface AnalysisEngineController
public void saveReplyTime(long snapshot, String aKey)
saveReplyTime
in interface AnalysisEngineController
public long getReplyTime()
getReplyTime
in interface AnalysisEngineController
protected void handleAction(String anAction, String anEndpoint, ErrorContext anErrorContext) throws Exception
Exception
public void forceTimeoutOnPendingCases(String key)
forceTimeoutOnPendingCases
in interface AnalysisEngineController
protected void plugInDefaultErrorHandlerChain()
public void setErrorHandlerChain(ErrorHandlerChain errorHandlerChain)
public ErrorHandlerChain getErrorHandlerChain()
getErrorHandlerChain
in interface AnalysisEngineController
public void dropCAS(String aCasReferenceId, boolean deleteCacheEntry)
dropCAS
in interface AnalysisEngineController
public void saveTime(long aTime, String aCasReferenceId, String anEndpointName)
saveTime
in interface AnalysisEngineController
public long getTime(String aCasReferenceId, String anEndpointName)
getTime
in interface AnalysisEngineController
protected void resetErrorCounter()
protected void incrementErrorCounter()
protected boolean exceedsThresholdWithinWindow(int threshold, long docCount, int windowSize)
public OutputChannel getOutputChannel()
getOutputChannel
in interface AnalysisEngineController
public void setOutputChannel(OutputChannel outputChannel) throws Exception
setOutputChannel
in interface AnalysisEngineController
Exception
public AsynchAECasManager getCasManagerWrapper()
getCasManagerWrapper
in interface AnalysisEngineController
public void setCasManager(AsynchAECasManager casManager)
setCasManager
in interface AnalysisEngineController
public InProcessCache getInProcessCache()
getInProcessCache
in interface AnalysisEngineController
protected org.apache.uima.resource.ResourceSpecifier getResourceSpecifier()
public String getName()
getName
in interface AnalysisEngineController
public String getKey()
getKey
in interface AnalysisEngineController
public void process(org.apache.uima.cas.CAS aCas, String aCasId)
process
in interface AnalysisEngineController
public void process(org.apache.uima.cas.CAS aCAS, String anInputCasReferenceId, String aNewCasReferenceId, String newCASProducedBy)
process
in interface AnalysisEngineController
public void process(org.apache.uima.cas.CAS aCAS, String aCasReferenceId, Endpoint anEndpoint)
process
in interface AnalysisEngineController
public void setUimaEEAdminContext(UimaEEAdminContext anAdminContext)
setUimaEEAdminContext
in interface AnalysisEngineController
public UimaEEAdminContext getUimaEEAdminContext()
getUimaEEAdminContext
in interface AnalysisEngineController
public void dropStats(String aCasReferenceId, String anEndpointName)
dropStats
in interface AnalysisEngineController
protected void logStats()
public ServicePerformance getCasStatistics(String aCasReferenceId)
getCasStatistics
in interface AnalysisEngineController
protected void logStats(String aDelegateKey, ServicePerformance aServicePerformance)
aDelegateKey
- aDelegateServicePerformance
- protected void clearStats()
public Map getStats()
getStats
in interface AnalysisEngineController
public void setDeployDescriptor(String aDeployDescriptor)
setDeployDescriptor
in interface AnalysisEngineController
public 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 AnalysisEngineController
public void cacheClientEndpoint(Endpoint anEndpoint)
cacheClientEndpoint
in interface AnalysisEngineController
anEndpoint
- public boolean isStopped()
isStopped
in interface AnalysisEngineController
public void setStopped()
AnalysisEngineController
setStopped
in interface AnalysisEngineController
protected void stopTransportLayer()
public void stop()
stop
in interface AnalysisEngineController
public void quiesceAndStop()
quiesceAndStop
in interface AnalysisEngineController
protected void stopDelegateTimers()
public void terminate()
terminate
in interface ControllerLifecycle
public void stopCasMultipliers()
protected void stopInputChannel()
protected void stopInputChannels(int channelsToStop)
public AnalysisEngineController getCasMultiplierController(String cmKey)
public InputChannel getInputChannel(String anEndpointName)
getInputChannel
in interface AnalysisEngineController
public InputChannel getReplyInputChannel(String aDelegateKey)
getReplyInputChannel
in interface AnalysisEngineController
public void onCacheEmpty()
onCacheEmpty
in interface EventSubscriber
public EventSubscriber getEventListener()
getEventListener
in interface AnalysisEngineController
public void addControllerCallbackListener(ControllerCallbackListener aListener)
addControllerCallbackListener
in interface ControllerLifecycle
aListener
- - application listener object to registerpublic void removeControllerCallbackListener(ControllerCallbackListener aListener)
removeControllerCallbackListener
in interface ControllerLifecycle
aListener
- - application listener to removepublic void notifyListenersWithInitializationStatus(Exception e)
notifyListenersWithInitializationStatus
in interface AnalysisEngineController
protected void dropCasStatistics(String aCasReferenceId)
public boolean isCasMultiplier()
isCasMultiplier
in interface AnalysisEngineController
public void releaseNextCas(String casReferenceId)
releaseNextCas
in interface AnalysisEngineController
public void beginProcess(int msgType)
beginProcess
in interface AnalysisEngineController
public void endProcess(int msgType)
endProcess
in interface AnalysisEngineController
public long getIdleTimeBetweenProcessCalls(int msgType)
getIdleTimeBetweenProcessCalls
in interface AnalysisEngineController
public long getIdleTime()
getIdleTime
in interface AnalysisEngineController
public long getCpuTime()
getCpuTime
in interface AnalysisEngineController
public long getAnalysisTime()
getAnalysisTime
in interface AnalysisEngineController
public void incrementSerializationTime(long cpuTime)
incrementSerializationTime
in interface AnalysisEngineController
public void incrementDeserializationTime(long cpuTime)
incrementDeserializationTime
in interface AnalysisEngineController
public void sendMetadata(Endpoint anEndpoint, org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData metadata)
public LocalCache getLocalCache()
getLocalCache
in interface AnalysisEngineController
public void addAbortedCasReferenceId(String aCasReferenceId)
addAbortedCasReferenceId
in interface AnalysisEngineController
protected boolean abortGeneratingCASes(String aCasReferenceId)
aCasReferenceId
- - id of the current input CAS being processedpublic boolean isAwaitingCacheCallbackNotification()
isAwaitingCacheCallbackNotification
in interface AnalysisEngineController
public void changeState(BaseAnalysisEngineController.ServiceState state)
changeState
in interface AnalysisEngineController
public BaseAnalysisEngineController.ServiceState getState()
getState
in interface AnalysisEngineController
public Map<String,String> getDeadClientMap()
getDeadClientMap
in interface AnalysisEngineController
Copyright © 2017. All rights reserved.