@Override
  public void run() {
    updateTimeTrackingBeforeRun();
    if (missedStartTime() && isScheduled()) {
      onChoreMissedStartTime();
      LOG.info("Chore: {} missed its start time", getName());
    } else if (stopper.isStopped() || !isScheduled()) {
      // call shutdown here to cleanup the ScheduledChore.
      shutdown(false);
      LOG.info("Chore: {} was stopped", getName());
    } else {
      try {
        // TODO: Histogram metrics per chore name.
        // For now, just measure and log if DEBUG level logging is enabled.
        long start = 0;
        if (LOG.isDebugEnabled()) {
          start = System.nanoTime();
        }
        if (!initialChoreComplete) {
          initialChoreComplete = initialChore();
        } else {
          chore();
        }
        if (LOG.isDebugEnabled() && start > 0) {
          long end = System.nanoTime();
          LOG.debug("{} execution time: {} ms.", getName(),
            TimeUnit.NANOSECONDS.toMillis(end - start));
        }
      } catch (Throwable t) {
        LOG.error("Caught error", t);
        if (this.stopper.isStopped()) {
          cancel(false);
        }
      }
    }
  }
Construct a ScheduledChore
@param name         Name assigned to Chore. Useful for identification amongst chores of the
                    same type
@param stopper      When {@link Stoppable#isStopped()} is true, this chore will cancel and
                    cleanup
@param period       Period in Timeunit unit with which this Chore repeats execution when
                    scheduled.
@param initialDelay Delay in Timeunit unit before this Chore begins to execute once it has been
                    scheduled. A value of 0 means the chore will begin to execute immediately.
                    Negative delays are invalid and will be corrected to a value of 0.
@param unit         The unit that is used to measure period and initialDelay
hbase-common/src/main/java/org/apache/hadoop/hbase/ScheduledChore.java