<commit_before>action :start_master do

  bash "start-master" do
    user node[:spark][:user]
    group node[:spark][:group]
    code <<-EOF
     #{node[:spark][:home]}/sbin/start-master.sh
    EOF
  end
 
end


action :start_slave do

  bash "start-slave" do
    user node[:spark][:user]
    group node[:spark][:group]
    code <<-EOF
    set -e

    cd #{node[:spark][:home]}    
# Spark 1.4.x
#    ./sbin/start-slave.sh #{new_resource.master_url}
# Spark 1.3.x
    ./sbin/start-slave.sh #{new_resource.slave_id} #{new_resource.master_url}
    EOF
#    not_if "#{node[:spark][:home]}/sbin/start-slave.sh --properties-file #{node[:spark][:home]}/conf/spark-defaults.conf | grep \"stop it first\""
  end
 
end<commit_msg>only start worker if one is not already running as a java process on this machine<commit_after>action :start_master do

  bash "start-master" do
    user node[:spark][:user]
    group node[:spark][:group]
    code <<-EOF
     #{node[:spark][:home]}/sbin/start-master.sh
    EOF
  end
 
end


action :start_slave do

  bash "start-slave" do
    user node[:spark][:user]
    group node[:spark][:group]
    code <<-EOF
    set -e

    cd #{node[:spark][:home]}    
# Spark 1.4.x
#    ./sbin/start-slave.sh #{new_resource.master_url}
# Spark 1.3.x
    ./sbin/start-slave.sh #{new_resource.slave_id} #{new_resource.master_url}
    EOF
#    not_if "#{node[:spark][:home]}/sbin/start-slave.sh --properties-file #{node[:spark][:home]}/conf/spark-defaults.conf | grep \"stop it first\""
     not_if "jps | grep Worker"
  end
 
end
{'fraction_non_alphanumeric': 0.17055771725032426, 'fraction_numerical': 0.005188067444876783, 'mean_word_length': 3.192934782608696, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1259309', 'n_tokens_mistral': 606, 'n_tokens_neox': 558, 'n_words': 122}