Class ErrorLogReader


  • public class ErrorLogReader
    extends java.lang.Object
    Reader for the log created by a DistinctErrorLog encoded as UTF-8 errors.

    The read methods are thread safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorLogReader()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean hasErrors​(AtomicBuffer buffer)
      Has the error buffer any recorded errors?
      static int read​(AtomicBuffer buffer, ErrorConsumer consumer)
      Read all the errors in a log since the creation of the log.
      static int read​(AtomicBuffer buffer, ErrorConsumer consumer, long sinceTimestamp)
      Read all the errors in a log since a given timestamp.
      • Methods inherited from class java.lang.Object

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

      • ErrorLogReader

        public ErrorLogReader()
    • Method Detail

      • hasErrors

        public static boolean hasErrors​(AtomicBuffer buffer)
        Has the error buffer any recorded errors?
        Parameters:
        buffer - containing the DistinctErrorLog.
        Returns:
        true if there is at least one error.
      • read

        public static int read​(AtomicBuffer buffer,
                               ErrorConsumer consumer)
        Read all the errors in a log since the creation of the log.
        Parameters:
        buffer - containing the DistinctErrorLog.
        consumer - to be called for each exception encountered.
        Returns:
        the number of entries that has been read.
      • read

        public static int read​(AtomicBuffer buffer,
                               ErrorConsumer consumer,
                               long sinceTimestamp)
        Read all the errors in a log since a given timestamp.
        Parameters:
        buffer - containing the DistinctErrorLog.
        consumer - to be called for each exception encountered.
        sinceTimestamp - for filtering errors that have been recorded since this time.
        Returns:
        the number of entries that has been read.