Class RDFStreamProcessor


  • public final class RDFStreamProcessor
    extends java.lang.Object
    Stream processor that handles concurrent production of statements from multiple streams and passes the statements to handlers or provides the results as an iteration(List, CancelCheck).
    Since:
    0.1
    Author:
    Michael Grove, Evren Sirin, Fernando Hernandez
    • Field Detail

      • DEFAULT_MAX_PARSER_COUNT

        public static final int DEFAULT_MAX_PARSER_COUNT
      • DEFAULT_MAX_HANDLER_COUNT

        public static final int DEFAULT_MAX_HANDLER_COUNT
    • Method Detail

      • handler

        public RDFStreamProcessor handler​(RDFStatementHandler.Factory theHandler)
        Specifies the factory that will be used to create handlers. Multiple handlers may be created depending on the number of streams processed, number of available processors, etc.
      • handler

        public RDFStreamProcessor handler​(RDFNamespaceHandler theNamespaceHandler)
        Specifies the namespace handler that will be used by this process. A single namespace handler is used for all the streams processed.
      • executor

        public RDFStreamProcessor executor​(java.util.concurrent.ExecutorService theExecutor)
        Specifies the executor that will be used for processing.
      • monitorOutput

        public RDFStreamProcessor monitorOutput​(java.io.OutputStream theStream)
        Sets the output progress if progress should be reported or null if progress should not be reported. Passing null value is preferred compared to passing an output stream that ignores its output so that we will avoid keeping track of progress completely.
      • getException

        public java.lang.Throwable getException​(RDFStream theStream)
      • process

        public void process()
                     throws InvalidRDF,
                            java.io.IOException
        Waits for the processing of streams to finish. No more streams may be added to the processor after this function is called. An exception is thrown at the very end if there was an error processing any one of the streams.
        Throws:
        InvalidRDF
        java.io.IOException
      • processSilently

        public java.util.Map<RDFStream,​java.lang.Exception> processSilently()
        Waits for the processing of streams to finish and returns a mapping from the streams to exceptions. The map will be empty if there were no exceptions during processing. No more streams may be added to the processor after this function is called.
      • pause

        public void pause()
        Pauses processing. All parsing and processing tasks will block until resume() is called.
      • resume

        public void resume()
        Resumes processing as soon as possible.
      • cancel

        public void cancel​(java.lang.String theCause)
      • main

        public static void main​(java.lang.String[] args)