@Override
  public ScheduledFuture scheduleTask() {
    return scheduler.scheduleWithFixedDelay(() -> {
      try {
        String currJVM = currentJMVersion.get();
        LOG.info("Updating heartbeat for processor ID: " + processorId + " and job model version: " + currJVM);
        table.updateHeartbeat(currJVM, processorId);
      } catch (Exception e) {
        errorHandler.accept("Exception in Heartbeat Scheduler. Stopping the processor...");
      }
    }, HEARTBEAT_DELAY_SEC, HEARTBEAT_DELAY_SEC, TimeUnit.SECONDS);
  }
Scheduler invoked by each processor for heartbeating to a row of the table.
Heartbeats every 5 seconds.
The row is determined by the job model version and processor id passed to the scheduler.
All time units are in SECONDS.
samza-azure/src/main/java/org/apache/samza/coordinator/scheduler/HeartbeatScheduler.java