<commit_before>package org.distbc;

import co.paralleluniverse.galaxy.Grid;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.pool.KryoFactory;
import com.esotericsoftware.kryo.pool.KryoPool;
import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import org.distbc.data.structures.SkipList;

public class DistBufferCacheApplication extends Application<DistBufferCacheConfiguration> {
    public static void main(String[] args) throws Exception {
        new DistBufferCacheApplication().run(args);
    }

    private static KryoFactory kryoFactory = () -> {
        Kryo kryo = new Kryo();
        // configure kryo instance, customize settings
        kryo.register(SkipList.class, 0);
        return kryo;
    };

    @Override
    public String getName() {
        return "dist-bc";
    }

    @Override
    public void initialize(Bootstrap<DistBufferCacheConfiguration> bootstrap) {
        // no op
    }

    @Override
    public void run(DistBufferCacheConfiguration configuration, Environment environment) {
        Grid g = startupGalaxy(configuration);

        KryoPool pool = new KryoPool.Builder(kryoFactory).softReferences().build();

        DistBufferCacheResourceImpl resource = new DistBufferCacheResourceImpl(g, pool);
        environment.jersey().register(resource);

        environment.healthChecks().register("galaxy", new GalaxyHealthCheck(g));
    }

    private Grid startupGalaxy(DistBufferCacheConfiguration configuration) {
        Grid g;
        try {
            g = Grid.getInstance(configuration.getDefaultPeerXml(), configuration.getDefaultPeerProperties());
            g.goOnline();
        } catch (Exception xcp) {
            // when we catch any exception, there's no point in bringing this node online
            // fail the startup
            throw new RuntimeException(xcp);
        }
        return g;
    }
}<commit_msg>- removing kryo business out of this class<commit_after>package org.distbc;

import co.paralleluniverse.galaxy.Grid;
import io.dropwizard.Application;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;

public class DistBufferCacheApplication extends Application<DistBufferCacheConfiguration> {
    public static void main(String[] args) throws Exception {
        new DistBufferCacheApplication().run(args);
    }

    @Override
    public String getName() {
        return "dist-bc";
    }

    @Override
    public void initialize(Bootstrap<DistBufferCacheConfiguration> bootstrap) {
        // no op
    }

    @Override
    public void run(DistBufferCacheConfiguration configuration, Environment environment) {
        Grid g = startupGalaxy(configuration);

        DistBufferCacheResourceImpl resource = new DistBufferCacheResourceImpl(g);
        environment.jersey().register(resource);

        environment.healthChecks().register("galaxy", new GalaxyHealthCheck(g));
    }

    private Grid startupGalaxy(DistBufferCacheConfiguration configuration) {
        Grid g;
        try {
            g = Grid.getInstance(configuration.getDefaultPeerXml(), configuration.getDefaultPeerProperties());
            g.goOnline();
        } catch (Exception xcp) {
            // when we catch any exception, there's no point in bringing this node online
            // fail the startup
            throw new RuntimeException(xcp);
        }
        return g;
    }
}
{'fraction_non_alphanumeric': 0.0878162256469904, 'fraction_numerical': 0.0002907822041291073, 'mean_word_length': 3.144578313253012, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, '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': '1892188', 'n_tokens_mistral': 910, 'n_tokens_neox': 880, 'n_words': 217}