Interface Heartbeat.ScheduledHeartbeat

All Superinterfaces:
AutoCloseable, Heartbeat
All Known Implementing Classes:
CompositeHeartbeat, HeartbeatImpl
Enclosing interface:
Heartbeat

public static interface Heartbeat.ScheduledHeartbeat extends Heartbeat
A class that is able to generate periodic heartbeat messages based on a pre-configured interval. The clients are supposed to call method emitWithDelay(Map, OffsetContext) from a main loop of a connector.
  • Field Details

  • Method Details

    • emitWithDelay

      default void emitWithDelay(Map<String,?> partition, OffsetContext offset) throws InterruptedException
      Generates a heartbeat record if defined time has elapsed
      Parameters:
      partition - partition for the heartbeat record
      offset - offset for the heartbeat record
      Throws:
      InterruptedException
    • expired

      default boolean expired()
      Returns:
      if the timeout for the scheduled heartbeat is expired
    • reset

      default void reset()
      reset the timer for the heartbeat