Class LogEvents
java.lang.Object
io.confluent.logevents.connect.LogEvents
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconnectorFailedEvent(Supplier<LogEventsEmitter> logEventsEmitterSupplier, Map<String, String> connectorConfig, String connectorId, Throwable cause, Optional<LogEventState> logEventStateOptional) ConstructsConnectLogEntryfor a Connector failure event, and forwards the entry toLogEventsEmitterto emit it in the form ofCloudEventto the destination topic.static voidconnectorTaskFailedEvent(Supplier<LogEventsEmitter> logEventsEmitterSupplier, Map<String, String> connectorConfig, String connectorId, String taskId, Throwable cause, Optional<LogEventState> logEventStateOptional) ConstructsConnectLogEntryfor a Connector Task failure event, and forwards the entry toLogEventsEmitterto emit it in the form ofCloudEventto the destination topic.static LogEventStatecreateLogEventState(Function<Map.Entry<String, LogEventState>, LogEventState> createLogEventStateIfAbsent, String id, long logFailureEventResetTime)
-
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) ConstructsConnectLogEntryfor a Connector failure event, and forwards the entry toLogEventsEmitterto emit it in the form ofCloudEventto the destination topic. Before constructing connect log entry, checks if this failure is deduplicated.- Parameters:
logEventsEmitterSupplier- Supplier ofLogEventsEmitter. May not be null.connectorId- Id of the connector. May not be empty or null.cause- Throwable instance, capturing Connector's failure. May not belogEventStateOptional- 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) ConstructsConnectLogEntryfor a Connector Task failure event, and forwards the entry toLogEventsEmitterto emit it in the form ofCloudEventto the destination topic. Before constructing connect log entry, checks if this failure is deduplicated.- Parameters:
logEventsEmitterSupplier- Supplier ofLogEventsEmitter. 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. MaylogEventStateOptional- 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)
-