Class ErrorLogReader

java.lang.Object
org.agrona.concurrent.errors.ErrorLogReader

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

The read methods are thread safe.

  • Constructor Details

    • ErrorLogReader

      public ErrorLogReader()
  • Method Details

    • 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.