Class DocumentProcessor

  • All Implemented Interfaces:
    AutoCloseable

    public class DocumentProcessor
    extends Object
    implements AutoCloseable
    Processes ids using the Processor of the source. It also handles looking up dependencies and saving documents post process.
    Author:
    Charles Draper
    • Constructor Detail

      • DocumentProcessor

        public DocumentProcessor​(Registry registry,
                                 SourceConfig source,
                                 QuotaSemaphore quotaSemaphore)
        Creates a new DocumentProcessor.
        Parameters:
        registry - the registry
        source - the source for this document processor
        quotaSemaphore - the quota semaphore
    • Method Detail

      • process

        public void process​(String... ids)
        Submits the ids to be processed.
        Parameters:
        ids - ids to be processed
      • process

        public void process​(Collection<String> ids)
        Submits the ids to be processed.
        Parameters:
        ids - the ids to process
      • processAndWait

        public List<edu.byu.hbll.box.BoxDocument> processAndWait​(List<String> ids)
        Processes the ids and waits.
        Parameters:
        ids - the ids to process
        Returns:
        the processed documents
      • getStats

        public Map<String,​edu.byu.hbll.stats.time.Benchmark.Data> getStats()
        Prepares a snapshot of timing statistics for the processor.
        Returns:
        the snapshot
      • getAverageBatchSize

        public double getAverageBatchSize()
        Returns the average batch size.
        Returns:
        the averageBatchSize
      • getNumDocuments

        public long getNumDocuments()
        Returns the number of documents processed.
        Returns:
        the numDocuments
      • getNumBatches

        public long getNumBatches()
        Returns the number of batches processed.
        Returns:
        the numBatches