<commit_before>
package au.com.mountainpass.ryvr.testclient;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@Component
@Profile(value = { "distZipRun" })
public class RyvrTestDistZipRunServerProcessBuilder implements RyvrTestServerProcessBuilder {

  public final Logger LOGGER = LoggerFactory.getLogger(this.getClass());

  @Value("${spring.datasource.password}")
  private String springDatasourcePassword;

  @Value("${spring.datasource.url}")
  private String springDatasourceUrl;

  @Value("${spring.datasource.username}")
  private String springDatasourceUsername;

  protected static final String APPLICATION_YML = "build/distZipRun-application.yml";

  @Override
  public ProcessBuilder getProcessBuilder() {
    ProcessBuilder setupPb = new ProcessBuilder("bash", "./gradlew", "unzipDistZip").inheritIO();
    try {
      Process setupProcess = setupPb.start();
      setupProcess.waitFor(30, TimeUnit.SECONDS);
    } catch (IOException | InterruptedException e) {
      throw new RuntimeException(e);
    }
    try (FileReader fr = new FileReader(APPLICATION_YML);
        FileWriter fw = new FileWriter("build/distributions/ryvr/etc/application.yml", true)) {
      int c = fr.read();
      while (c != -1) {
        fw.write(c);
        c = fr.read();
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

    return new ProcessBuilder("bash", "./gradlew", "distZipRun");
  }

  @Override
  public void createApplicationProperties(List<Map<String, String>> dataSourcesRyvrConfigs)
      throws IOException {
    new File(APPLICATION_YML).getParentFile().mkdirs();
    new File(APPLICATION_YML).delete();
    final FileWriter fileWriter = new FileWriter(APPLICATION_YML);
    final StringWriter writer = new StringWriter();
    writer.write("au.com.mountainpass.ryvr:\n");
    writer.write("  data-sources:\n");
    writer.write("    - url: " + springDatasourceUrl + "\n");
    writer.write("      username: " + springDatasourceUsername + "\n");
    writer.write("      password: " + <PASSWORD>DatasourcePassword + "\n");
    if (!dataSourcesRyvrConfigs.isEmpty()) {
      writer.write("      ryvrs:\n");
      for (final Map<String, String> config : dataSourcesRyvrConfigs) {
        writer.write("        " + config.get("name") + ":\n");
        writer.write("          page-size: " + config.get("page size") + "\n");
        writer.write("          catalog: " + config.get("database") + "\n");
        writer.write("          table: " + config.get("table") + "\n");
        writer.write("          ordered-by: " + config.get("ordered by") + "\n");
      }
    }
    writer.close();
    LOGGER.info("CONFIG:\r\n{}", writer.getBuffer().toString());
    fileWriter.write(writer.getBuffer().toString());
    fileWriter.close();
  }

}<commit_msg>Fixed config set for DistZip tests<commit_after>
package au.com.mountainpass.ryvr.testclient;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

@Component
@Profile(value = { "distZipRun" })
public class RyvrTestDistZipRunServerProcessBuilder implements RyvrTestServerProcessBuilder {

  public final Logger LOGGER = LoggerFactory.getLogger(this.getClass());

  @Value("${spring.datasource.password}")
  private String springDatasourcePassword;

  @Value("${spring.datasource.url}")
  private String springDatasourceUrl;

  @Value("${spring.datasource.username}")
  private String springDatasourceUsername;

  protected static final String APPLICATION_YML = "build/distZipRun-application.yml";

  @Override
  public ProcessBuilder getProcessBuilder() {
    ProcessBuilder setupPb = new ProcessBuilder("bash", "./gradlew", "unzipDistZip").inheritIO();
    try {
      Process setupProcess = setupPb.start();
      setupProcess.waitFor(30, TimeUnit.SECONDS);
    } catch (IOException | InterruptedException e) {
      throw new RuntimeException(e);
    }
    try (FileReader fr = new FileReader(APPLICATION_YML);
        FileWriter fw = new FileWriter("build/distributions/ryvr/etc/application.yml", true)) {
      fw.write("\n");
      int c = fr.read();
      while (c != -1) {
        fw.write(c);
        c = fr.read();
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    // make sure we don't let gradle unzip the dist again, as that would
    // overwrite our config changes
    return new ProcessBuilder("bash", "./gradlew", "distZipRun", "-x", "unzipDistZip");
  }

  @Override
  public void createApplicationProperties(List<Map<String, String>> dataSourcesRyvrConfigs)
      throws IOException {
    new File(APPLICATION_YML).getParentFile().mkdirs();
    new File(APPLICATION_YML).delete();
    final FileWriter fileWriter = new FileWriter(APPLICATION_YML);
    final StringWriter writer = new StringWriter();
    writer.write("au.com.mountainpass.ryvr.data-sources:\n");
    writer.write("  - url: " + springDatasourceUrl + "\n");
    writer.write("    username: " + springDatasourceUsername + "\n");
    writer.write("    password: " + <PASSWORD> + "\n");
    if (!dataSourcesRyvrConfigs.isEmpty()) {
      writer.write("    ryvrs:\n");
      for (final Map<String, String> config : dataSourcesRyvrConfigs) {
        writer.write("      " + config.get("name") + ":\n");
        writer.write("        page-size: " + config.get("page size") + "\n");
        writer.write("        catalog: " + config.get("database") + "\n");
        writer.write("        table: " + config.get("table") + "\n");
        writer.write("        ordered-by: " + config.get("ordered by") + "\n");
      }
    }
    writer.close();
    LOGGER.info("CONFIG:\r\n{}", writer.getBuffer().toString());
    fileWriter.write(writer.getBuffer().toString());
    fileWriter.close();
  }

}
{'fraction_non_alphanumeric': 0.142901377922279, 'fraction_numerical': 0.0015482272797646694, 'mean_word_length': 3.654178674351585, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, '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': '3756067', 'n_tokens_mistral': 1978, 'n_tokens_neox': 1920, 'n_words': 395}