<commit_before>package com.breakersoft.plow.thrift;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;

import com.breakersoft.plow.exceptions.RndClientExecuteException;
import com.breakersoft.plow.rnd.thrift.RndException;
import com.breakersoft.plow.rnd.thrift.RndNodeApi;
import com.breakersoft.plow.rnd.thrift.RunTaskCommand;

public class RndClient {

    private static final Logger logger =
            org.slf4j.LoggerFactory.getLogger(RndClient.class);

    private final String host;
    private final int port;

    private TSocket transport;
    private TProtocol protocol;

    public RndClient(String host, int port) {
        this.host = host;
        this.port = port;
    }

    public RndNodeApi.Client connect() throws TTransportException {
        transport = new TSocket(host, port);
        protocol = new TBinaryProtocol(transport);
        transport.open();
        return new RndNodeApi.Client(protocol);
    }

    public void runProcess(RunTaskCommand command) {
        try {
            connect().runTask(command);
        } catch (RndException | TException e) {
            throw new RndClientExecuteException(e);
        }
        finally {
            transport.close();
        }
    }
}<commit_msg>Updated RndClient to use TFramedTransport.<commit_after>package com.breakersoft.plow.thrift;

import org.apache.thrift.TException;
import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TFramedTransport;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import org.apache.thrift.transport.TTransportException;
import org.slf4j.Logger;

import com.breakersoft.plow.exceptions.RndClientExecuteException;
import com.breakersoft.plow.rnd.thrift.RndException;
import com.breakersoft.plow.rnd.thrift.RndNodeApi;
import com.breakersoft.plow.rnd.thrift.RunTaskCommand;

public class RndClient {

    private static final Logger logger =
            org.slf4j.LoggerFactory.getLogger(RndClient.class);

    private final String host;
    private final int port;

    private TSocket socket;
    private TTransport transport;
    private TProtocol protocol;

    public RndClient(String host, int port) {
        this.host = host;
        this.port = port;
    }

    public RndNodeApi.Client connect() throws TTransportException {
        socket = new TSocket(host, port);
        transport = new TFramedTransport(socket);
        protocol = new TBinaryProtocol(socket);
        transport.open();
        return new RndNodeApi.Client(protocol);
    }

    public void runProcess(RunTaskCommand command) {
        try {
            connect().runTask(command);
        } catch (RndException | TException e) {
            throw new RndClientExecuteException(e);
        }
        finally {
            socket.close();
        }
    }
}
{'fraction_non_alphanumeric': 0.08963949334199416, 'fraction_numerical': 0.0012991230919129587, 'mean_word_length': 3.213406292749658, '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': '677566', 'n_tokens_mistral': 891, 'n_tokens_neox': 899, 'n_words': 184}