container/src/main/java/com/streamsets/datacollector/util/ValidationUtil.java
public static boolean isSnapshotOutputUsable(List<StageOutput> stagesOutput) {
    // In case that the snapshot actually does not exists
    if(stagesOutput == null) {
      return false;
    }

    // We're looking for at least one output lane that is not empty. In most cases the first stage in the list will
    // be origin that generated some data and hence the loop will terminate fast. In the worst case scenario we will
    // iterate over all stages in attempt to find at least one record in the snapshot.
    for(StageOutput output : stagesOutput) {
      if (CollectionUtils.isNotEmpty(output.getErrorRecords()) ||
          CollectionUtils.isNotEmpty(output.getEventRecords()) ||
          CollectionUtils.isNotEmpty(output.getStageErrors())) {
        return true;
      }
      for(Map.Entry<String, List<Record>> entry : output.getOutput().entrySet()) {
        if(!entry.getValue().isEmpty()) {
          return true;
        }
      }
    }

    return false;
  }
public static boolean isSnapshotOutputUsable(List<StageOutput> stagesOutput) {
    // In case that the snapshot actually does not exists
    if(stagesOutput == null) {
      return false;
    }

    // We're looking for at least one output lane that is not empty. In most cases the first stage in the list will
    // be origin that generated some data and hence the loop will terminate fast. In the worst case scenario we will
    // iterate over all stages in attempt to find at least one record in the snapshot.
    for(StageOutput output : stagesOutput) {
      if (CollectionUtils.isNotEmpty(output.getErrorRecords()) ||
          CollectionUtils.isNotEmpty(output.getEventRecords()) ||
          CollectionUtils.isNotEmpty(output.getStageErrors())) {
        return true;
      }
      for(Map.Entry<String, List<Record>> entry : output.getOutput().entrySet()) {
        if(!entry.getValue().isEmpty()) {
          return true;
        }
      }
    }

    return false;
  }
Returns true if given snapshot output is usable - e.g. if it make sense to persist.