<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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.
-->
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

    <!-- Hive Configuration can either be stored in this file or in the hadoop configuration files  -->
    <!-- that are implied by Hadoop setup variables.                                                -->
    <!-- Aside from Hadoop setup variables - this file is provided as a convenience so that Hive    -->
    <!-- users do not have to edit hadoop configuration files (that may be managed as a centralized -->
    <!-- resource).                                                                                 -->

    <!-- Hive Execution Parameters -->

    <property>
	<name>javax.jdo.option.ConnectionDriverName</name>
	<value>org.postgresql.Driver</value>
    </property>

    <property>
	<name>javax.jdo.option.ConnectionURL</name>
	<value>jdbc:{{ hive_metastore_db_type }}://{{ hive_metastore_db_host }}:5432/{{ hive_metastore_db_name }}</value>
    </property>

    <property>
	<name>javax.jdo.option.ConnectionUserName</name>
	<value>{{ hive_metastore_db_user }}</value>
    </property>

    <property>
	<name>javax.jdo.option.ConnectionPassword</name>
	<value>{{ psql_db_pwd }}</value>
    </property>

    <property>
	<name>datanucleus.autoCreateSchema</name>
	<value>true</value>
    </property>

    <property>
	<name>hive.metastore.uris</name>
	<value>thrift://{{ ansible_fqdn }}:{{ hive.metastore_port }}</value>
	<description>IP address (or fully-qualified domain name) and port of the metastore host</description>
    </property>

    <property>
	<name>hive.support.concurrency</name>
	<description>Enable Hive's Table Lock Manager Service</description>
	<value>true</value>
    </property>

    <property>
	<name>hive.zookeeper.quorum</name>
	<description>Zookeeper quorum used by Hive's Table Lock Manager</description>
	<value>{{ zookeeper_nodes }}</value>
    </property>

    <property>
	<name>hive.zookeeper.client.port</name>
	<value>{{ zookeeper_client_port }}</value>
	<description>
	    The port at which the clients will connect.
	</description>
    </property>

    <property>
	<name>hive.metastore.warehouse.dir</name>
	<value>{{ mapred_staging_root_dir }}/{{ hive.user }}/warehouse</value>
	<description>location of default database for the warehouse</description>
    </property>

    <property>
	<name>hive.metastore.execute.setugi</name>
	<value>{{ hive.setugi }}</value>
	<description>In unsecure mode, setting this property to true will cause the metastore to execute DFS operations using the client's reported user and group permissions. Note that this property must be set on both the client and server sides. Further note that its best effort. If client sets its to true and server sets it to false, client setting will be ignored.</description>
    </property>

</configuration>
