<commit_before>package net.hawkengine.core;

import net.hawkengine.core.materialhandler.MaterialTracker;
import net.hawkengine.core.pipelinescheduler.JobAssigner;
import net.hawkengine.core.pipelinescheduler.PipelinePreparer;
import net.hawkengine.core.utilities.DataImporter;
import net.hawkengine.db.redis.RedisManager;
import net.hawkengine.ws.WsServlet;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.glassfish.jersey.servlet.ServletContainer;

public class HawkServer {
    private Server server;
    private Thread pipelinePreparer;
    private Thread jobAssigner;
    private Thread materialTracker;
    private DataImporter dataImporter;

    public HawkServer() {
        RedisManager.connect();

        //setting server thread pool
        final QueuedThreadPool threadPool=new QueuedThreadPool(10);
        threadPool.setName("http-worker");
        this.server = new Server(threadPool);

        this.pipelinePreparer = new Thread(new PipelinePreparer(), "PipelineScheduler");
        this.jobAssigner = new Thread(new JobAssigner(),"JobAssigner");
        this.materialTracker = new Thread(new MaterialTracker(), "MaterialTracker");
        this.dataImporter = new DataImporter();
    }

    public void configureJetty() {
        // HTTP connector
        ServerConnector connector = new ServerConnector(this.server);
        int port = ServerConfiguration.getConfiguration().getServerPort();
        connector.setPort(port);
        this.server.addConnector(connector);

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");

        ResourceHandler resourceHandler = new ResourceHandler();
        resourceHandler.setDirectoriesListed(true);<commit_msg>Set max Queued Threads in Jetty to 100 <commit_after>package net.hawkengine.core;

import net.hawkengine.core.materialhandler.MaterialTracker;
import net.hawkengine.core.pipelinescheduler.JobAssigner;
import net.hawkengine.core.pipelinescheduler.PipelinePreparer;
import net.hawkengine.core.utilities.DataImporter;
import net.hawkengine.db.redis.RedisManager;
import net.hawkengine.ws.WsServlet;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.DefaultHandler;
import org.eclipse.jetty.server.handler.HandlerList;
import org.eclipse.jetty.server.handler.ResourceHandler;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.glassfish.jersey.servlet.ServletContainer;

public class HawkServer {
    private Server server;
    private Thread pipelinePreparer;
    private Thread jobAssigner;
    private Thread materialTracker;
    private DataImporter dataImporter;

    public HawkServer() {
        RedisManager.connect();

        //setting server thread pool
        final QueuedThreadPool threadPool=new QueuedThreadPool(100);
        threadPool.setName("http-worker");
        this.server = new Server(threadPool);

        this.pipelinePreparer = new Thread(new PipelinePreparer(), "PipelineScheduler");
        this.jobAssigner = new Thread(new JobAssigner(),"JobAssigner");
        this.materialTracker = new Thread(new MaterialTracker(), "MaterialTracker");
        this.dataImporter = new DataImporter();
    }

    public void configureJetty() {
        // HTTP connector
        ServerConnector connector = new ServerConnector(this.server);
        int port = ServerConfiguration.getConfiguration().getServerPort();
        connector.setPort(port);
        this.server.addConnector(connector);

        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
        context.setContextPath("/");

        ResourceHandler resourceHandler = new ResourceHandler();
        resourceHandler.setDirectoriesListed(true);
{'fraction_non_alphanumeric': 0.09292744335088121, 'fraction_numerical': 0.0018310826276035706, 'mean_word_length': 4.455680399500624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6957255', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1166, 'n_words': 223}