Package org.agrona.concurrent.errors
Class ErrorLogReader
- java.lang.Object
-
- org.agrona.concurrent.errors.ErrorLogReader
-
public class ErrorLogReader extends java.lang.Object
Reader for the log created by aDistinctErrorLog
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.
-
-
-
Method Detail
-
hasErrors
public static boolean hasErrors(AtomicBuffer buffer)
Has the error buffer any recorded errors?- Parameters:
buffer
- containing theDistinctErrorLog
.- 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 theDistinctErrorLog
.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 theDistinctErrorLog
.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.
-
-