Package org.apache.uima.aae.controller
Class AggregateAnalysisEngineController_impl
java.lang.Object
org.apache.uima.resource.Resource_ImplBase
org.apache.uima.aae.controller.BaseAnalysisEngineController
org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl
- All Implemented Interfaces:
Serializable
,AggregateAnalysisEngineController
,AggregateAnalysisEngineController_implMBean
,AnalysisEngineController
,BaseAnalysisEngineControllerMBean
,ControllerLifecycle
,EventSubscriber
,org.apache.uima.resource.Resource
public class AggregateAnalysisEngineController_impl
extends BaseAnalysisEngineController
implements AggregateAnalysisEngineController, AggregateAnalysisEngineController_implMBean
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.uima.aae.controller.BaseAnalysisEngineController
BaseAnalysisEngineController.ServiceState
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<AnalysisEngineController>
protected boolean
final Object
Fields inherited from class org.apache.uima.aae.controller.BaseAnalysisEngineController
abortedCasesMap, aeDescriptor, allDelegatesAreRemote, awaitingCacheCallbackNotification, callbackMonitor, callbackReceived, clientEndpoint, cmOutstandingCASes, componentCasPoolSize, controllerListeners, currentState, deadClientDestinationMap, delegateKey, delegates, errorCount, errorHandlerChain, finalStepMux, idleTime, inputChannel, inputChannelList, inputChannelMap, jmxContext, latch, localCache, messageListeners, monitor, NO_RECOVERY, paramsMap, parentController, perCasStatistics, processPid, replyTime, resourceSpecifier, serviceErrorMap, serviceErrors, serviceInitialized, servicePerformance, statsMap, stopped, syncObject, transports, unregisteredDelegateList
Fields inherited from interface org.apache.uima.aae.controller.AnalysisEngineController
AEInstanceCount, CasPoolSize
Fields inherited from interface org.apache.uima.resource.Resource
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
-
Constructor Summary
ConstructorsConstructorDescriptionAggregateAnalysisEngineController_impl
(String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap) AggregateAnalysisEngineController_impl
(AnalysisEngineController aParentController, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap) AggregateAnalysisEngineController_impl
(AnalysisEngineController aParentController, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap, JmxManagement aJmxManagement) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessageOrigin
(String aCasReferenceId, Endpoint anEndpoint) void
changeCollocatedDelegateState
(String delegateKey, BaseAnalysisEngineController.ServiceState state) void
cleanUp()
void
collectionProcessComplete
(Endpoint anEndpoint) boolean
continueOnError
(String aCasReferenceId, String aDelegateKey, Exception anException) boolean
delayCasIfDelegateInTimedOutState
(String aCasReferenceId, String aDelegateKey) Checks the state of a delegate to see if it is in TIMEOUT State.void
disableDelegates
(List aDelegateList) protected void
disableDelegates
(List aDelegateList, String aCasReferenceId) void
dispatchMetadataRequest
(Endpoint anEndpoint) void
void
void
dumpState
(StringBuffer buffer, String lbl1) void
enableDelegates
(List aDelegateList) void
getDelegateServiceErrors
(String aDelegateKey) getDelegateServiceInfo
(String aDelegateKey) getDelegateServicePerformance
(String aDelegateKey) getLastDelegateKeyFromFlow
(String anInputCasReferenceId) getMessageOrigin
(String aCasReferenceId) getServiceErrors
(String aDelegateKey) getServicePerformance
(String aDelegateKey) void
handleDelegateLifeCycleEvent
(String anEndpoint, int aDelegateCount) void
void
incrementAnalysisTime
(long anAnalysisTime) Accumulate analysis time for the aggregatevoid
boolean
isDelegateDisabled
(String aDelegateKey) boolean
isDelegateKeyValid
(String aDelegateKey) boolean
lookupDelegate
(String aDelegateKey) ReturnDelegate
object for a given delegate key.lookUpDelegateKey
(String anEndpointName) lookUpDelegateKey
(String anEndpointName, String server) Returns a delegate key given an endpoint (queue) name and a server uri.lookUpEndpoint
(String anAnalysisEngineKey, boolean clone) void
mapEndpointsToKeys
(ConcurrentHashMap aDestinationMap) void
mergeTypeSystem
(String aTypeSystem, String fromDestination) void
mergeTypeSystem
(String aTypeSystem, String fromDestination, String fromServer) void
Force all collocated delegates to perform any post-initialization steps.void
This is a process method that is executed for CASes not created by a Multiplier in this aggregate.void
process
(org.apache.uima.cas.CAS aCAS, String anInputCasReferenceId, String aNewCasReferenceId, String newCASProducedBy) This routine is called to handle CASes produced by a CAS Multiplier.void
processCollectionCompleteReplyFromDelegate
(String aDelegateKey, boolean sendReply) void
registerChildController
(AnalysisEngineController aChildController, String aDelegateKey) boolean
releaseParentCas
(boolean casDropped, boolean clientIsCollocated, LocalCache.CasStateEntry parentCasStateEntry) void
removeMessageOrigin
(String aCasReferenceId) boolean
void
retryLastCommand
(int aCommand, Endpoint anEndpoint, String aCasReferenceId) void
retryMetadataRequest
(Endpoint anEndpoint) void
retryProcessCASRequest
(String aCasReferenceId, Endpoint anEndpoint, boolean addEndpointToCache) void
saveStatsFromService
(String aServiceEndpointName, Map aServiceStats) void
sendMetadata
(Endpoint anEndpoint) void
void
setCasLoggingDirectory
(String key, String directory) void
setControllerBeanName
(String aBeanName) void
setDescriptor
(String descriptor) void
setFlowControllerDescriptor
(String aFlowControllerDescriptor) void
setMonitor
(Monitor monitor) void
void
setServiceEndpointName
(String anEndpointName) void
stop()
Stops input channel(s) and initiates a shutdown of all delegates ( if this is an aggregate ).void
void
takeAction
(String anAction, String anEndpointName, ErrorContext anErrorContext) Methods inherited from class org.apache.uima.aae.controller.BaseAnalysisEngineController
abortGeneratingCASes, addAbortedCasReferenceId, addControllerCallbackListener, addInputChannel, addServiceInfo, beginProcess, cacheClientEndpoint, changeState, clearStats, dropCAS, dropCasStatistics, dropStats, endProcess, exceedsThresholdWithinWindow, forceTimeoutOnPendingCases, getAnalysisTime, getBrokerURL, getCasManagerWrapper, getCasMultiplierController, getCasStatistics, getChildUimaContext, getClientEndpoint, getComponentName, getCpuTime, getDeadClientMap, getDeploymentDescriptor, getDeploymentMode, getErrorHandlerChain, getEventListener, getIdleTime, getIdleTimeBetweenProcessCalls, getIndex, getInProcessCache, getInputChannel, getInputChannel, getInputQueue, getJmxContext, getJMXDomain, getKey, getManagementInterface, getName, getOutputChannel, getParentController, getReplyInputChannel, getReplyTime, getResourceSpecifier, getServiceErrors, getServiceName, getServicePerformance, getState, getStats, getTime, getTotalNumberOfCASesDropped, getTotalNumberOfCASesProcessed, getTotalNumberOfCASesReceived, getTotalNumberOfErrors, getTotalTimeSpendDeSerializingCAS, getTotalTimeSpentSerializingCAS, getTotalTimeSpentWaitingForFreeCASInstance, getTransport, getTransport, getTransport, getUimaEEAdminContext, getUimaMessageListener, handleAction, handleError, incrementDeserializationTime, incrementErrorCounter, incrementSerializationTime, initializeVMTransport, isAwaitingCacheCallbackNotification, isCasMultiplier, isStopped, isTopLevelComponent, logStats, logStats, notifyListenersWithInitializationStatus, onCacheEmpty, plugInDefaultErrorHandlerChain, process, quiesceAndStop, registerServiceWithJMX, registerVmQueueWithJMX, registerWithAgent, releaseNextCas, removeControllerCallbackListener, resetErrorCounter, saveReplyTime, saveTime, sendMetadata, setCasManager, setDeployDescriptor, setErrorHandlerChain, setInputChannel, setJmxManagement, setOutputChannel, setStopped, setUimaEEAdminContext, stop, stopCasMultiplier, stopCasMultipliers, stopDelegateTimers, stopInputChannel, stopInputChannels, stopTransportLayer, terminate, terminate, toString
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.AggregateAnalysisEngineController
getChildUimaContext, stopCasMultiplier
Methods inherited from interface org.apache.uima.aae.controller.AnalysisEngineController
addAbortedCasReferenceId, addInputChannel, addServiceInfo, beginProcess, cacheClientEndpoint, changeState, dropCAS, dropStats, endProcess, forceTimeoutOnPendingCases, getAnalysisTime, getCasManagerWrapper, getCasStatistics, getClientEndpoint, getComponentName, getCpuTime, getDeadClientMap, getErrorHandlerChain, getEventListener, getIdleTime, getIdleTimeBetweenProcessCalls, getIndex, getInProcessCache, getInputChannel, getInputChannel, getJmxContext, getJMXDomain, getKey, getManagementInterface, getName, getOutputChannel, getParentController, getReplyInputChannel, getReplyTime, getServiceErrors, getServicePerformance, getState, getStats, getTime, getTransport, getTransport, getUimaEEAdminContext, getUimaMessageListener, incrementDeserializationTime, incrementSerializationTime, initializeVMTransport, isAwaitingCacheCallbackNotification, isCasMultiplier, isStopped, isTopLevelComponent, notifyListenersWithInitializationStatus, process, quiesceAndStop, registerVmQueueWithJMX, releaseNextCas, saveReplyTime, saveTime, setCasManager, setDeployDescriptor, setInputChannel, setOutputChannel, setStopped, setUimaEEAdminContext
Methods inherited from interface org.apache.uima.aae.controller.BaseAnalysisEngineControllerMBean
getBrokerURL, getComponentName, getDeploymentDescriptor, getDeploymentMode, getIdleTime, getInputQueue, getServiceName, getTotalNumberOfCASesDropped, getTotalNumberOfCASesProcessed, getTotalNumberOfCASesReceived, getTotalNumberOfErrors, getTotalTimeSpendDeSerializingCAS, getTotalTimeSpentSerializingCAS, getTotalTimeSpentWaitingForFreeCASInstance
Methods inherited from interface org.apache.uima.aae.controller.ControllerLifecycle
addControllerCallbackListener, removeControllerCallbackListener, terminate
-
Field Details
-
initialized
protected volatile boolean initialized -
childControllerList
-
parallelStepMux
-
-
Constructor Details
-
AggregateAnalysisEngineController_impl
public AggregateAnalysisEngineController_impl(String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap) throws Exception - Parameters:
anEndpointName
-aDescriptor
-aCasManager
-anInProcessCache
-aDestinationMap
-- Throws:
Exception
-
AggregateAnalysisEngineController_impl
public AggregateAnalysisEngineController_impl(AnalysisEngineController aParentController, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap) throws Exception - Parameters:
aParentController
-anEndpointName
-aDescriptor
-aCasManager
-anInProcessCache
-aDestinationMap
-- Throws:
Exception
-
AggregateAnalysisEngineController_impl
public AggregateAnalysisEngineController_impl(AnalysisEngineController aParentController, String anEndpointName, String aDescriptor, AsynchAECasManager aCasManager, InProcessCache anInProcessCache, Map aDestinationMap, JmxManagement aJmxManagement) throws Exception - Throws:
Exception
-
-
Method Details
-
registerChildController
public void registerChildController(AnalysisEngineController aChildController, String aDelegateKey) throws Exception - Specified by:
registerChildController
in interfaceAggregateAnalysisEngineController
- Throws:
Exception
-
saveStatsFromService
- Specified by:
saveStatsFromService
in interfaceAggregateAnalysisEngineController
-
addMessageOrigin
- Specified by:
addMessageOrigin
in interfaceAggregateAnalysisEngineController
-
isDelegateDisabled
- Specified by:
isDelegateDisabled
in interfaceAggregateAnalysisEngineController
-
setServiceEndpointName
- Parameters:
anEndpointName
-
-
getServiceEndpointName
- Specified by:
getServiceEndpointName
in interfaceAnalysisEngineController
-
setControllerBeanName
- Parameters:
aBeanName
-
-
getMessageOrigin
- Specified by:
getMessageOrigin
in interfaceAggregateAnalysisEngineController
-
removeMessageOrigin
- Specified by:
removeMessageOrigin
in interfaceAggregateAnalysisEngineController
-
dropCAS
- Specified by:
dropCAS
in interfaceAnalysisEngineController
- Overrides:
dropCAS
in classBaseAnalysisEngineController
-
dropFlow
- Specified by:
dropFlow
in interfaceAggregateAnalysisEngineController
-
mapEndpointsToKeys
- Specified by:
mapEndpointsToKeys
in interfaceAggregateAnalysisEngineController
-
getDelegateStats
- Specified by:
getDelegateStats
in interfaceAggregateAnalysisEngineController
-
processCollectionCompleteReplyFromDelegate
public void processCollectionCompleteReplyFromDelegate(String aDelegateKey, boolean sendReply) throws AsynchAEException - Specified by:
processCollectionCompleteReplyFromDelegate
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
setFlowControllerDescriptor
- Parameters:
aFlowControllerDescriptor
-
-
takeAction
- Specified by:
takeAction
in interfaceAnalysisEngineController
-
collectionProcessComplete
- Specified by:
collectionProcessComplete
in interfaceAnalysisEngineController
- Throws:
AsynchAEException
-
getDescriptor
-
setDescriptor
-
isPrimitive
public boolean isPrimitive()- Specified by:
isPrimitive
in interfaceAnalysisEngineController
-
getDestinations
- Specified by:
getDestinations
in interfaceAggregateAnalysisEngineController
-
enableDelegates
- Specified by:
enableDelegates
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
handleInitializationError
-
disableDelegates
- Specified by:
disableDelegates
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
disableDelegates
protected void disableDelegates(List aDelegateList, String aCasReferenceId) throws AsynchAEException - Throws:
AsynchAEException
-
continueOnError
public boolean continueOnError(String aCasReferenceId, String aDelegateKey, Exception anException) throws AsynchAEException - Specified by:
continueOnError
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
getLastDelegateKeyFromFlow
- Specified by:
getLastDelegateKeyFromFlow
in interfaceAggregateAnalysisEngineController
-
process
public void process(org.apache.uima.cas.CAS aCAS, String anInputCasReferenceId, String aNewCasReferenceId, String newCASProducedBy) This routine is called to handle CASes produced by a CAS Multiplier. A new CAS needs a flow object which is produced here from the Flow associated with the input CAS. Once the subflow is computed, it is cached for future use.- Specified by:
process
in interfaceAnalysisEngineController
- Overrides:
process
in classBaseAnalysisEngineController
- Parameters:
aCAS
- - CAS to processanInputCasReferenceId
- - reference id of the input CASaNewCasReferenceId
- - reference id of the CAS created by the CAS multipliernewCASProducedBy
- - name of the multiplier that created the CAS- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
AsynchAEException
-
process
This is a process method that is executed for CASes not created by a Multiplier in this aggregate.- Specified by:
process
in interfaceAnalysisEngineController
- Overrides:
process
in classBaseAnalysisEngineController
-
sendRequestForMetadataToRemoteDelegates
- Specified by:
sendRequestForMetadataToRemoteDelegates
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
finalStep
- Specified by:
finalStep
in interfaceAggregateAnalysisEngineController
-
releaseParentCas
public boolean releaseParentCas(boolean casDropped, boolean clientIsCollocated, LocalCache.CasStateEntry parentCasStateEntry) -
delayCasIfDelegateInTimedOutState
public boolean delayCasIfDelegateInTimedOutState(String aCasReferenceId, String aDelegateKey) throws AsynchAEException Checks the state of a delegate to see if it is in TIMEOUT State. If it is, push the CAS id onto a list of CASes pending dispatch. The delegate is in a questionable state and the aggregate sends a ping message to check delegate's availability. If the delegate responds to the ping, all CASes in the pending dispatch list will be immediately dispatched.- Specified by:
delayCasIfDelegateInTimedOutState
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
retryProcessCASRequest
public void retryProcessCASRequest(String aCasReferenceId, Endpoint anEndpoint, boolean addEndpointToCache) throws AsynchAEException - Specified by:
retryProcessCASRequest
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
isDelegateKeyValid
- Specified by:
isDelegateKeyValid
in interfaceAggregateAnalysisEngineController
-
lookUpDelegateKey
- Specified by:
lookUpDelegateKey
in interfaceAggregateAnalysisEngineController
-
lookUpDelegateKey
Returns a delegate key given an endpoint (queue) name and a server uri. If a server is null, only the endpoint name will be used for matching.- Specified by:
lookUpDelegateKey
in interfaceAggregateAnalysisEngineController
-
lookUpEndpoint
- Specified by:
lookUpEndpoint
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
getDelegateServiceInfo
- Specified by:
getDelegateServiceInfo
in interfaceAggregateAnalysisEngineController
-
getDelegateServicePerformance
- Specified by:
getDelegateServicePerformance
in interfaceAggregateAnalysisEngineController
-
getDelegateServiceErrors
- Specified by:
getDelegateServiceErrors
in interfaceAggregateAnalysisEngineController
-
mergeTypeSystem
- Specified by:
mergeTypeSystem
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
mergeTypeSystem
public void mergeTypeSystem(String aTypeSystem, String fromDestination, String fromServer) throws AsynchAEException - Specified by:
mergeTypeSystem
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
initialize
- Specified by:
initialize
in interfaceAnalysisEngineController
- Throws:
AsynchAEException
-
dispatchMetadataRequest
- Specified by:
dispatchMetadataRequest
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
retryMetadataRequest
- Specified by:
retryMetadataRequest
in interfaceAggregateAnalysisEngineController
- Throws:
AsynchAEException
-
sendMetadata
- Specified by:
sendMetadata
in interfaceAnalysisEngineController
-
getControllerLatch
- Specified by:
getControllerLatch
in interfaceAnalysisEngineController
-
getMonitor
- Specified by:
getMonitor
in interfaceAnalysisEngineController
-
setMonitor
-
handleDelegateLifeCycleEvent
- Specified by:
handleDelegateLifeCycleEvent
in interfaceAnalysisEngineController
-
retryLastCommand
- Specified by:
retryLastCommand
in interfaceAggregateAnalysisEngineController
-
getServiceErrors
-
getServiceInfo
- Specified by:
getServiceInfo
in interfaceAggregateAnalysisEngineController
- Specified by:
getServiceInfo
in interfaceAnalysisEngineController
-
getServicePerformance
- Specified by:
getServicePerformance
in interfaceAggregateAnalysisEngineController
-
incrementAnalysisTime
public void incrementAnalysisTime(long anAnalysisTime) Accumulate analysis time for the aggregate- Parameters:
anAnalysisTime
-
-
stopTimers
public void stopTimers()- Specified by:
stopTimers
in interfaceAggregateAnalysisEngineController
-
requestForMetaSentToRemotes
public boolean requestForMetaSentToRemotes()- Specified by:
requestForMetaSentToRemotes
in interfaceAggregateAnalysisEngineController
-
setRequestForMetaSentToRemotes
public void setRequestForMetaSentToRemotes()- Specified by:
setRequestForMetaSentToRemotes
in interfaceAggregateAnalysisEngineController
-
cleanUp
public void cleanUp()- Overrides:
cleanUp
in classBaseAnalysisEngineController
-
stop
public void stop()Description copied from class:BaseAnalysisEngineController
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:
stop
in interfaceAnalysisEngineController
- Overrides:
stop
in classBaseAnalysisEngineController
-
getChildControllerList
- Specified by:
getChildControllerList
in interfaceAggregateAnalysisEngineController
-
onInitialize
public void onInitialize()Force all collocated delegates to perform any post-initialization steps.- Specified by:
onInitialize
in interfaceAnalysisEngineController
-
changeCollocatedDelegateState
public void changeCollocatedDelegateState(String delegateKey, BaseAnalysisEngineController.ServiceState state) throws Exception - Specified by:
changeCollocatedDelegateState
in interfaceAggregateAnalysisEngineController
- Throws:
Exception
-
dumpState
- Specified by:
dumpState
in interfaceAnalysisEngineController
- Specified by:
dumpState
in classBaseAnalysisEngineController
-
getLocalCache
- Specified by:
getLocalCache
in interfaceAnalysisEngineController
- Overrides:
getLocalCache
in classBaseAnalysisEngineController
-
lookupDelegate
ReturnDelegate
object for a given delegate key.- Specified by:
lookupDelegate
in interfaceAggregateAnalysisEngineController
-
setCasLoggingDirectory
- Specified by:
setCasLoggingDirectory
in interfaceAggregateAnalysisEngineController
-