public class ProcessingContainer_Impl extends ProcessingContainer implements RunnableContainer
| Modifier and Type | Field and Description |
|---|---|
ServiceProxyPool |
casProcessorPool |
LinkedList |
failedCasProcessorList |
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXTDISABLED, INITIALIZED, KILLED, NOTINITIALIZED, RUNNING| Constructor and Description |
|---|
ProcessingContainer_Impl(CasProcessorConfiguration aCasProcessorConfig,
ProcessingResourceMetaData aMetaData,
ServiceProxyPool aCasProcessorPool)
Initialize container with CasProcessor configuration and pool containing instances of
CasProcessor instances.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
abortCPMOnError()
Returns true if maximum threshold for errors has been exceeded and the CasProcessor is
configured to force CPE shutdown.
|
void |
addBytesIn(long aBytesIn)
Aggregate total bytes ingested by the CasProcessor.
|
void |
addBytesOut(long aBytesOut)
Aggregate total bytes processed by this CasProcessor
|
void |
addStat(String aStatName,
Object aStat)
Add an arbitrary object and bind it to a given name
|
void |
destroy()
Destroy instances of CasProcessors managed by this container.
|
int |
getAbortCount()
Return the up todate number of aborts recorded by the container
|
HashMap |
getAllStats()
Returns all stats aggregate during the CPM run
|
long |
getBytesIn()
Returns total number of bytes ingested so far by all CasProcessor instances managed by this
container.
|
long |
getBytesOut()
Returns total number of bytes processed so far by all CasProcessor instances managed by this
container.
|
CasProcessor |
getCasProcessor()
Returns available instance of the CasProcessor from the instance pool.
|
CasProcessorConfiguration |
getCasProcessorConfiguration()
Returns CasProcessor configuration object.
|
Object |
getConfigParameterValue(String aParamName)
Looks up the value of a configuration parameter.
|
Object |
getConfigParameterValue(String aGroupName,
String aParamName)
Looks up the value of a configuration parameter in a group.
|
CasProcessorDeployer |
getDeployer()
Returns deployer object used to launch the CasProcessor
|
long |
getFetchTime() |
int |
getFilteredCount()
Returns number of filtered Cas'es
|
Object |
getLastCas()
Deprecated.
|
String |
getLastProcessedEntityId()
Returns id of the last entity processed by the CasProcessor
|
ProcessingResourceMetaData |
getMetadata()
Returns component's input/output capabilities
|
ResourceMetaData |
getMetaData()
Gets the metadata that describes this
Resource. |
String |
getName()
Returns the name of this container.
|
ServiceProxyPool |
getPool() |
long |
getProcessed()
Returns number of entities processed so far.
|
long |
getRemaining()
Returns number of entities still to be processed by the CasProcessor It is a delta of total
number of entities to be processed by the CPE minus number of entities processed so far.
|
int |
getRestartCount()
Returns total number of all CasProcessor restarts.
|
int |
getRetryCount()
Return the up todate number of retries recorded by the container.
|
Object |
getStat(String aStatName)
Return an abject identified with a given name
|
int |
getStatus()
Returns the current status of the CasProcessor
|
long |
getTotalTime()
Returns total time spent in process()
|
void |
incrementAbortCount(int aCount)
Increment number of aborted Cas'es due to inability to process the Cas
|
void |
incrementCasProcessorErrors(Throwable aThrowable)
This routine determines what to do with an exception thrown during the CasProcessor processing.
|
void |
incrementFilteredCount(int aCount)
Increments number of CAS'es filtered by the CasProcessor.
|
void |
incrementProcessed(int aIncrement) |
void |
incrementRestartCount(int aCount)
Increment number of times the casProcessor was restarted due to failures
|
void |
incrementRetryCount(int aCount)
Increments number of times CasProceesor failed analyzing Cas'es due to timeout or some other
problems
|
void |
incrementStat(String aStatName,
Integer aStat)
Increment a value of a given stat
|
void |
incrementTotalTime(long aTime)
Increments total time spend in the process() method of the CasProcessor
|
boolean |
initialize(ResourceSpecifier aSpecifier,
Map aAdditionalParams)
Initializes this
Resource from a ResourceSpecifier. |
boolean |
isAbortable()
Determines if instances of CasProcessor managed by this container are abortable.
|
boolean |
isEndOfBatch(CasProcessor aCasProcessor,
int aProcessedSize) |
boolean |
isIntegrated()
Deprecated.
|
boolean |
isLocal()
Deprecated.
|
boolean |
isPaused() |
boolean |
isRemote()
Deprecated.
|
boolean |
isSingleFencedService() |
void |
logAbortedCases(Object[] abortedCasList)
Logs Cas'es that could not be processed.
|
void |
pause()
Pauses the container until resumed.
|
boolean |
processCas(Object[] aCasList)
Returns true if the Cas bundles should be processed by the CasProcessor.
|
void |
reconfigure()
Instructs this Resource to re-read its configuration parameter settings.
|
void |
releaseCasProcessor(CasProcessor aCasProcessor)
Returns a given casProcessor instance back to the pool.
|
void |
resetRestartCount() |
void |
resume() |
void |
run() |
void |
setCasProcessorDeployer(CasProcessorDeployer aDeployer)
Plug in deployer object used to launch/deploy the CasProcessor instance.
|
void |
setConfigParameterValue(String aParamName,
Object aValue)
Sets the value of a configuration parameter.
|
void |
setConfigParameterValue(String aGroupName,
String aParamName,
Object aValue)
Sets the value of a configuration parameter in a group.
|
void |
setLastCas(Object aCasObject)
Deprecated.
|
void |
setLastProcessedEntityId(String aEntityId)
Copies id of the last entity processed by the CasProcessor
|
void |
setMetadata(ProcessingResourceMetaData aMetadata)
Sets component's input/output capabilities
|
void |
setProcessed(long aProcessedCount)
Used when recovering from checkpoint, sets the total number of entities before CPE stopped.
|
void |
setRemaining(long aRemainingCount)
Copies number of entities the CasProcessor has yet to process.
|
void |
setSingleFencedService(boolean aSingleFencedInstance) |
void |
setStatus(int aStatus)
Changes the status of the CasProcessor as a group
|
void |
start()
Deprecated.
|
void |
stop()
Deprecated.
|
getCasManager, getLogger, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger, setMetaDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogger, getResourceManager, getUimaContext, getUimaContextAdmin, setLoggerpublic ServiceProxyPool casProcessorPool
public LinkedList failedCasProcessorList
public ProcessingContainer_Impl(CasProcessorConfiguration aCasProcessorConfig, ProcessingResourceMetaData aMetaData, ServiceProxyPool aCasProcessorPool) throws ResourceConfigurationException
aCasProcessorConfig - -
CasProcessor configuration as defined in cpe descriptoraCasProcessorPool - -
pool of CasProcessor instancesResourceConfigurationExceptionpublic ProcessingResourceMetaData getMetadata()
public void setMetadata(ProcessingResourceMetaData aMetadata)
setMetadata in class ProcessingContaineraMetadata - component capabilitiespublic void setCasProcessorDeployer(CasProcessorDeployer aDeployer)
setCasProcessorDeployer in class ProcessingContaineraDeployer - -
object responsible for deploying/launching CasProcessorpublic CasProcessorDeployer getDeployer()
getDeployer in class ProcessingContainerpublic void logAbortedCases(Object[] abortedCasList)
logAbortedCases in class ProcessingContainerabortedCasList - -
an arrar of Cas'es that could not be processed by this CasProcessorpublic long getBytesIn()
getBytesIn in class ProcessingContainerpublic void addBytesIn(long aBytesIn)
addBytesIn in class ProcessingContaineraBytesIn - - number of ingested bytespublic long getBytesOut()
getBytesOut in class ProcessingContainerpublic void addBytesOut(long aBytesOut)
addBytesOut in class ProcessingContainerpublic void incrementRestartCount(int aCount)
incrementRestartCount in class ProcessingContaineraCount - - restart countpublic int getRestartCount()
getRestartCount in class ProcessingContainerpublic void incrementRetryCount(int aCount)
incrementRetryCount in class ProcessingContaineraCount - - failure countpublic int getRetryCount()
getRetryCount in class ProcessingContainerpublic void incrementAbortCount(int aCount)
incrementAbortCount in class ProcessingContaineraCount - - number of aborts while processing Cas'espublic int getAbortCount()
getAbortCount in class ProcessingContainerpublic void incrementFilteredCount(int aCount)
incrementFilteredCount in class ProcessingContaineraCount - -
number of filtered Cas'espublic int getFilteredCount()
getFilteredCount in class ProcessingContainerpublic long getRemaining()
getRemaining in class ProcessingContainerpublic void setRemaining(long aRemainingCount)
setRemaining in class ProcessingContaineraRemainingCount - -
number of entities to processpublic void setLastProcessedEntityId(String aEntityId)
setLastProcessedEntityId in class ProcessingContaineraEntityId - - id of the entitypublic String getLastProcessedEntityId()
getLastProcessedEntityId in class ProcessingContainer@Deprecated public void setLastCas(Object aCasObject)
setLastCas in class ProcessingContainer@Deprecated public Object getLastCas()
getLastCas in class ProcessingContainerpublic void incrementProcessed(int aIncrement)
public void setProcessed(long aProcessedCount)
setProcessed in class ProcessingContaineraProcessedCount - - number of entities processed before CPE stoppedpublic long getProcessed()
getProcessed in class ProcessingContainerpublic void resetRestartCount()
resetRestartCount in class ProcessingContainerpublic void incrementTotalTime(long aTime)
incrementTotalTime in class ProcessingContaineraTime - -
total time in process()public long getTotalTime()
getTotalTime in class ProcessingContainerpublic boolean abortCPMOnError()
abortCPMOnError in class ProcessingContainerpublic void incrementCasProcessorErrors(Throwable aThrowable) throws Exception
incrementCasProcessorErrors in class ProcessingContaineraThrowable - - exception to examineAbortCPMException - -
force the CPE to stop processingAbortCasProcessorException - -
disables all instances of CasProcessor in this containerServiceConnectionException - -
forces the restart/relauch of the failed CasProcessorSkipCasException - -
disregard error, skip bad Cas'es and continue with the next Cas bundleExceptionpublic boolean isEndOfBatch(CasProcessor aCasProcessor, int aProcessedSize) throws ResourceProcessException, IOException
isEndOfBatch in class ProcessingContainerResourceProcessExceptionIOExceptionpublic boolean processCas(Object[] aCasList)
processCas in class ProcessingContaineraCasList - -
bundle containing instances of CASpublic CasProcessorConfiguration getCasProcessorConfiguration()
getCasProcessorConfiguration in class ProcessingContainerCasProcessorConfiguration instance@Deprecated public void start()
RunnableContainerstart in interface RunnableContainer@Deprecated public void stop()
RunnableContainerstop in interface RunnableContainerpublic CasProcessor getCasProcessor()
getCasProcessor in interface CasProcessorControllerpublic void releaseCasProcessor(CasProcessor aCasProcessor)
releaseCasProcessor in class ProcessingContaineraCasProcessor - -
an instance of CasProcessor to return back to the poolProcessingContainer.releaseCasProcessor(org.apache.uima.collection.base_cpm.CasProcessor)public int getStatus()
getStatus in interface CasProcessorControllerpublic void setStatus(int aStatus)
setStatus in interface CasProcessorControlleraStatus - -
new status@Deprecated public boolean isLocal()
CasProcessorControllerisLocal in interface CasProcessorController@Deprecated public boolean isRemote()
CasProcessorControllerisRemote in interface CasProcessorController@Deprecated public boolean isIntegrated()
CasProcessorControllerisIntegrated in interface CasProcessorControllerpublic boolean isAbortable()
isAbortable in interface CasProcessorControllerpublic boolean initialize(ResourceSpecifier aSpecifier, Map aAdditionalParams) throws ResourceInitializationException
ResourceResource from a ResourceSpecifier. Applications
do not need to call this method. It is called automatically by the ResourceFactory
and cannot be called a second time.initialize in interface Resourceinitialize in class Resource_ImplBaseaSpecifier - specifies how to create a resource or locate an existing resource service.aAdditionalParams - a Map containing additional parameters. May be null if there are no
parameters. Each class that implements this interface can decide what additional
parameters it supports.ResourceSpecifier is not of an appropriate type for this Resource. If
the ResourceSpecifier is of an appropriate type but is invalid or if
some other failure occurs, an exception should be thrown.ResourceInitializationException - if a failure occurs during initialization.multi-thread safe, given that each instance of this class is only called on one thread, once.
The critical parts that update shared information (in shared uima context) are inside a synchronize blockpublic void destroy()
destroy in interface Resourcedestroy in class Resource_ImplBaseResource.destroy()public Object getConfigParameterValue(String aParamName)
ConfigurableResource
This method returns null if the parameter is optional and has not been assigned
a value. (For mandatory parameters, an exception is thrown during initialization if no value
has been assigned.) This method also returns null if there is no declared
configuration parameter with the specified name.
getConfigParameterValue in interface ConfigurableResourceaParamName - the name of a parameter that is not in any groupaParamName, null is
either the parameter does not exist or it has not been assigned a value.public Object getConfigParameterValue(String aGroupName, String aParamName)
ConfigurableResource
This method returns null if the parameter is optional and has not been assigned
a value. (For mandatory parameters, an exception is thrown during initialization if no value
has been assigned.) This method also returns null if there is no declared
configuration parameter with the specified name.
getConfigParameterValue in interface ConfigurableResourceaGroupName - the name of a configuration group. If the group name is
null, this method will return the same value as
getParameterValue(String).aParamName - the name of a parameter in the groupaGroupName with
name aParamName,,null is either the
parameter does not exist or it has not been assigned a value.public void setConfigParameterValue(String aParamName, Object aValue)
ConfigurableResourceConfigurableResource.reconfigure() is called.setConfigParameterValue in interface ConfigurableResourceaParamName - the name of a parameter that is not in any groupaValue - the value to assign to the parameterpublic void setConfigParameterValue(String aGroupName, String aParamName, Object aValue)
ConfigurableResourceConfigurableResource.reconfigure() is called.setConfigParameterValue in interface ConfigurableResourceaGroupName - the name of a configuration group. If this parameter is
null, this method will have the same effect as
setParameterValue(String,Object).aParamName - the name of a parameter in the groupaValue - the value to assign to the parameter.public void reconfigure()
throws ResourceConfigurationException
ConfigurableResourcereconfigure in interface ConfigurableResourceResourceConfigurationException - if the configuration is not validpublic String getName()
getName in class ProcessingContainerpublic ResourceMetaData getMetaData()
ResourceResource.getMetaData in interface ResourcegetMetaData in class Resource_ImplBaseResource.getMetaData()public void incrementStat(String aStatName, Integer aStat)
incrementStat in class ProcessingContainerpublic void addStat(String aStatName, Object aStat)
addStat in class ProcessingContainerpublic Object getStat(String aStatName)
getStat in class ProcessingContainerpublic HashMap getAllStats()
getAllStats in class ProcessingContainerpublic void pause()
pause in class ProcessingContainerpublic void resume()
resume in class ProcessingContainerpublic boolean isPaused()
isPaused in class ProcessingContainerpublic ServiceProxyPool getPool()
getPool in class ProcessingContainerpublic void setSingleFencedService(boolean aSingleFencedInstance)
setSingleFencedService in class ProcessingContainerpublic boolean isSingleFencedService()
isSingleFencedService in class ProcessingContainerpublic long getFetchTime()
Copyright © 2018. All rights reserved.