<commit_before>package de.hdm.wim.cep.patterns;

import de.hdm.wim.events.MessageEvent;
import org.apache.flink.cep.CEP;
import org.apache.flink.cep.PatternStream;
import org.apache.flink.cep.pattern.Pattern;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * Created by Ben on 19.01.2017.
 */
public class TestPattern {

    /**
     * Run.
     *
     * @param env           the env
     * @param messageStream the message stream
     */
    public void run(StreamExecutionEnvironment env, DataStream<MessageEvent> messageStream ) {

        // Match all event with MessageId = 1
        Pattern<MessageEvent, ?> testPattern = Pattern
                .<MessageEvent>begin("first")
                .where(evt -> evt.getMessageId() == 1);

        // Create a pattern stream from our project pattern
        PatternStream<MessageEvent> testPatternStream = CEP.pattern(
                messageStream,
                testPattern);

        // Generate ProjectEvents for each matched project pattern
        DataStream<MessageEvent> result = testPatternStream.select(
                pattern -> {
                    return pattern.get("first");
                }
        );

        // print to stdout
        result.print();
    }
}
<commit_msg>moved and updated<commit_after>package de.hdm.wim.cep.patterns;

import de.hdm.wim.cep.events.MessageEvent;
import org.apache.flink.cep.CEP;
import org.apache.flink.cep.PatternStream;
import org.apache.flink.cep.pattern.Pattern;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * Created by Ben on 19.01.2017.
 */
public class TestPattern {

    /**
     * Run.
     *
     * @param env           the env
     * @param messageStream the message stream
     */
    public void run(StreamExecutionEnvironment env, DataStream<MessageEvent> messageStream ) {

        // Match all event with MessageId = 1
        Pattern<MessageEvent, ?> testPattern = Pattern
                .<MessageEvent>begin("first")
                .where(evt -> evt.getMessageId() == 1);

        // Create a pattern stream from our project pattern
        PatternStream<MessageEvent> testPatternStream = CEP.pattern(
                messageStream,
                testPattern);

        // Generate ProjectEvents for each matched project pattern
        DataStream<MessageEvent> result = testPatternStream.select(
                pattern -> {
                    return pattern.get("first");
                }
        );

        // print to stdout
        result.print();
    }
}

{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.007434944237918215, 'mean_word_length': 2.25, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 17, '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': '7146556', 'n_tokens_mistral': 750, 'n_tokens_neox': 713, 'n_words': 164}