Class EventLogger
java.lang.Object
io.confluent.telemetry.events.EventLogger
- All Implemented Interfaces:
AutoCloseable, org.apache.kafka.common.Configurable, org.apache.kafka.common.Reconfigurable
public class EventLogger
extends Object
implements org.apache.kafka.common.Reconfigurable, AutoCloseable
This creates a logger that writes events to the configured exporter.
-
Constructor Summary
ConstructorsConstructorDescriptionEventLogger(Function<EventLoggerConfig, Exporter<io.confluent.telemetry.api.events.Event>> exporterFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidExporter<io.confluent.telemetry.api.events.Event> voidlog(io.confluent.telemetry.api.events.Event event) Log an event.logAndGetFuture(io.confluent.telemetry.api.events.Event event) Log an event and return the futurebooleanready(io.confluent.telemetry.api.events.Event event) Check if the event exporter ready for sending events.voidreconfigure(Map<String, ?> configs) voidvalidateReconfiguration(Map<String, ?> configs)
-
Constructor Details
-
EventLogger
public EventLogger() -
EventLogger
public EventLogger(Function<EventLoggerConfig, Exporter<io.confluent.telemetry.api.events.Event>> exporterFactory)
-
-
Method Details
-
log
public void log(io.confluent.telemetry.api.events.Event event) Log an event. This method might block if the exporter is not ready yet. If you need non-blocking behavior then you should use the ready(..) method to ensure the exporter is ready before sending events.- Parameters:
event-
-
logAndGetFuture
Log an event and return the future- Parameters:
event-- Returns:
- the future
-
ready
public boolean ready(io.confluent.telemetry.api.events.Event event) Check if the event exporter ready for sending events. This method does not block. -
reconfigurableConfigs
-
validateReconfiguration
-
reconfigure
-
configure
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
eventExporter
-