Class LogEventState

java.lang.Object
io.confluent.logevents.connect.LogEventState

public class LogEventState extends Object
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

    Constructors
    Constructor
    Description
    LogEventState(String id, long logFailureEventResetTime, org.apache.kafka.common.utils.Time time)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    boolean
    Checks if the throwable passed as parameter is eligible for being emitted as a connect log event.
    boolean
    Checks if reset window has elapsed since the error was last observed.
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LogEventState

      public LogEventState(String id, long logFailureEventResetTime, org.apache.kafka.common.utils.Time time)
  • Method Details

    • logFailureEvent

      public boolean logFailureEvent(Throwable error)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object