Package org.agrona.concurrent.errors
Class ErrorLogReader
java.lang.Object
org.agrona.concurrent.errors.ErrorLogReader
Reader for the log created by a
DistinctErrorLog
encoded as UTF-8 errors.
The read methods are thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
ErrorLogReader
private ErrorLogReader()
-
-
Method Details
-
hasErrors
Has the error buffer any recorded errors?- Parameters:
buffer
- containing theDistinctErrorLog
.- Returns:
- true if there is at least one error.
-
read
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
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.
-