<commit_before>package com.monetate.koupler;

import java.io.BufferedReader;
import java.net.SocketException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Main Class, and super class to all the koupler implementations.
 * 
 * @author brianoneill
 */
public abstract class Koupler implements Runnable {
    private static final Logger LOGGER = LoggerFactory.getLogger(Koupler.class);
    public KinesisEventProducer producer;
    private ExecutorService threadPool;

    public Koupler(KinesisEventProducer producer, int threadPoolSize) {
        this.producer = producer;
        this.threadPool = Executors.newFixedThreadPool(threadPoolSize);
    }

    public ExecutorService getThreadPool() {
        return this.threadPool;
    }

    class KouplerThread implements Callable<Integer> {
        private BufferedReader bufferedReader;
        private boolean running = true;

        public KouplerThread(BufferedReader bufferedReader) {
            this.bufferedReader = bufferedReader;
        }

        @Override
        public Integer call() {
            int numOfEvents = 0; 
            while (running) {
                try {
                    String event = bufferedReader.readLine();
                    if (event != null) {
                        LOGGER.debug("Queueing event [{}]", event);
                        producer.queueEvent(event);
                        numOfEvents++;
                    } else {<commit_msg>Getting rid of trailing whitespace<commit_after>package com.monetate.koupler;

import java.io.BufferedReader;
import java.net.SocketException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Main Class, and super class to all the koupler implementations.
 * 
 * @author brianoneill
 */
public abstract class Koupler implements Runnable {
    private static final Logger LOGGER = LoggerFactory.getLogger(Koupler.class);
    public KinesisEventProducer producer;
    private ExecutorService threadPool;

    public Koupler(KinesisEventProducer producer, int threadPoolSize) {
        this.producer = producer;
        this.threadPool = Executors.newFixedThreadPool(threadPoolSize);
    }

    public ExecutorService getThreadPool() {
        return this.threadPool;
    }

    class KouplerThread implements Callable<Integer> {
        private BufferedReader bufferedReader;
        private boolean running = true;

        public KouplerThread(BufferedReader bufferedReader) {
            this.bufferedReader = bufferedReader;
        }

        @Override
        public Integer call() {
            int numOfEvents = 0;
            while (running) {
                try {
                    String event = bufferedReader.readLine();
                    if (event != null) {
                        LOGGER.debug("Queueing event [{}]", event);
                        producer.queueEvent(event);
                        numOfEvents++;
                    } else {
{'fraction_non_alphanumeric': 0.08230231307154384, 'fraction_numerical': 0.0016137708445400753, 'mean_word_length': 2.7414486921529173, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2266594', 'n_tokens_mistral': 1002, 'n_tokens_neox': 963, 'n_words': 224}