Interface ProgressLogger

  • All Superinterfaces:
    Serializable

    public interface ProgressLogger
    extends Serializable
    Defines a logger that keeps track of the number of documents and words processed and reports processing statistics on a given interval.
    • Method Detail

      • create

        static ProgressLogger create​(@NonNull
                                     @NonNull StreamingContext streamingContext,
                                     @NonNull
                                     @NonNull Logger logger,
                                     @NonNull
                                     @NonNull Level level,
                                     long interval,
                                     @NonNull
                                     @NonNull String operationName)
        Creates a progress logger for the given streaming context.
        Parameters:
        streamingContext - the streaming context
        logger - the logger to use to log messages
        level - the level to log at
        interval - the interval between number of documents to process for reporting.
        Returns:
        the progress logger
      • documentsPerSecond

        double documentsPerSecond()
        Returns:
        the number of documents per second processed.
      • documentsProcessed

        long documentsProcessed()
        Returns:
        the number of documents processed.
      • report

        void report()
        Reports processing statistics.
      • start

        void start()
        Starts the processing timer
      • stop

        void stop​(long wordsProcessed)
        Stops the current processing timer
        Parameters:
        wordsProcessed - the number of words processed
      • wordsPerSecond

        double wordsPerSecond()
        Returns:
        the number of words per second processed.
      • wordsProcessed

        long wordsProcessed()
        Returns:
        the number of words processed