code: private boolean shouldScheduleCheckpoint(long now) {
      fsnamesys.writeLock();
      try {
        if (lastCheckpointTime == 0
            || (lastCheckpointTime + 1000 * checkpointPeriod < now)
            || (earlyScheduledCheckpointTime < now)
            || getTransactionLag() > checkpointTxnCount
            || manualCheckpointLatch.getCount() == 2
            || InjectionHandler
                .falseCondition(InjectionEvent.STANDBY_CHECKPOINT_TRIGGER)) {
  
          // perform another check to see if the checkpoint has not been delayed
          // through configuration
          if (delayedScheduledCheckpointTime > now) {
            LOG.info("Standby: Checkpointing is delayed - will do checkpoint in: "
                + ((delayedScheduledCheckpointTime - now) / 1000));
            InjectionHandler
                .processEvent(InjectionEvent.STANDBY_DELAY_CHECKPOINT);
            return false;
          }
          countDownManualLatch(2);
          return true;
        }
        return false;
      } finally {
        fsnamesys.writeUnlock();
      }
    }
docs: Should checkpoint be triggered now.
  Checkpoint is scheduled when:
  - no checkpoint have been performed so far
  - the checkpointPeriod time has passed since last checkpoint
  - there is an early scheduled checkpoint (previous has failed)
  - the number of uncheckpointed transactions is higher than configured
  - manual checkpoint has been triggered
  
  @param now current time
  @return