Interface CpeDescription
-
- All Superinterfaces:
java.lang.Cloneable,MetaDataObject,java.io.Serializable,XMLizable
- All Known Implementing Classes:
CpeDescriptionImpl
public interface CpeDescription extends MetaDataObject
Java representation of a Collection Processing Engine (CPE) XML descriptor. Generate an instance of this class by calling either theXMLParser.parseCpeDescription(XMLInputSource)or org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory#produceDescriptor(). A CPE instance can then be created by callingUIMAFramework.produceCollectionProcessingEngine(CpeDescription).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CpeCollectionReaderCasInitializeraddCasInitializer(java.lang.String aCasInitializerPath)Deprecated.As of v2.0 CAS Initializers are deprecated.voidaddCasProcessor(int index, CpeCasProcessor aCasProcessor)Adds a instance ofCpeCasProcessorat a specified location in the list of CPE CasProcessors.voidaddCasProcessor(CpeCasProcessor aCasProcessor)Appends a instance ofCpeCasProcessorto the end of the list containing CPE CasProcessors.CpeCollectionReaderaddCollectionReader(java.lang.String aCollectionReaderPath)Adds a path to the descriptor file containing CollectionReader's configuration.voidaddCollectionReader(CpeCollectionReader aCollectionReader)CpeCollectionReader[]getAllCollectionCollectionReaders()Returns a list ofCpeCollectionReaderinstances representing ALL defined CollectionReaders.CpeCasProcessorsgetCpeCasProcessors()Returns aCpeCasProcessorsinstance containing processing pipeline spec.CpeConfigurationgetCpeConfiguration()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 implementingUimaTimerinterface.CpeResourceManagerConfigurationgetResourceManagerConfiguration()Returns ResourceManagerConfiguration instance.voidsetAllCollectionCollectionReaders(CpeCollectionReader[] readers)voidsetCheckpoint(java.lang.String aCheckpointFile, int aFrequency)Add checkpoint file and frequency (in millis) of checkpointsvoidsetCpeCasProcessors(CpeCasProcessors aCasProcessors)voidsetCpeConfiguration(CpeConfiguration aConfiguration)voidsetCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)Defines the path to Resource Manager ConfigurationvoidsetDeployment(java.lang.String aDeployMode)Define startup mode for the CPE.voidsetInputQueueSize(int aSize)Defines the size for the InputQueue.voidsetNumToProcess(long aEntityCount)Defines number of entities to process by the CPE.voidsetOutputQueueSize(int aSize)Defines the size for the OutputQueue.voidsetProcessingUnitThreadCount(int aSize)voidsetResourceManagerConfiguration(java.lang.String aResMgrConfPagth)Defines the path to Resource Manager ConfigurationvoidsetStartingEntityId(java.lang.String aStartEntityId)Defines an id of the first entity to process.voidsetTimer(java.lang.String aTimerClass)Add name of the class that implements (@link org.apache.uima.util.UimaTimer} interface.voidtoXML(java.io.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 Detail
-
addCollectionReader
void addCollectionReader(CpeCollectionReader aCollectionReader) throws CpeDescriptorException
- Throws:
CpeDescriptorException
-
addCollectionReader
CpeCollectionReader addCollectionReader(java.lang.String aCollectionReaderPath) throws CpeDescriptorException
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 CpeCollectionReaderCasInitializer addCasInitializer(java.lang.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
-
getAllCollectionCollectionReaders
CpeCollectionReader[] getAllCollectionCollectionReaders() throws CpeDescriptorException
Returns a list ofCpeCollectionReaderinstances representing ALL defined CollectionReaders.- Returns:
- array of
CpeCollectionReaderinstances. - Throws:
CpeDescriptorException- tbd
-
setAllCollectionCollectionReaders
void setAllCollectionCollectionReaders(CpeCollectionReader[] readers) throws CpeDescriptorException
- Throws:
CpeDescriptorException
-
getCpeCasProcessors
CpeCasProcessors getCpeCasProcessors() throws CpeDescriptorException
Returns aCpeCasProcessorsinstance 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
void addCasProcessor(CpeCasProcessor aCasProcessor) throws CpeDescriptorException
Appends a instance ofCpeCasProcessorto the end of the list containing CPE CasProcessors. A CasProcessor can either be:- Analysis Engine
- Cas Consumer
- Parameters:
aCasProcessor- - instance ofCpeCasProcessorto add.- Throws:
CpeDescriptorException- tbd
-
addCasProcessor
void addCasProcessor(int index, CpeCasProcessor aCasProcessor) throws CpeDescriptorExceptionAdds a instance ofCpeCasProcessorat a specified location in the list of CPE CasProcessors. If the index is greater than the list size, the newCpeCasProcessorinstance is appended to the list.- Parameters:
index- - insertion point for theCpeCasProcessoraCasProcessor- - CasProcessor to add- Throws:
CpeDescriptorException- tbd
-
getCpeConfiguration
CpeConfiguration getCpeConfiguration() throws CpeDescriptorException
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
UimaTimerinterface. - Startup mode for the CPE (immediate, interactive, vinciService)
Using an instance of
CpeConfigurationthe client may change behavior of the CPE and corresponding to each of the elements in the above list.- Returns:
CpeConfiguration- Throws:
CpeDescriptorException- tbd
-
setInputQueueSize
void setInputQueueSize(int aSize) throws CpeDescriptorExceptionDefines 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
void setProcessingUnitThreadCount(int aSize) throws CpeDescriptorException- Parameters:
aSize- the number of threads- Throws:
CpeDescriptorException- tbd
-
setOutputQueueSize
void setOutputQueueSize(int aSize) throws CpeDescriptorExceptionDefines 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
void setCheckpoint(java.lang.String aCheckpointFile, int aFrequency)Add checkpoint file and frequency (in millis) of checkpoints- Parameters:
aCheckpointFile- - path for the checkpoint fileaFrequency- - frequency in terms of mills for checkpoints
-
setTimer
void setTimer(java.lang.String aTimerClass)
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
void setDeployment(java.lang.String aDeployMode)
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
void setStartingEntityId(java.lang.String aStartEntityId)
Defines an id of the first entity to process.- Parameters:
aStartEntityId- - entity id
-
setResourceManagerConfiguration
void setResourceManagerConfiguration(java.lang.String aResMgrConfPagth)
Defines the path to Resource Manager Configuration- Parameters:
aResMgrConfPagth- - path to Resource Manager Configuration file.
-
setCpeResourceManagerConfiguration
void setCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)
Defines the path to Resource Manager Configuration- Parameters:
aResMgrConfPagth- - path to Resource Manager Configuration file.
-
getResourceManagerConfiguration
CpeResourceManagerConfiguration getResourceManagerConfiguration()
Returns ResourceManagerConfiguration instance.- Returns:
CpeResourceManagerConfiguration
-
setCpeCasProcessors
void setCpeCasProcessors(CpeCasProcessors aCasProcessors)
-
toXML
void toXML(java.io.OutputStream aStream) throws org.xml.sax.SAXException, java.io.IOExceptionGenerates XML for the CPE Descriptor and writes it out to the provided OutputStream.
-
setCpeConfiguration
void setCpeConfiguration(CpeConfiguration aConfiguration)
-
-