<commit_before>#
# Cookbook Name:: zookeeper
# Recipe:: default
# Author:: <EMAIL> / <EMAIL>
#
# Copyright 2012, Webtrends Inc.
#
# All rights reserved - Do Not Redistribute

# This recipe installs the needed components to prepare machine for db_index exe

include_recipe 'java'
include_recipe 'runit'

source_tarball  = node.zookeeper_attrib(:download_url)[/\/([^\/\?]+)(\?.*)?$/, 1]
source_fullpath = File.join(Chef::Config[:file_cache_path], source_tarball)

# servers in this cluster
zookeeper_nodes = zookeeper_search('zookeeper').sort

# setup zookeeper group
group 'zookeeper'

# setup zookeeper user<commit_msg>resolve corner case for single node cluster<commit_after>#
# Cookbook Name:: zookeeper
# Recipe:: default
# Author:: <EMAIL> / <EMAIL>
#
# Copyright 2012, Webtrends Inc.
#
# All rights reserved - Do Not Redistribute

# This recipe installs the needed components to prepare machine for db_index exe

include_recipe 'java'
include_recipe 'runit'

source_tarball  = node.zookeeper_attrib(:download_url)[/\/([^\/\?]+)(\?.*)?$/, 1]
source_fullpath = File.join(Chef::Config[:file_cache_path], source_tarball)

# servers in this cluster
zookeeper_nodes = zookeeper_search('zookeeper').sort
if zookeeper_nodes.count == 0
	# corner case:  in single node cluster, role is never found in search until node state is saved.
	node.save
	zookeeper_nodes = zookeeper_search('zookeeper').sort
	raise Chef::Exceptions::RoleNotFound, "zookeeper role not found" if zookeeper_nodes.count == 0
end

# setup zookeeper group
group 'zookeeper'

# setup zookeeper user
{'fraction_non_alphanumeric': 0.11915438821268418, 'fraction_numerical': 0.007687379884689302, 'mean_word_length': 5.563025210084033, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4317418', 'n_tokens_mistral': 530, 'n_tokens_neox': 514, 'n_words': 148}