<commit_before>package org.zalando.nakadi.service.publishing.check;

import org.zalando.nakadi.domain.EventType;
import org.zalando.nakadi.domain.NakadiRecord;

import java.util.LinkedList;
import java.util.List;

public abstract class Check {

    public abstract List<RecordResult> execute(
            EventType eventType,
            List<NakadiRecord> records);

    public abstract Step getCurrentStep();

    protected List<RecordResult> processError(
            final List<NakadiRecord> records,
            final NakadiRecord failedRecord,
            final String error) {
        final List<RecordResult> recordResults = new LinkedList<>();
        boolean metFailedRecord = false;
        for (final NakadiRecord nakadiRecord : records) {
            if (failedRecord == nakadiRecord) {
                recordResults.add(new RecordResult(
                        Status.FAILED,
                        nakadiRecord.getMetadata().getEid(),
                        error));
                metFailedRecord = true;
            } else if (!metFailedRecord) {
                recordResults.add(new RecordResult(
                        Status.ABORTED,
                        nakadiRecord.getMetadata().getEid(),
                        ""));
            } else {
                recordResults.add(new RecordResult(
                        Status.ABORTED,
                        Step.NONE,
                        nakadiRecord.getMetadata().getEid(),
                        ""));
            }
        }

        return recordResults;
    }

    public class RecordResult {
        private final Status status;
        private final Step step;
        private final String eid;
        private final String error;

        public RecordResult(final Status status,
                            final Step step,
                            final String eid,
                            final String error) {
            this.status = status;
            this.step = step;
            this.eid = eid;
            this.error = error;
        }

        public RecordResult(final Status status,
                            final String eid,
                            final String error) {
            this(status, getCurrentStep(), eid, error);
        }

        public Status getStatus() {
            return status;
        }

        public Step getStep() {
            return step;
        }

        public String getEid() {
            return eid;
        }

        public String getError() {
            return error;
        }
    }

    public enum Status {
        FAILED, ABORTED
    }

    public enum Step {
        NONE,
        // TODO : Maybe reuse EventPublishingStep
        VALIDATION,
        ENRICHMENT,
        PARTITIONING
    }
}
<commit_msg>Updated TODO<commit_after>package org.zalando.nakadi.service.publishing.check;

import org.zalando.nakadi.domain.EventType;
import org.zalando.nakadi.domain.NakadiRecord;

import java.util.LinkedList;
import java.util.List;

public abstract class Check {

    public abstract List<RecordResult> execute(
            EventType eventType,
            List<NakadiRecord> records);

    public abstract Step getCurrentStep();

    protected List<RecordResult> processError(
            final List<NakadiRecord> records,
            final NakadiRecord failedRecord,
            final String error) {
        final List<RecordResult> recordResults = new LinkedList<>();
        boolean metFailedRecord = false;
        for (final NakadiRecord nakadiRecord : records) {
            if (failedRecord == nakadiRecord) {
                recordResults.add(new RecordResult(
                        Status.FAILED,
                        nakadiRecord.getMetadata().getEid(),
                        error));
                metFailedRecord = true;
            } else if (!metFailedRecord) {
                recordResults.add(new RecordResult(
                        Status.ABORTED,
                        nakadiRecord.getMetadata().getEid(),
                        ""));
            } else {
                recordResults.add(new RecordResult(
                        Status.ABORTED,
                        Step.NONE,
                        nakadiRecord.getMetadata().getEid(),
                        ""));
            }
        }

        return recordResults;
    }

    public class RecordResult {
        private final Status status;
        private final Step step;
        private final String eid;
        private final String error;

        public RecordResult(final Status status,
                            final Step step,
                            final String eid,
                            final String error) {
            this.status = status;
            this.step = step;
            this.eid = eid;
            this.error = error;
        }

        public RecordResult(final Status status,
                            final String eid,
                            final String error) {
            this(status, getCurrentStep(), eid, error);
        }

        public Status getStatus() {
            return status;
        }

        public Step getStep() {
            return step;
        }

        public String getEid() {
            return eid;
        }

        public String getError() {
            return error;
        }
    }

    public enum Status {
        FAILED, ABORTED
    }

    public enum Step {
        NONE,
        VALIDATION,
        ENRICHMENT,
        PARTITIONING
    }
}

{'fraction_non_alphanumeric': 0.07222121156994725, 'fraction_numerical': 0.0, 'mean_word_length': 1.3495726495726497, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '537299', 'n_tokens_mistral': 1351, 'n_tokens_neox': 1284, 'n_words': 329}