org.apache.uima.collection.metadata
Interface CpeDescription

All Superinterfaces:
Cloneable, MetaDataObject, Serializable, XMLizable

public interface CpeDescription
extends MetaDataObject

Java representation of a Collection Processing Engine (CPE) XML descriptor. Generate an instance of this class by calling either the XMLParser.parseCpeDescription(XMLInputSource) or CpeDescriptorFactory.produceDescriptor(). A CPE instance can then be created by calling UIMAFramework.produceCollectionProcessingEngine(CpeDescription).


Method Summary
 CpeCollectionReaderCasInitializer addCasInitializer(String aCasInitializerPath)
          Deprecated. As of v2.0 CAS Initializers are deprecated.
 void addCasProcessor(CpeCasProcessor aCasProcessor)
          Appends a instance of CpeCasProcessor to the end of the list containing CPE CasProcessors.
 void addCasProcessor(int index, CpeCasProcessor aCasProcessor)
          Adds a instance of CpeCasProcessor at a specified location in the list of CPE CasProcessors.
 void addCollectionReader(CpeCollectionReader aCollectionReader)
           
 CpeCollectionReader addCollectionReader(String aCollectionReaderPath)
          Adds a path to the descriptor file containing CollectionReader's configuration.
 CpeCollectionReader[] getAllCollectionCollectionReaders()
          Returns a list of CpeCollectionReader instances representing ALL defined CollectionReaders.
 CpeCasProcessors getCpeCasProcessors()
          Returns a CpeCasProcessors instance containing processing pipeline spec.
 CpeConfiguration 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.
 CpeResourceManagerConfiguration getResourceManagerConfiguration()
          Returns ResourceManagerConfiguration instance.
 void setAllCollectionCollectionReaders(CpeCollectionReader[] readers)
           
 void setCheckpoint(String aCheckpointFile, int aFrequency)
          Add checkpoint file and frequency (in millis) of checkpoints
 void setCpeCasProcessors(CpeCasProcessors aCasProcessors)
           
 void setCpeConfiguration(CpeConfiguration aConfiguration)
           
 void setCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)
          Defines the path to Resource Manager Configuration
 void 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 Configuration
 void setStartingEntityId(String aStartEntityId)
          Defines an id of the first entity to process.
 void setTimer(String aTimerClass)
          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 prvided 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(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

addCasInitializer

@Deprecated
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

getAllCollectionCollectionReaders

CpeCollectionReader[] getAllCollectionCollectionReaders()
                                                        throws CpeDescriptorException
Returns a list of CpeCollectionReader instances representing ALL defined CollectionReaders.

Returns:
array of CpeCollectionReader instances.
Throws:
CpeDescriptorException

setAllCollectionCollectionReaders

void setAllCollectionCollectionReaders(CpeCollectionReader[] readers)
                                       throws CpeDescriptorException
Throws:
CpeDescriptorException

getCpeCasProcessors

CpeCasProcessors getCpeCasProcessors()
                                     throws CpeDescriptorException
Returns a CpeCasProcessors instance containing processing pipeline spec. This includes:

Returns:
CpeCasProcessors
Throws:
CpeDescriptorException

addCasProcessor

void addCasProcessor(CpeCasProcessor aCasProcessor)
                     throws CpeDescriptorException
Appends a instance of CpeCasProcessor to the end of the list containing CPE CasProcessors. A CasProcessor can either be:

Parameters:
aCasProcessor - - instance of CpeCasProcessor to add.
Throws:
CpeDescriptorException

addCasProcessor

void addCasProcessor(int index,
                     CpeCasProcessor aCasProcessor)
                     throws CpeDescriptorException
Adds a instance of CpeCasProcessor at a specified location in the list of CPE CasProcessors. If the index is greater than the list size, the new CpeCasProcessor instance is appended to the list.

Parameters:
index - - insertion point for the CpeCasProcessor
aCasProcessor - - CasProcessor to add
Throws:
CpeDescriptorException

getCpeConfiguration

CpeConfiguration getCpeConfiguration()
                                     throws CpeDescriptorException
Returns the CPE configuration that includes:

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

setInputQueueSize

void setInputQueueSize(int aSize)
                       throws CpeDescriptorException
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

setProcessingUnitThreadCount

void setProcessingUnitThreadCount(int aSize)
                                  throws CpeDescriptorException
Parameters:
aSize -
Throws:
CpeDescriptorException

setOutputQueueSize

void setOutputQueueSize(int aSize)
                        throws CpeDescriptorException
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

setCheckpoint

void setCheckpoint(String aCheckpointFile,
                   int aFrequency)
Add checkpoint file and frequency (in millis) of checkpoints

Parameters:
aCheckpointFile - - path for the checkpoint file
aFrequency - - frequency in terms of mills for checkpoints

setTimer

void setTimer(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(String aDeployMode)
Define startup mode for the CPE. The three supported options are:

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(String aStartEntityId)
Defines an id of the first entity to process.

Parameters:
aStartEntityId - - entity id

setResourceManagerConfiguration

void setResourceManagerConfiguration(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(OutputStream aStream)
           throws SAXException,
                  IOException
Generates XML for the CPE Descriptor and writes it out to prvided OutputStream.

Specified by:
toXML in interface XMLizable
Parameters:
aStream - - stream to write
Throws:
IOException - if an I/O failure occurs
SAXException

setCpeConfiguration

void setCpeConfiguration(CpeConfiguration aConfiguration)


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.