<commit_before>#
# Cookbook Name:: cdap
# Recipe:: master
#
# Copyright © 2013-2015 Cask Data, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe 'cdap::default'

# All released versions support HBase 0.96
pkgs = ['cdap-hbase-compat-0.96']
pkgs += ['cdap-hbase-compat-0.98'] if node['cdap']['version'].to_f >= 2.6
pkgs += ['cdap-hbase-compat-1.0', 'cdap-hbase-compat-1.0-cdh'] if node['cdap']['version'].to_f >= 3.1
pkgs += ['cdap-hbase-compat-1.1'] if node['cdap']['version'].to_f >= 3.2
pkgs += ['cdap-hbase-compat-0.94'] if node['cdap']['version'].to_f < 3.1

pkgs.each do |pkg|
  package pkg do
    version node['cdap']['version']
    action :install
  end
end

package 'cdap-master' do
  action :install
  version node['cdap']['version']
end

# Include kerberos support
if node['hadoop'].key?('core_site') && node['hadoop']['core_site'].key?('hadoop.security.authentication') &&
   node['hadoop']['core_site']['hadoop.security.authentication'] == 'kerberos'

  if node['cdap'].key?('kerberos') && node['cdap']['kerberos'].key?('cdap_keytab') &&
     node['cdap']['kerberos'].key?('cdap_principal') &&
     node['cdap'].key?('cdap_site') && node['cdap']['cdap_site'].key?('kerberos.auth.enabled') &&
     node['cdap']['cdap_site']['kerberos.auth.enabled'].to_s == 'true'

    my_vars = { :options => node['cdap']['kerberos'] }

    directory '/etc/default' do
      owner 'root'
      group 'root'
      mode '0755'
      action :create<commit_msg>COOK-82 Install cdap-hbase-compat-1.0-cdh5.5.0 on CDAP >= 3.3<commit_after>#
# Cookbook Name:: cdap
# Recipe:: master
#
# Copyright © 2013-2015 <NAME>, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe 'cdap::default'

# All released versions support HBase 0.96
pkgs = ['cdap-hbase-compat-0.96']
pkgs += ['cdap-hbase-compat-0.98'] if node['cdap']['version'].to_f >= 2.6
pkgs += ['cdap-hbase-compat-1.0', 'cdap-hbase-compat-1.0-cdh'] if node['cdap']['version'].to_f >= 3.1
pkgs += ['cdap-hbase-compat-1.1'] if node['cdap']['version'].to_f >= 3.2
pkgs += ['cdap-hbase-compat-1.0-cdh5.5.0'] if node['cdap']['version'].to_f >= 3.3
pkgs += ['cdap-hbase-compat-0.94'] if node['cdap']['version'].to_f < 3.1

pkgs.each do |pkg|
  package pkg do
    version node['cdap']['version']
    action :install
  end
end

package 'cdap-master' do
  action :install
  version node['cdap']['version']
end

# Include kerberos support
if node['hadoop'].key?('core_site') && node['hadoop']['core_site'].key?('hadoop.security.authentication') &&
   node['hadoop']['core_site']['hadoop.security.authentication'] == 'kerberos'

  if node['cdap'].key?('kerberos') && node['cdap']['kerberos'].key?('cdap_keytab') &&
     node['cdap']['kerberos'].key?('cdap_principal') &&
     node['cdap'].key?('cdap_site') && node['cdap']['cdap_site'].key?('kerberos.auth.enabled') &&
     node['cdap']['cdap_site']['kerberos.auth.enabled'].to_s == 'true'

    my_vars = { :options => node['cdap']['kerberos'] }

    directory '/etc/default' do
      owner 'root'
      group 'root'
      mode '0755'
      action :create
{'fraction_non_alphanumeric': 0.1835178351783518, 'fraction_numerical': 0.024600246002460024, 'mean_word_length': 4.443105756358769, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5241105', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1383, 'n_words': 350}