Class LogEventState
java.lang.Object
io.confluent.logevents.connect.LogEventState
Stores the state of Connect log events for a given connector/task id. This is used to deduplicate
Connect log events captured upon failures in connector/task instances.
-
Constructor Summary
ConstructorsConstructorDescriptionLogEventState(String id, long logFailureEventResetTime, org.apache.kafka.common.utils.Time time) -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()booleanlogFailureEvent(Throwable error) Checks if the throwable passed as parameter is eligible for being emitted as a connect log event.booleanChecks if reset window has elapsed since the error was last observed.toString()
-
Constructor Details
-
LogEventState
public LogEventState(String id, long logFailureEventResetTime, org.apache.kafka.common.utils.Time time)
-
-
Method Details
-
logFailureEvent
Checks if the throwable passed as parameter is eligible for being emitted as a connect log event. First checks if reset window has elapsed for the cached error (lastError). Further compares the passed parameter with the cached error, root cause. And if the passed parameter is eligible for being emitted as Connect log event, this method updates the cached elements with passed parameter.- Parameters:
error- Throwable instance which needs to be checked against cached throwable to detect duplicates- Returns:
- true if passed parameter is not a duplicate of cached error or if reset time has elapsed. False otherwise.
-
shouldReset
public boolean shouldReset()Checks if reset window has elapsed since the error was last observed.- Returns:
- true if reset window has elapsed since the error was last observed. False otherwise.
-
equals
-
hashCode
-
toString
-