Class LogEvents

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

public class LogEvents extends Object
LogEvents contains methods for constructing and emitting various types of Connect Log events. Each method requires a supplier of LogEventsEmitter using which the events are published to the destination topic.
  • Constructor Details

    • LogEvents

      public LogEvents()
  • Method Details

    • connectorFailedEvent

      public static void connectorFailedEvent(Supplier<LogEventsEmitter> logEventsEmitterSupplier, Map<String,String> connectorConfig, String connectorId, Throwable cause, Optional<LogEventState> logEventStateOptional)
      Constructs ConnectLogEntry for a Connector failure event, and forwards the entry to LogEventsEmitter to emit it in the form of CloudEvent to the destination topic. Before constructing connect log entry, checks if this failure is deduplicated.
      Parameters:
      logEventsEmitterSupplier - Supplier of LogEventsEmitter. May not be null.
      connectorId - Id of the connector. May not be empty or null.
      cause - Throwable instance, capturing Connector's failure. May not be
      logEventStateOptional - Optional of logEventState for the given connector id. If deduplication is disabled, this optional would be empty.
    • connectorTaskFailedEvent

      public static void connectorTaskFailedEvent(Supplier<LogEventsEmitter> logEventsEmitterSupplier, Map<String,String> connectorConfig, String connectorId, String taskId, Throwable cause, Optional<LogEventState> logEventStateOptional)
      Constructs ConnectLogEntry for a Connector Task failure event, and forwards the entry to LogEventsEmitter to emit it in the form of CloudEvent to the destination topic. Before constructing connect log entry, checks if this failure is deduplicated.
      Parameters:
      logEventsEmitterSupplier - Supplier of LogEventsEmitter. May not be null.
      connectorId - Id of the connector. May not be empty or null.
      taskId - Id of the task. May not be empty or null.
      cause - Throwable instance, capturing Connector's failure. May
      logEventStateOptional - Optional of logEventState for the given task id. If deduplication is disabled, this optional would be empty.
    • createLogEventState

      public static LogEventState createLogEventState(Function<Map.Entry<String, LogEventState>, LogEventState> createLogEventStateIfAbsent, String id, long logFailureEventResetTime)