Class DocumentProcessing


  • @Beta
    public final class DocumentProcessing
    extends java.lang.Object
    For doing document processing with JDisc.
    Author:
    Einar M R Rosenvinge
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​com.yahoo.document.annotation.AnnotationType> getAnnotationTypes()  
      com.yahoo.processing.execution.chain.ChainRegistry<com.yahoo.docproc.DocumentProcessor> getChains()
      Returns a registry of configured docproc chains.
      java.util.Map<java.lang.String,​com.yahoo.document.DocumentType> getDocumentTypes()  
      com.yahoo.docproc.DocumentProcessor.Progress process​(com.yahoo.component.ComponentSpecification chain, com.yahoo.docproc.Processing processing)
      Processes the given Processing through the specified chain.
      com.yahoo.docproc.DocumentProcessor.Progress processOnce​(com.yahoo.component.ComponentSpecification chain, com.yahoo.docproc.Processing processing)
      Processes the given Processing through the specified chain.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • process

        public com.yahoo.docproc.DocumentProcessor.Progress process​(com.yahoo.component.ComponentSpecification chain,
                                                                    com.yahoo.docproc.Processing processing)
        Processes the given Processing through the specified chain. Note that if one DocumentProcessor in the chain returns a DocumentProcessor.LaterProgress, the calling thread will sleep for the duration specified in DocumentProcessor.LaterProgress#getDelay(), and then run again. This method will hence return when a document processor returns DocumentProcessor.Progress#DONE or DocumentProcessor.Progress#FAILED, throws an exception, or if the calling thread is interrupted. This method will never return a DocumentProcessor.LaterProgress.
        Parameters:
        chain - the specification of the chain to execute
        processing - the Processing to process
        Returns:
        Progress.DONE or Progress.FAILED
        Throws:
        java.lang.RuntimeException - if one of the document processors in the chain throws, or if the calling thread is interrupted
      • processOnce

        public com.yahoo.docproc.DocumentProcessor.Progress processOnce​(com.yahoo.component.ComponentSpecification chain,
                                                                        com.yahoo.docproc.Processing processing)
        Processes the given Processing through the specified chain. Note that if one DocumentProcessor in the chain returns a DocumentProcessor.LaterProgress, it will be returned by this method. This method will hence return whenever a document processor returns any DocumentProcessor.Progress, or throws an exception.
        Parameters:
        chain - the specification of the chain to execute
        processing - the Processing to process
        Returns:
        any Progress
        Throws:
        java.lang.RuntimeException - if one of the document processors in the chain throws
      • getChains

        public com.yahoo.processing.execution.chain.ChainRegistry<com.yahoo.docproc.DocumentProcessor> getChains()
        Returns a registry of configured docproc chains.
        Returns:
        a registry of configured docproc chains
      • getDocumentTypes

        public java.util.Map<java.lang.String,​com.yahoo.document.DocumentType> getDocumentTypes()
      • getAnnotationTypes

        public java.util.Map<java.lang.String,​com.yahoo.document.annotation.AnnotationType> getAnnotationTypes()