Class LineProcessor

  • All Implemented Interfaces:
    Runnable

    public class LineProcessor
    extends Object
    implements Runnable
    Responsible for processing the lines from a db provider's files and putting them in a serialized form.
    • Constructor Detail

      • LineProcessor

        public LineProcessor​(ExecutorService executorService,
                             BlockingQueue<SerializedLine> destination,
                             LineParser parser,
                             boolean retainOriginalLine,
                             LineprocessorListenerForProvider progressListener,
                             int workersCount)
        Parameters:
        executorService - the executor service used for handling parsing of batches
        destination - the queue where serialized lines are written to
        parser - the parser to use for parsing the line data
        retainOriginalLine - indicates if the original line data should be retained alongside the serialized data
        progressListener - the listener for reporting progress
    • Method Detail

      • markDataComplete

        public void markDataComplete()
        Marks that the no more data should be expected, though in flight data will still be processed.
      • addLine

        public void addLine​(RawLine rawLine)
        Add a new line of raw data for parsing and serialization
        Parameters:
        rawLine - the raw line data
      • run

        public void run()
        Runs the processor, parsing the raw line data and serializing it into a suitable form.
        Specified by:
        run in interface Runnable