Interface CpeDescription
- All Superinterfaces:
Cloneable
,MetaDataObject
,Serializable
,XMLizable
- All Known Implementing Classes:
CpeDescriptionImpl
Java representation of a Collection Processing Engine (CPE) XML descriptor. Generate an instance
of this class by calling either the
XMLParser.parseCpeDescription(XMLInputSource)
or
org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory#produceDescriptor(). A CPE
instance can then be created by calling
UIMAFramework.produceCollectionProcessingEngine(CpeDescription)
.-
Method Summary
Modifier and TypeMethodDescriptionaddCasInitializer
(String aCasInitializerPath) Deprecated.As of v2.0 CAS Initializers are deprecated.void
addCasProcessor
(int index, CpeCasProcessor aCasProcessor) Adds a instance ofCpeCasProcessor
at a specified location in the list of CPE CasProcessors.void
addCasProcessor
(CpeCasProcessor aCasProcessor) Appends a instance ofCpeCasProcessor
to the end of the list containing CPE CasProcessors.addCollectionReader
(String aCollectionReaderPath) Adds a path to the descriptor file containing CollectionReader's configuration.void
addCollectionReader
(CpeCollectionReader aCollectionReader) Returns a list ofCpeCollectionReader
instances representing ALL defined CollectionReaders.Returns aCpeCasProcessors
instance containing processing pipeline spec.Returns the CPE configuration that includes: An ID of the entity to begin processing with (OPTIONAL) Number of entities to process Checkpoint definition (checkpoint file, frequency) A name of the class implementingUimaTimer
interface.Returns ResourceManagerConfiguration instance.void
void
setCheckpoint
(String aCheckpointFile, int aFrequency) Add checkpoint file and frequency (in millis) of checkpointsvoid
setCpeCasProcessors
(CpeCasProcessors aCasProcessors) void
setCpeConfiguration
(CpeConfiguration aConfiguration) void
setCpeResourceManagerConfiguration
(CpeResourceManagerConfiguration aResMgrConfPagth) Defines the path to Resource Manager Configurationvoid
setDeployment
(String aDeployMode) Define startup mode for the CPE.void
setInputQueueSize
(int aSize) Defines the size for the InputQueue.void
setNumToProcess
(long aEntityCount) Defines number of entities to process by the CPE.void
setOutputQueueSize
(int aSize) Defines the size for the OutputQueue.void
setProcessingUnitThreadCount
(int aSize) void
setResourceManagerConfiguration
(String aResMgrConfPagth) Defines the path to Resource Manager Configurationvoid
setStartingEntityId
(String aStartEntityId) Defines an id of the first entity to process.void
Add name of the class that implements (@link org.apache.uima.util.UimaTimer} interface.void
toXML
(OutputStream aStream) Generates XML for the CPE Descriptor and writes it out to the provided OutputStream.Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl
Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML
-
Method Details
-
addCollectionReader
- Throws:
CpeDescriptorException
-
addCollectionReader
Adds a path to the descriptor file containing CollectionReader's configuration. The CPE supports only one CollectionReader instance.This method causes the CPE descriptor to use the older <include> syntax. To use the <import> syntax, you must use
addCollectionReader(CpeCollectionReader)
instead.- Parameters:
aCollectionReaderPath
- - path to the CollectionReader descriptor. A relative path is interpreted as relative to the current working directory.- Returns:
CpeCollectionReader
- Throws:
CpeDescriptorException
- tbd
-
addCasInitializer
@Deprecated(since="2.0.0") CpeCollectionReaderCasInitializer addCasInitializer(String aCasInitializerPath) throws CpeDescriptorException Deprecated.As of v2.0 CAS Initializers are deprecated.Adds a path to the descriptor file containing CasInitializer's configuration.- Parameters:
aCasInitializerPath
- - path to the CasInitializer descriptor- Returns:
CpeCollectionReaderCasInitializer
- Throws:
CpeDescriptorException
- tbd- To be removed in version:
- 4.0.0
-
getAllCollectionCollectionReaders
Returns a list ofCpeCollectionReader
instances representing ALL defined CollectionReaders.- Returns:
- array of
CpeCollectionReader
instances. - Throws:
CpeDescriptorException
- tbd
-
setAllCollectionCollectionReaders
- Throws:
CpeDescriptorException
-
getCpeCasProcessors
Returns aCpeCasProcessors
instance containing processing pipeline spec. This includes:- the size of the InputQueue
- the size of the OutputQueue
- number of processing units to create
- a list of Analysis Engines
- a list of CasConsumers
- Returns:
CpeCasProcessors
- Throws:
CpeDescriptorException
- tbd
-
addCasProcessor
Appends a instance ofCpeCasProcessor
to the end of the list containing CPE CasProcessors. A CasProcessor can either be:- Analysis Engine
- Cas Consumer
- Parameters:
aCasProcessor
- - instance ofCpeCasProcessor
to add.- Throws:
CpeDescriptorException
- tbd
-
addCasProcessor
Adds a instance ofCpeCasProcessor
at a specified location in the list of CPE CasProcessors. If the index is greater than the list size, the newCpeCasProcessor
instance is appended to the list.- Parameters:
index
- - insertion point for theCpeCasProcessor
aCasProcessor
- - CasProcessor to add- Throws:
CpeDescriptorException
- tbd
-
getCpeConfiguration
Returns the CPE configuration that includes:- An ID of the entity to begin processing with (OPTIONAL)
- Number of entities to process
- Checkpoint definition (checkpoint file, frequency)
- A name of the class implementing
UimaTimer
interface. - Startup mode for the CPE (immediate, interactive, vinciService)
Using an instance of
CpeConfiguration
the client may change behavior of the CPE and corresponding to each of the elements in the above list.- Returns:
CpeConfiguration
- Throws:
CpeDescriptorException
- tbd
-
setInputQueueSize
Defines the size for the InputQueue. This queue is used by the CPE to store bundles of CAS as read by a CollectionReader. The queue is shared between the CollectionReader and ProcessingUnits. The larger the size of this queue the more bundles of CAS are placed in the queue, and the more memory is consumed by the CPE. The right size for this queue depends on number of factors, like the speed of analysis and available memory.- Parameters:
aSize
- - size of the queue- Throws:
CpeDescriptorException
- tbd
-
setProcessingUnitThreadCount
- Parameters:
aSize
- the number of threads- Throws:
CpeDescriptorException
- tbd
-
setOutputQueueSize
Defines the size for the OutputQueue. This queue is used by the CPE to store bundles of CAS containing results of analysis. The queue is shared between ProcessingUnits and CasConsumers. The larger the size of this queue the more bundles of CAS are placed in the queue, and the more memory is consumed by the CPE. The right size for this queue depends on number of factors, like the speed in which Cas's are consumed and available memory.- Parameters:
aSize
- - size of the queue- Throws:
CpeDescriptorException
- tbd
-
setCheckpoint
Add checkpoint file and frequency (in millis) of checkpoints- Parameters:
aCheckpointFile
- - path for the checkpoint fileaFrequency
- - frequency in terms of mills for checkpoints
-
setTimer
Add name of the class that implements (@link org.apache.uima.util.UimaTimer} interface. This timer will be used by the CPE to time events.- Parameters:
aTimerClass
- - name of the UimaTimer class
-
setDeployment
Define startup mode for the CPE. The three supported options are:- immediate (DEFAULT), starts the CPE without user interaction
- interactive - allows to the user to control the start, stop, pause, resume of the CPE.
- vinciService - starts the CPM as a Vinci Service
- Parameters:
aDeployMode
- - CPM deployment mode
-
setNumToProcess
void setNumToProcess(long aEntityCount) Defines number of entities to process by the CPE.- Parameters:
aEntityCount
- - entity count
-
setStartingEntityId
Defines an id of the first entity to process.- Parameters:
aStartEntityId
- - entity id
-
setResourceManagerConfiguration
Defines the path to Resource Manager Configuration- Parameters:
aResMgrConfPagth
- - path to Resource Manager Configuration file.
-
setCpeResourceManagerConfiguration
Defines the path to Resource Manager Configuration- Parameters:
aResMgrConfPagth
- - path to Resource Manager Configuration file.
-
getResourceManagerConfiguration
CpeResourceManagerConfiguration getResourceManagerConfiguration()Returns ResourceManagerConfiguration instance.- Returns:
CpeResourceManagerConfiguration
-
setCpeCasProcessors
-
toXML
Generates XML for the CPE Descriptor and writes it out to the provided OutputStream.- Specified by:
toXML
in interfaceXMLizable
- Parameters:
aStream
- - stream to write- Throws:
SAXException
- pass thruIOException
- if an I/O failure occurs
-
setCpeConfiguration
-