<commit_before>package net.iponweb.disthene.reader;

import com.datastax.driver.core.*;
import com.datastax.driver.core.policies.RoundRobinPolicy;
import com.datastax.driver.core.policies.TokenAwarePolicy;
import org.apache.log4j.Logger;

/**
 * @author <NAME>
 */
public class CassandraService {

    private static final String[] CASSANDRA_CPS = {
            "cassandra11.devops.iponweb.net",
            "cassandra12.devops.iponweb.net",
            "cassandra17.devops.iponweb.net",
            "cassandra18.devops.iponweb.net"
    };
    private final static Logger logger = Logger.getLogger(Main.class);


    private static volatile CassandraService instance = null;

    private Session session;

    public static CassandraService getInstance() {
        if (instance == null) {
            synchronized (PathsService.class) {
                if (instance == null) {
                    instance = new CassandraService();
                }
            }
        }

        return instance;
    }

    public CassandraService() {
        SocketOptions socketOptions = new SocketOptions();
        socketOptions.setReceiveBufferSize(8388608);
        socketOptions.setSendBufferSize(1048576);
        socketOptions.setTcpNoDelay(false);
        socketOptions.setReadTimeoutMillis(1000000);
        socketOptions.setReadTimeoutMillis(1000000);

        Cluster.Builder builder = Cluster.builder()
                .withSocketOptions(socketOptions)
                .withCompression(ProtocolOptions.Compression.LZ4)
                .withLoadBalancingPolicy(new TokenAwarePolicy(new RoundRobinPolicy()))<commit_msg>Added policy<commit_after>package net.iponweb.disthene.reader;

import com.datastax.driver.core.*;
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy;
import com.datastax.driver.core.policies.TokenAwarePolicy;
import org.apache.log4j.Logger;

/**
 * @author <NAME>
 */
public class CassandraService {

    private static final String[] CASSANDRA_CPS = {
            "cassandra11.devops.iponweb.net",
            "cassandra12.devops.iponweb.net",
            "cassandra17.devops.iponweb.net",
            "cassandra18.devops.iponweb.net"
    };
    private final static Logger logger = Logger.getLogger(Main.class);


    private static volatile CassandraService instance = null;

    private Session session;

    public static CassandraService getInstance() {
        if (instance == null) {
            synchronized (PathsService.class) {
                if (instance == null) {
                    instance = new CassandraService();
                }
            }
        }

        return instance;
    }

    public CassandraService() {
        SocketOptions socketOptions = new SocketOptions();
        socketOptions.setReceiveBufferSize(8388608);
        socketOptions.setSendBufferSize(1048576);
        socketOptions.setTcpNoDelay(false);
        socketOptions.setReadTimeoutMillis(1000000);
        socketOptions.setReadTimeoutMillis(1000000);

        Cluster.Builder builder = Cluster.builder()
                .withSocketOptions(socketOptions)
                .withCompression(ProtocolOptions.Compression.LZ4)
                .withLoadBalancingPolicy(new TokenAwarePolicy(new DCAwareRoundRobinPolicy()))
{'fraction_non_alphanumeric': 0.09233610341643583, 'fraction_numerical': 0.023391812865497075, 'mean_word_length': 2.6681715575620766, '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': '1692986', 'n_tokens_mistral': 966, 'n_tokens_neox': 894, 'n_words': 150}