@Override
    public long getRecords(final Severity severity) {
        // Make sure there is a final call to check record to add all current
        // errors to the total error count.
        checkRecord(-1);

        final StoredErrorStats stats = statsMap.get(severity);
        if (stats != null) {
            return stats.getRecordCount();

        }

        return 0;
    }
Flags records that contain errors so that the RecordOutputFilter can exclude
them from the output.
stroom-pipeline/src/main/java/stroom/pipeline/errorhandler/RecordErrorReceiver.java