<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
 * Copyright 2010 The Apache Software Foundation
 *
 * 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.
 */
-->
<configuration>
    <property>
        <name>this.cluster.name</name>
        <value><%= node['hbase']['this.cluster.name'] %></value>
        <!-- <value>pleiades</value> -->
    </property>
    <property>
        <name>this.domain</name>
        <value><%= node['hbase']['this.domain'] %></value>
        <!-- <value>grid.example.com</value> -->
    </property>
    <property>
        <name>this.realm</name>
        <value><%= node['hbase']['this.realm'] %></value>
        <!-- <value>GRID.EXAMPLE.COM</value> -->
    </property>
    <property>
        <name>this.keytab.dir</name>
        <value><%= node['hbase']['this.keytab.dir'] %></value>
    </property>
    <property>
        <name>this.namenode.fqdn</name>
        <value><%= node['hbase']['this.namenode.fqdn'] %></value>
        <!-- <value>${this.cluster.name}-nn.${this.domain}</value> -->
    </property>

    <property>
        <name>hbase.rootdir</name>
        <value><%= node['hbase']['hbase.rootdir'] %></value>
        <description>The directory shared by RegionServers.
        </description>
    </property>
    <property>
        <name>hbase.cluster.distributed</name>
        <value><%= node['hbase']['hbase.cluster.distributed'] %></value>
        <description>The mode the cluster will be in. Possible values are
          false: standalone and pseudo-distributed setups with managed Zookeeper
          true: fully-distributed with unmanaged Zookeeper Quorum (see hbase-env.sh)
        </description>
    </property>

    <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value><%= node['hbase']['hbase.zookeeper.property.clientPort'] %></value>
        <description>Property from ZooKeeper's config zoo.cfg.
        The port at which the clients will connect.
        </description>
    </property>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value><%= node['hbase']['hbase.zookeeper.quorum'] %></value>
        <!-- <value>zk00.grid.example.com,zk01.grid.example.com,zk02.grid.example.com</value> -->
        <description>Comma separated list of servers in the ZooKeeper Quorum.
        For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
        By default this is set to localhost for local and pseudo-distributed modes
        of operation. For a fully-distributed setup, this should be set to a full
        list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
        this is the list of servers which we will start/stop ZooKeeper on.
        </description>
    </property>

<% if node['hbase']['with_security'] then -%>
    <property>
        <name>hbase.security.authentication</name>
        <value><%= node['hbase']['hbase.security.authentication'] %></value> 
    </property> 
    <property>
        <name>hbase.security.authorization</name>
        <value><%= node['hbase']['hbase.security.authorization'] %></value>
    </property>
    <property>
        <name>hbase.rpc.engine</name>
        <value><%= node['hbase']['hbase.rpc.engine'] %></value>
    </property>
    <property>
        <name>hbase.superuser</name>
        <value><%= node['hbase']['hbase.superuser'] %></value>
    </property>
    <property>
        <name>hbase.data.umask.enable</name>
        <value><%= node['hbase']['hbase.data.umask.enable'] %></value>
    </property>
    <property>
        <name>hbase.data.umask</name>
        <value><%= node['hbase']['hbase.data.umask'] %></value>
    </property>
    <property>
        <name>hbase.coprocessor.master.classes</name>
        <value><%= node['hbase']['hbase.coprocessor.master.classes'] %></value>
    </property>
    <property>
        <name>hbase.coprocessor.region.classes</name>
        <value><%= node['hbase']['hbase.coprocessor.region.classes'] %></value>
    </property>
    <property>
        <name>hbase.master.kerberos.principal</name>
        <value><%= node['hbase']['hbase.master.kerberos.principal'] %></value>
        <!-- <value>hbase/_HOST@${this.realm}</value> -->
    </property>
    <property>
        <name>hbase.master.keytab.file</name>
        <value><%= node['hbase']['hbase.master.keytab.file'] %></value>
    </property>
    <property>
        <name>hbase.regionserver.kerberos.principal</name>
        <value><%= node['hbase']['hbase.regionserver.kerberos.principal'] %></value>
    </property>
    <property>
        <name>hbase.regionserver.keytab.file</name>
        <value><%= node['hbase']['hbase.regionserver.keytab.file'] %></value>
    </property>
<% end -%>
<%
this_file = 'hbase-site.xml'
if defined? node['hbase']['extra_configs'][this_file] \
  && !node['hbase']['extra_configs'][this_file].nil? then
  node['hbase']['extra_configs'][this_file].each do |key,value|
-%>
    <property>
        <name><%= key %></name>
        <value><%= value %></value>
    </property>
<%
  end
end 
-%>
</configuration>
