File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 22# Cookbook Name:: hadoop
33# Recipe:: hive_metastore
44#
5- # Copyright © 2013-2015 Cask Data, Inc.
5+ # Copyright © 2013-2017 Cask Data, Inc.
66#
77# Licensed under the Apache License, Version 2.0 (the "License");
88# you may not use this file except in compliance with the License.
4040 end
4141end
4242
43+ derby_db =
44+ if hive_sql == 'derby' && node [ 'hive' ] . key? ( 'hive_site' ) && node [ 'hive' ] [ 'hive_site' ] . key? ( 'javax.jdo.option.ConnectionURL' )
45+ node [ 'hive' ] [ 'hive_site' ] [ 'javax.jdo.option.ConnectionURL' ] . split ( ':' ) [ 2 ] . split ( ';' ) . find { |o | /^databaseName/ =~ o } . split ( '=' ) [ 1 ]
46+ else
47+ # We set this to our default, because the Hive default uses the current working directory
48+ '/var/lib/hive/metastore/metastore_db'
49+ end
50+
51+ directory ::File . dirname ( derby_db ) do
52+ action :create
53+ end
54+
4355# Hive HDFS directories
4456dfs = node [ 'hadoop' ] [ 'core_site' ] [ 'fs.defaultFS' ]
4557warehouse_dir =
Original file line number Diff line number Diff line change 22# Cookbook Name:: hadoop
33# Recipe:: oozie
44#
5- # Copyright © 2013-2016 Cask Data, Inc.
5+ # Copyright © 2013-2017 Cask Data, Inc.
66#
77# Licensed under the Apache License, Version 2.0 (the "License");
88# you may not use this file except in compliance with the License.
3535 'derby'
3636 end
3737
38+ derby_db =
39+ if oozie_sql == 'derby' && node [ 'oozie' ] . key? ( 'oozie_site' ) && node [ 'oozie' ] [ 'oozie_site' ] . key? ( 'oozie.service.JPAService.jdbc.url' )
40+ node [ 'oozie' ] [ 'oozie_site' ] [ 'oozie.service.JPAService.jdbc.url' ] . split ( ':' ) [ 2 ] . split ( ';' ) . find { |o | /^databaseName/ =~ o } . split ( '=' )
41+ elsif node [ 'oozie' ] . key? ( 'oozie_site' ) && node [ 'oozie' ] [ 'oozie_site' ] . key? ( 'oozie.db.schema.name' )
42+ "#{ oozie_data_dir } /#{ node [ 'oozie' ] [ 'oozie_site' ] [ 'oozie.db.schema.name' ] } -db"
43+ else
44+ "#{ oozie_data_dir } /oozie-db"
45+ end
46+
47+ directory ::File . dirname ( derby_db ) do
48+ action :create
49+ end
50+
3851node . default [ 'hadoop' ] [ 'sql_connector' ] = oozie_sql
3952include_recipe 'hadoop::_sql_connectors'
4053
You can’t perform that action at this time.
0 commit comments