<commit_before>apiVersion: v1
kind: ReplicationController
metadata:
    name: kafka
spec:
    # used 3 replicas in order to have alwayas majority for leader election
    replicas: 3
    selector:
        name: kafka
    template:
        metadata:
            labels:
                name: kafka
        spec:
            containers:
                -
                    name: kafka
                    image: "ppatierno/kaas:0.1"
                    ports:
                        - containerPort: 9092
                    command:
                        - /opt/kafka_2.11-0.9.0.1/kafka_run.sh
                    volumeMounts:
                        - 
                            name: kafka-persistent-storage
                            mountPath: /tmp/kafka/
            volumes:
                - name: kafka-persistent-storage
                  persistentVolumeClaim:
                    claimName: kafkaclaim<commit_msg>Added gracefully shutdown of Kafka server with preStop hook in the Kafka replication controller<commit_after>apiVersion: v1
kind: ReplicationController
metadata:
    name: kafka
spec:
    # used 3 replicas in order to have alwayas majority for leader election
    replicas: 3
    selector:
        name: kafka
    template:
        metadata:
            labels:
                name: kafka
        spec:
            containers:
                -
                    name: kafka
                    image: "ppatierno/kaas:0.1"
                    ports:
                        - containerPort: 9092
                    command:
                        - /opt/kafka_2.11-0.9.0.1/kafka_run.sh
                    volumeMounts:
                        - 
                            name: kafka-persistent-storage
                            mountPath: /tmp/kafka/
                    lifecycle:
                        preStop:
                            exec:
                                command:
                                    - /opt/kafka_2.11-0.9.0.1/bin/kafka-server-stop.sh
            volumes:
                - name: kafka-persistent-storage
                  persistentVolumeClaim:
                    claimName: kafkaclaim
{'fraction_non_alphanumeric': 0.05939226519337017, 'fraction_numerical': 0.017955801104972375, 'mean_word_length': 0.9349955476402493, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 3, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5290828', 'n_tokens_mistral': 571, 'n_tokens_neox': 523, 'n_words': 121}