# Path: ferry/install.py
# FERRY_HOME=_get_ferry_home()


import logging
import os
import sys
import time
import sh
from string import Template
from ferry.install import FERRY_HOME
from ferry.config.hadoop.hiveconfig import *
from ferry.config.hadoop.metastore  import *
# 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.
#


class HadoopInitializer(object):

    def __init__(self, system):
        """
        Create a new initializer
        Param user The user login for the git repo
        """
        self.system = system
        self.template_dir = None
        self.template_repo = None

        self.container_data_dir = HadoopConfig.data_directory
        self.container_log_dir = HadoopConfig.log_directory

        self.hive_client = HiveClientInitializer(system)
        self.hive_ms = MetaStoreInitializer(system)
        self.hive_client.template_dir = FERRY_HOME + '/data/templates/hive-metastore/'

# Path: ferry/install.py
# FERRY_HOME=_get_ferry_home()


# Path: ferry/config/hadoop/hadoopconfig.py
import logging
import os
import sys
import time
import sh
from string import Template
from ferry.install import FERRY_HOME
from ferry.config.hadoop.hiveconfig import *
from ferry.config.hadoop.metastore  import *

# 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.
#


class HadoopInitializer(object):

    def __init__(self, system):
        """
        Create a new initializer
        Param user The user login for the git repo
        """
        self.system = system
        self.template_dir = None
        self.template_repo = None

        self.container_data_dir = HadoopConfig.data_directory
        self.container_log_dir = HadoopConfig.log_directory

        self.hive_client = HiveClientInitializer(system)
        self.hive_ms = MetaStoreInitializer(system)
        self.hive_client.template_dir = FERRY_HOME + '/data/templates/hive-metastore/'

        self.hive_ms.template_dir = FERRY_HOME + '/data/templates/hive-metastore/'