<commit_before>#
# Cookbook Name:: elasticsearch
# Recipe:: smf
#
# Copyright (C) 2014 Wanelo, Inc.
#

include_recipe 'smf'
include_recipe 'elasticsearch::memory'

smf 'pkgsrc/elasticsearch' do
  action :delete
end

elasticsearch_environment = {
  'PATH' => node['elasticsearch']['path'],
  'JAVA_HOME' => node['elasticsearch']['java_home'],
}
elasticsearch_environment['ES_USE_GC_LOGGING'] = 1 if node['elasticsearch']['verbose_gc']
elasticsearch_environment['ES_USE_G1GC'] = 1 if node['elasticsearch']['garbage_collector'] == 'G1GC'

smf 'elasticsearch' do
  start_command '/opt/local/bin/elasticsearch -d -Xms%{min_heap} -Xmx%{max_heap} -Des.index.store.type=%{store_type}'
  start_timeout 60
  stop_timeout 60
  refresh_timeout 60

  project 'elastic'
  user 'elastic'
  group 'elastic'
  working_directory '/var/tmp/elasticsearch'

  environment elasticsearch_environment

  property_groups({
    'application' => {
      'min_heap' => node['elasticsearch']['min_heap'],
      'max_heap' => node['elasticsearch']['max_heap'],
      'store_type' => 'niofs'
    }
  })

  notifies :restart, 'service[elasticsearch]'
end
<commit_msg>set UTF-8 encoding for service<commit_after>#
# Cookbook Name:: elasticsearch
# Recipe:: smf
#
# Copyright (C) 2014 Wanelo, Inc.
#

include_recipe 'smf'
include_recipe 'elasticsearch::memory'

smf 'pkgsrc/elasticsearch' do
  action :delete
end

elasticsearch_environment = {
  'PATH' => node['elasticsearch']['path'],
  'JAVA_HOME' => node['elasticsearch']['java_home'],
  'LANG' => 'en_US.UTF-8',
  'LC_ALL' => 'en_US.UTF-8'
}
elasticsearch_environment['ES_USE_GC_LOGGING'] = 1 if node['elasticsearch']['verbose_gc']
elasticsearch_environment['ES_USE_G1GC'] = 1 if node['elasticsearch']['garbage_collector'] == 'G1GC'

smf 'elasticsearch' do
  start_command '/opt/local/bin/elasticsearch -d -Xms%{min_heap} -Xmx%{max_heap} -Des.index.store.type=%{store_type}'
  start_timeout 60
  stop_timeout 60
  refresh_timeout 60

  project 'elastic'
  user 'elastic'
  group 'elastic'
  working_directory '/var/tmp/elasticsearch'

  environment elasticsearch_environment

  property_groups({
    'application' => {
      'min_heap' => node['elasticsearch']['min_heap'],
      'max_heap' => node['elasticsearch']['max_heap'],
      'store_type' => 'niofs'
    }
  })

  notifies :restart, 'service[elasticsearch]'
end

{'fraction_non_alphanumeric': 0.15286080273270708, 'fraction_numerical': 0.013236549957301452, 'mean_word_length': 5.436813186813187, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '6836397', 'n_tokens_mistral': 812, 'n_tokens_neox': 796, 'n_words': 152}