Exemple #1
0
    def _extract_configs_to_extra(self, cluster):
        oozie = vu.get_oozie(cluster)
        hive = vu.get_hiveserver(cluster)

        extra = dict()

        if hive:
            extra['hive_mysql_passwd'] = self._generate_hive_mysql_password(
                cluster)

        for ng in cluster.node_groups:
            extra[ng.id] = {
                'xml':
                c_helper.generate_xml_configs(
                    cluster, ng, extra['hive_mysql_passwd'] if hive else None),
                'setup_script':
                c_helper.generate_setup_script(
                    ng.storage_paths(),
                    c_helper.extract_environment_confs(ng.configuration()),
                    append_oozie=(oozie and oozie.node_group.id == ng.id))
            }

        if c_helper.is_data_locality_enabled(cluster):
            topology_data = th.generate_topology_map(
                cluster, CONF.enable_hypervisor_awareness)
            extra['topology_data'] = "\n".join(
                [k + " " + v for k, v in topology_data.items()]) + "\n"

        return extra
Exemple #2
0
    def _extract_configs_to_extra(self, cluster):
        oozie = vu.get_oozie(cluster)
        hive = vu.get_hiveserver(cluster)

        extra = dict()

        if hive:
            extra['hive_mysql_passwd'] = six.text_type(uuid.uuid4())

        for ng in cluster.node_groups:
            extra[ng.id] = {
                'xml': c_helper.generate_xml_configs(
                    cluster, ng, extra['hive_mysql_passwd'] if hive else None),
                'setup_script': c_helper.generate_setup_script(
                    ng.storage_paths(),
                    c_helper.extract_environment_confs(ng.configuration()),
                    append_oozie=(
                        oozie and oozie.node_group.id == ng.id)
                )
            }

        if c_helper.is_data_locality_enabled(cluster):
            topology_data = th.generate_topology_map(
                cluster, CONF.enable_hypervisor_awareness)
            extra['topology_data'] = "\n".join(
                [k + " " + v for k, v in topology_data.items()]) + "\n"

        return extra
Exemple #3
0
 def test_extract_environment_configs(self):
     env_configs = {
         "JobFlow": {
             'Oozie Heap Size': 4000
         },
         "MapReduce": {
             'Job Tracker Heap Size': 1000,
             'Task Tracker Heap Size': "2000"
         },
         "HDFS": {
             'Name Node Heap Size': 3000,
             'Data Node Heap Size': "4000"
         },
         "Wrong-applicable-target": {
             't1': 4
         }}
     self.assertListEqual(c_h.extract_environment_confs(env_configs),
                          ['HADOOP_NAMENODE_OPTS=\\"-Xmx3000m\\"',
                           'HADOOP_DATANODE_OPTS=\\"-Xmx4000m\\"',
                           'CATALINA_OPTS -Xmx4000m',
                           'HADOOP_JOBTRACKER_OPTS=\\"-Xmx1000m\\"',
                           'HADOOP_TASKTRACKER_OPTS=\\"-Xmx2000m\\"'])