<commit_before>package com.bizbeam.s3.uploader.concurrent;

import com.beust.jcommander.internal.Lists;
import com.bizbeam.s3.uploader.S3Connector;
import com.bizbeam.s3.uploader.jcommander.JCommanderParams;
import com.google.common.base.Stopwatch;
import org.apache.log4j.Logger;

import java.io.File;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

public class S3ConnectorThread extends Thread {


    private int mThreadNo = -1;
    S3Connector s3Connector;
    JCommanderParams mJCommanderParams;
    private boolean result = false;
    Stopwatch stopwatch = Stopwatch.createUnstarted();
    String mTemporaryFolder;
    double mAvgTime;

    public S3ConnectorThread(JCommanderParams jCommanderParams, int threadNo) {
        super();
        mThreadNo = threadNo;
        mJCommanderParams = jCommanderParams;
        mTemporaryFolder = UUID.randomUUID().toString().replace("-","");
    }

    @Override
    public void run() {
        super.run();
        LOGGER.info("Thread: " + mThreadNo + " started.");
        sleep(200);

        try {
            s3Connector = new S3Connector(mJCommanderParams.getBucketName(),
                    mJCommanderParams.getAccessKey(), mJCommanderParams.getSecretKey());
            s3Connector.initialize();

            sleep(2000);

            sendFiles();
            result = true;

        } catch (Exception exc) {
            LOGGER.error("Error in thread no. " + mThreadNo, exc);
        }

    }

    private void sendFiles() {
        try {

            String[] allFiles = new File(".").list();
            List<File> filesToUpload = Lists.newArrayList();
            for (String file : allFiles) {
                if (file.contains("app") || file.contains(".jar") || file.contains(".sh"))
                    continue;
                File f = new File(file);
                if (f.isDirectory())
                    continue;

                filesToUpload.add(f);
            }

            stopwatch.start();

            for (File file : filesToUpload) {
                s3Connector.uploadFile(mTemporaryFolder, file);
                s3Connector.removeFile(mTemporaryFolder, file.getName());
            }

            stopwatch.stop();
            long milliSeconds = stopwatch.elapsed(TimeUnit.MILLISECONDS);
            double secondsForSingleOperation = (milliSeconds/(filesToUpload.size()*2.0))/1000;
            mAvgTime = secondsForSingleOperation;

        } catch (Exception exc) {
            LOGGER.error("Error in connection in thread no. : " + mThreadNo, exc);
        }
    }

    public boolean getResult() {
        return result;
    }<commit_msg>do not send log files<commit_after>package com.bizbeam.s3.uploader.concurrent;

import com.beust.jcommander.internal.Lists;
import com.bizbeam.s3.uploader.S3Connector;
import com.bizbeam.s3.uploader.jcommander.JCommanderParams;
import com.google.common.base.Stopwatch;
import org.apache.log4j.Logger;

import java.io.File;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

public class S3ConnectorThread extends Thread {


    private int mThreadNo = -1;
    S3Connector s3Connector;
    JCommanderParams mJCommanderParams;
    private boolean result = false;
    Stopwatch stopwatch = Stopwatch.createUnstarted();
    String mTemporaryFolder;
    double mAvgTime;

    public S3ConnectorThread(JCommanderParams jCommanderParams, int threadNo) {
        super();
        mThreadNo = threadNo;
        mJCommanderParams = jCommanderParams;
        mTemporaryFolder = UUID.randomUUID().toString().replace("-","");
    }

    @Override
    public void run() {
        super.run();
        LOGGER.info("Thread: " + mThreadNo + " started.");
        sleep(200);

        try {
            s3Connector = new S3Connector(mJCommanderParams.getBucketName(),
                    mJCommanderParams.getAccessKey(), mJCommanderParams.getSecretKey());
            s3Connector.initialize();

            sleep(2000);

            sendFiles();
            result = true;

        } catch (Exception exc) {
            LOGGER.error("Error in thread no. " + mThreadNo, exc);
        }

    }

    private void sendFiles() {
        try {

            String[] allFiles = new File(".").list();
            List<File> filesToUpload = Lists.newArrayList();
            for (String file : allFiles) {
                if (file.contains("app") || file.contains(".jar") || file.contains(".sh") || file.contains(".log"))
                    continue;
                File f = new File(file);
                if (f.isDirectory())
                    continue;

                filesToUpload.add(f);
            }

            stopwatch.start();

            for (File file : filesToUpload) {
                s3Connector.uploadFile(mTemporaryFolder, file);
                s3Connector.removeFile(mTemporaryFolder, file.getName());
            }

            stopwatch.stop();
            long milliSeconds = stopwatch.elapsed(TimeUnit.MILLISECONDS);
            double secondsForSingleOperation = (milliSeconds/(filesToUpload.size()*2.0))/1000;
            mAvgTime = secondsForSingleOperation;

        } catch (Exception exc) {
            LOGGER.error("Error in connection in thread no. : " + mThreadNo, exc);
        }
    }

    public boolean getResult() {
        return result;
    }
{'fraction_non_alphanumeric': 0.10964012679470446, 'fraction_numerical': 0.0104419168375909, 'mean_word_length': 2.2023880597014927, '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': '7252082', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1504, 'n_words': 299}