container/src/main/java/com/streamsets/datacollector/execution/runner/common/ProductionPipelineRunner.java
private void createFailureBatch(FullPipeBatch pipeBatch) {
    if(!pipelineConfigBean.shouldCreateFailureSnapshot) {
      return;
    }

    try {
      for(SnapshotInfo info : snapshotStore.getSummaryForPipeline(pipelineName, revision)) {
        // Allow only one failure snapshot to be present on a pipeline
        if(info.isFailureSnapshot()) {
          LOG.trace("Skipping creation of failure snapshot as {} already exists.", info.getId());
          return;
        }
      }

      String snapshotName = "Failure_" + UUID.randomUUID().toString();
      String snapshotLabel = "Failure at " + LocalDateTime.now().toString();
      snapshotStore.create("", pipelineName, revision, snapshotName, snapshotLabel, true);
      snapshotStore.save(pipelineName, revision, snapshotName, -1, ImmutableList.of(pipeBatch.createFailureSnapshot()));
    } catch (PipelineException ex) {
      LOG.error("Can't serialize failure snapshot", ex);
    }
  }
private void createFailureBatch(FullPipeBatch pipeBatch) {
    if(!pipelineConfigBean.shouldCreateFailureSnapshot) {
      return;
    }

    try {
      for(SnapshotInfo info : snapshotStore.getSummaryForPipeline(pipelineName, revision)) {
        // Allow only one failure snapshot to be present on a pipeline
        if(info.isFailureSnapshot()) {
          LOG.trace("Skipping creation of failure snapshot as {} already exists.", info.getId());
          return;
        }
      }

      String snapshotName = "Failure_" + UUID.randomUUID().toString();
      String snapshotLabel = "Failure at " + LocalDateTime.now().toString();
      snapshotStore.create("", pipelineName, revision, snapshotName, snapshotLabel, true);
      snapshotStore.save(pipelineName, revision, snapshotName, -1, ImmutableList.of(pipeBatch.createFailureSnapshot()));
    } catch (PipelineException ex) {
      LOG.error("Can't serialize failure snapshot", ex);
    }
  }
Create special batch by salvaging memory structures when pipelines gets into un-recoverable error.

@param pipeBatch Current batch