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 org.apache.uima.collection.impl.metadata.cpe.CpeDescriptorFactory#produceDescriptor(). A CPE instance can then be created by calling UIMAFramework.produceCollectionProcessingEngine(CpeDescription).
  • Method Details

    • 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 - tbd
    • 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 - tbd
    • getAllCollectionCollectionReaders

      CpeCollectionReader[] getAllCollectionCollectionReaders() throws CpeDescriptorException
      Returns a list of CpeCollectionReader instances representing ALL defined CollectionReaders.
      Returns:
      array of CpeCollectionReader instances.
      Throws:
      CpeDescriptorException - tbd
    • setAllCollectionCollectionReaders

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

      CpeCasProcessors getCpeCasProcessors() throws CpeDescriptorException
      Returns a CpeCasProcessors 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

      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:
      • Analysis Engine
      • Cas Consumer
      Parameters:
      aCasProcessor - - instance of CpeCasProcessor to add.
      Throws:
      CpeDescriptorException - tbd
    • 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 - 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 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

      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 - tbd
    • setProcessingUnitThreadCount

      void setProcessingUnitThreadCount(int aSize) throws CpeDescriptorException
      Parameters:
      aSize - the number of threads
      Throws:
      CpeDescriptorException - tbd
    • 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 - tbd
    • 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:
      • 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(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 the provided OutputStream.
      Specified by:
      toXML in interface XMLizable
      Parameters:
      aStream - - stream to write
      Throws:
      SAXException - pass thru
      IOException - if an I/O failure occurs
    • setCpeConfiguration

      void setCpeConfiguration(CpeConfiguration aConfiguration)