<commit_before>package ru.stqa.selenium.zkgrid;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParametersDelegate;
import com.beust.jcommander.internal.Lists;
import com.google.common.io.Files;
import ru.stqa.selenium.zkgrid.hub.Hub;
import ru.stqa.selenium.zkgrid.node.Node;

import java.util.List;
import java.util.Properties;

public class Main {

  public static void main(String[] args) throws Exception {

    final Main main = new Main();
    new JCommander(main, args);

    if (main.role == null) {
      throw new Error("Unknown role " + main.role);
    }

    switch (main.role) {
      case HUB: {
        Properties properties = new Properties(){{
          setProperty("dataDir", Files.createTempDir().getAbsolutePath());
          setProperty("clientPort", main.hubParameters.getPort());
          setProperty("server.1", "localhost:5444:6444");
        }};
        Hub hub = new Hub(properties);
        hub.start();
        break;
      }
      case NODE: {
        Node node = new Node(main.nodeParameters.hubConnectionString);
        node.start();
        break;
      }
      default: {
        throw new Error("Unknown role " + main.role);
      }
    }
  }

  @Parameter(names = "-role", description = "\"hub\" or \"node\"", converter = RoleConverter.class)
  private Role role;

  @ParametersDelegate
  private HubParameters hubParameters = new HubParameters();

  @ParametersDelegate
  private NodeParameters nodeParameters = new NodeParameters();

  @Parameter
  List<String> otherParameters = Lists.newArrayList();

  private enum Role {
    HUB, NODE
  }

  public static class RoleConverter implements IStringConverter<Role> {
    @Override
    public Role convert(String s) {
      return Role.valueOf(s.toUpperCase());
    }
  }
}<commit_msg>Removing unused field<commit_after>package ru.stqa.selenium.zkgrid;

import com.beust.jcommander.IStringConverter;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParametersDelegate;
import com.beust.jcommander.internal.Lists;
import com.google.common.io.Files;
import ru.stqa.selenium.zkgrid.hub.Hub;
import ru.stqa.selenium.zkgrid.node.Node;

import java.util.List;
import java.util.Properties;

public class Main {

  public static void main(String[] args) throws Exception {

    final Main main = new Main();
    new JCommander(main, args);

    if (main.role == null) {
      throw new Error("Unknown role " + main.role);
    }

    switch (main.role) {
      case HUB: {
        Properties properties = new Properties(){{
          setProperty("dataDir", Files.createTempDir().getAbsolutePath());
          setProperty("clientPort", main.hubParameters.getPort());
          setProperty("server.1", "localhost:5444:6444");
        }};
        Hub hub = new Hub(properties);
        hub.start();
        break;
      }
      case NODE: {
        Node node = new Node(main.nodeParameters.hubConnectionString);
        node.start();
        break;
      }
      default: {
        throw new Error("Unknown role " + main.role);
      }
    }
  }

  @Parameter(names = "-role", description = "\"hub\" or \"node\"", converter = RoleConverter.class)
  private Role role;

  @ParametersDelegate
  private HubParameters hubParameters = new HubParameters();

  @ParametersDelegate
  private NodeParameters nodeParameters = new NodeParameters();

  private enum Role {
    HUB, NODE
  }

  public static class RoleConverter implements IStringConverter<Role> {
    @Override
    public Role convert(String s) {
      return Role.valueOf(s.toUpperCase());
    }
  }
}
{'fraction_non_alphanumeric': 0.11841038118410381, 'fraction_numerical': 0.004866180048661801, 'mean_word_length': 3.1294642857142856, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1683793', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1075, 'n_words': 252}