private void drain() {
    log.info("Setting the RunLoop to drain mode.");
    isDraining = true;
    log.debug("Disabling async commit when the pipeline is draining.");
    isAsyncCommitEnabled = false;
  }
Sets the RunLoop to drain mode.
samza-core/src/main/java/org/apache/samza/container/RunLoop.java