<commit_before>puts "This tool starts a Cassandra DB cluster with predefined servers"

nodes_ips = []
ARGV.each do |node| nodes_ips << node
  p node
end

number_of_nodes = nodes_ips.size
number_of_nodes > 3 ? number_of_seeds = number_of_nodes / 2 : number_of_seeds = 1

#stop and removing existing containers
nodes_ips.each do |node|
  cmd = "ssh root@#{node} 'docker rm -f $(docker ps -a -q)'"
  system(cmd)
end

#init seed nodes
seeds = nodes_ips.sample(number_of_seeds)
seeds.each do |node|
  cmd = "ssh root@#{node} docker run --name node#{nodes_ips.index(node)} "\
        "-d -e CASSANDRA_BROADCAST_ADDRESS=#{node} -e CASSANDRA_ENDPOINT_SNITCH='GossipingPropertyFileSnitch' "\
        "-p 7000:7000 -p 9042:9042 cassandra:latest"<commit_msg>start cassandra cluster bug solved<commit_after>puts "This tool starts a Cassandra DB cluster with predefined servers"

nodes_ips = []
ARGV.each { |node| nodes_ips << node }

number_of_nodes = nodes_ips.size
number_of_nodes > 3 ? number_of_seeds = number_of_nodes / 2 : number_of_seeds = 1

#stop and removing existing containers
nodes_ips.each do |node|
  cmd = "ssh root@#{node} 'docker rm -f $(docker ps -a -q)'"
  system(cmd)
end

#init seed nodes
seeds = nodes_ips.sample(number_of_seeds)
seeds.each do |node|
  cmd = "ssh root@#{node} docker run --name node#{nodes_ips.index(node)} "\
        "-d -e CASSANDRA_BROADCAST_ADDRESS=#{node} -e CASSANDRA_ENDPOINT_SNITCH='GossipingPropertyFileSnitch' "\
        "-p 7000:7000 -p 9042:9042 cassandra:latest"
{'fraction_non_alphanumeric': 0.1157684630738523, 'fraction_numerical': 0.025282767797737856, 'mean_word_length': 4.549815498154982, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5608665', 'n_tokens_mistral': 584, 'n_tokens_neox': 546, 'n_words': 147}