• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python hdp_test_base.create_clusterspec函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sahara.tests.unit.plugins.hdp.hdp_test_base.create_clusterspec函数的典型用法代码示例。如果您正苦于以下问题:Python create_clusterspec函数的具体用法?Python create_clusterspec怎么用?Python create_clusterspec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了create_clusterspec函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_hbase_service_urls

    def test_hbase_service_urls(self, patched):
        for version in versions:
            cluster = self._create_hbase_cluster()
            cluster_spec = hdp_test_base.create_clusterspec(
                hdp_version=version)
            cluster_spec.create_operational_config(cluster, [])
            s = self.get_services_processor(version=version)
            service = s.create_service('HBASE')

            url_info = {}
            service.register_service_urls(cluster_spec, url_info, mock.Mock())
            self.assertEqual(1, len(url_info))
            self.assertEqual(6, len(url_info['HBase']))
            self.assertEqual('http://222.22.2222:60010/master-status',
                             url_info['HBase']['Web UI'])
            self.assertEqual('http://222.22.2222:60010/logs',
                             url_info['HBase']['Logs'])
            self.assertEqual('http://222.22.2222:60010/zk.jsp',
                             url_info['HBase']['Zookeeper Info'])
            self.assertEqual('http://222.22.2222:60010/jmx',
                             url_info['HBase']['JMX'])
            self.assertEqual('http://222.22.2222:60010/dump',
                             url_info['HBase']['Debug Dump'])
            self.assertEqual('http://222.22.2222:60010/stacks',
                             url_info['HBase']['Thread Stacks'])
开发者ID:zhangjunli177,项目名称:sahara,代码行数:25,代码来源:test_services.py


示例2: test_hdp2_create_sqoop_service

    def test_hdp2_create_sqoop_service(self, patched):
        s = self.get_services_processor('2.0.6')
        service = s.create_service('SQOOP')
        self.assertEqual('SQOOP', service.name)
        expected_configs = set(['global', 'core-site'])
        self.assertEqual(expected_configs,
                         expected_configs & service.configurations)
        self.assertFalse(service.is_mandatory())

        # ensure that hdfs and mr clients are added implicitly
        master_host = hdp_test_base.TestServer(
            'master.novalocal', 'master', '11111', 3,
            '111.11.1111', '222.11.1111')
        master_ng = hdp_test_base.TestNodeGroup(
            'master', [master_host], ["NAMENODE", "RESOURCEMANAGER",
                                      "HISTORYSERVER", "SECONDARY_NAMENODE",
                                      "NODEMANAGER", "DATANODE",
                                      "AMBARI_SERVER", "ZOOKEEPER_SERVER"])
        sqoop_host = hdp_test_base.TestServer(
            'sqoop.novalocal', 'sqoop', '11111', 3,
            '111.11.1111', '222.11.1111')
        sqoop_ng = hdp_test_base.TestNodeGroup(
            'sqoop', [sqoop_host], ["SQOOP"])
        cluster = hdp_test_base.TestCluster([master_ng, sqoop_ng])

        cluster_spec = hdp_test_base.create_clusterspec(hdp_version='2.0.6')
        cluster_spec.create_operational_config(cluster, [])

        components = cluster_spec.get_node_groups_containing_component(
            'SQOOP')[0].components
        self.assertIn('HDFS_CLIENT', components)
        self.assertIn('MAPREDUCE2_CLIENT', components)
开发者ID:zhangjunli177,项目名称:sahara,代码行数:32,代码来源:test_services.py


示例3: test_hbase_replace_tokens

    def test_hbase_replace_tokens(self, patched):
        for version in versions:
            cluster = self._create_hbase_cluster()
            cluster_spec = hdp_test_base.create_clusterspec(
                hdp_version=version)
            cluster_spec.create_operational_config(cluster, [])
            s = self.get_services_processor(version=version)
            service = s.create_service('HBASE')
            service.finalize_configuration(cluster_spec)

            self.assertEqual("hdfs://master.novalocal:8020/apps/hbase/data",
                             cluster_spec.configurations['hbase-site'][
                                 'hbase.rootdir'])
            self.assertEqual(set(['zk.novalocal', 'master.novalocal']),
                             set(cluster_spec.configurations['hbase-site'][
                                 'hbase.zookeeper.quorum'].split(',')))
开发者ID:zhangjunli177,项目名称:sahara,代码行数:16,代码来源:test_services.py


示例4: test_create_hbase_service

    def test_create_hbase_service(self, patched):
        s = self.get_services_processor()
        service = s.create_service('HBASE')
        self.assertEqual('HBASE', service.name)
        expected_configs = set(['global', 'core-site', 'hbase-site'])
        self.assertEqual(expected_configs,
                         expected_configs & service.configurations)
        self.assertFalse(service.is_mandatory())

        cluster = self._create_hbase_cluster()

        cluster_spec = hdp_test_base.create_clusterspec()
        cluster_spec.create_operational_config(cluster, [])

        components = cluster_spec.get_node_groups_containing_component(
            'HBASE_MASTER')[0].components
        self.assertIn('HDFS_CLIENT', components)
开发者ID:zhangjunli177,项目名称:sahara,代码行数:17,代码来源:test_services.py


示例5: test_hdp2_hbase_validation

    def test_hdp2_hbase_validation(self, patched):
        master_host = hdp_test_base.TestServer(
            'master.novalocal', 'master', '11111', 3,
            '111.11.1111', '222.11.1111')
        master_ng = hdp_test_base.TestNodeGroup(
            'master', [master_host], ["NAMENODE", "RESOURCEMANAGER",
                                      "SECONDARY_NAMENODE", "HISTORYSERVER",
                                      "NODEMANAGER", "DATANODE",
                                      "AMBARI_SERVER", "ZOOKEEPER_SERVER"])
        hbase_host = hdp_test_base.TestServer(
            'hbase.novalocal', 'hbase', '11111', 3,
            '111.11.1111', '222.11.1111')

        hbase_ng = hdp_test_base.TestNodeGroup(
            'hbase', [hbase_host], ["HBASE_MASTER"])

        hbase_ng2 = hdp_test_base.TestNodeGroup(
            'hbase2', [hbase_host], ["HBASE_MASTER"])

        hbase_client_host = hdp_test_base.TestServer(
            'hbase-client.novalocal', 'hbase-client', '11111', 3,
            '111.11.1111', '222.11.1111')

        hbase_client_ng = hdp_test_base.TestNodeGroup(
            'hbase-client', [hbase_client_host], ["HBASE_CLIENT"])

        hbase_slave_host = hdp_test_base.TestServer(
            'hbase-rs.novalocal', 'hbase-rs', '11111', 3,
            '111.11.1111', '222.11.1111')

        hbase_slave_ng = hdp_test_base.TestNodeGroup(
            'hbase-rs', [hbase_slave_host], ["HBASE_REGIONSERVER"])

        cluster = hdp_test_base.TestCluster([master_ng, hbase_client_ng])
        cluster_spec = hdp_test_base.create_clusterspec(hdp_version='2.0.6')

        # validation should fail due to lack of hbase master
        self.assertRaises(
            ex.InvalidComponentCountException,
            cluster_spec.create_operational_config, cluster, [])

        cluster = hdp_test_base.TestCluster(
            [master_ng, hbase_client_ng, hbase_slave_ng])
        cluster_spec = hdp_test_base.create_clusterspec(hdp_version='2.0.6')

        # validation should fail due to lack of hbase master

        self.assertRaises(
            ex.InvalidComponentCountException,
            cluster_spec.create_operational_config, cluster, [])

        cluster = hdp_test_base.TestCluster(
            [master_ng, hbase_client_ng, hbase_ng])
        cluster_spec = hdp_test_base.create_clusterspec(hdp_version='2.0.6')

        # validation should succeed with hbase master included
        cluster_spec.create_operational_config(cluster, [])

        cluster = hdp_test_base.TestCluster(
            [master_ng, hbase_client_ng, hbase_ng, hbase_ng2])
        cluster_spec = hdp_test_base.create_clusterspec(hdp_version='2.0.6')

        # validation should fail with multiple hbase master components
        self.assertRaises(
            ex.InvalidComponentCountException,
            cluster_spec.create_operational_config, cluster, [])
开发者ID:zhangjunli177,项目名称:sahara,代码行数:66,代码来源:test_services.py


示例6: test_hbase_properties

    def test_hbase_properties(self, patched):
        for version in versions:
            cluster = self._create_hbase_cluster()

            cluster_spec = hdp_test_base.create_clusterspec(
                hdp_version=version)
            cluster_spec.create_operational_config(cluster, [])
            s = self.get_services_processor(version=version)
            service = s.create_service('HBASE')

            ui_handlers = {}
            service.register_user_input_handlers(ui_handlers)
            ui_handlers['hbase-site/hbase.rootdir'](
                hdp_test_base.TestUserInput(
                    hdp_test_base.TestUserInputConfig(
                        '', '', 'hbase-site/hbase.rootdir'),
                    "hdfs://%NN_HOST%:99/some/other/dir"),
                cluster_spec.configurations)
            self.assertEqual(
                "hdfs://%NN_HOST%:99/some/other/dir",
                cluster_spec.configurations['hbase-site']['hbase.rootdir'])
            self.assertEqual(
                "/some/other/dir",
                cluster_spec.configurations['global']['hbase_hdfs_root_dir'])

            self.assertRaises(
                e.InvalidDataException,
                ui_handlers['hbase-site/hbase.rootdir'],
                hdp_test_base.TestUserInput(
                    hdp_test_base.TestUserInputConfig(
                        '', '', 'hbase-site/hbase.rootdir'),
                    "badprotocol://%NN_HOST%:99/some/other/dir"),
                cluster_spec.configurations)

            ui_handlers['hbase-site/hbase.tmp.dir'](
                hdp_test_base.TestUserInput(
                    hdp_test_base.TestUserInputConfig(
                        '', '', 'hbase-site/hbase.tmp.dir'),
                    "/some/dir"),
                cluster_spec.configurations)
            self.assertEqual(
                "/some/dir",
                cluster_spec.configurations['hbase-site']['hbase.tmp.dir'])
            self.assertEqual(
                "/some/dir",
                cluster_spec.configurations['global']['hbase_tmp_dir'])
            ui_handlers[
                'hbase-site/hbase.regionserver.global.memstore.upperLimit'](
                    hdp_test_base.TestUserInput(
                        hdp_test_base.TestUserInputConfig(
                            '', '', 'hbase-site/hbase.regionserver.global.'
                                'memstore.upperLimit'),
                        "111"),
                    cluster_spec.configurations)
            self.assertEqual(
                "111",
                cluster_spec.configurations['hbase-site'][
                    'hbase.regionserver.global.memstore.upperLimit'])
            self.assertEqual(
                "111",
                cluster_spec.configurations['global'][
                    'regionserver_memstore_upperlimit'])
            ui_handlers[
                'hbase-site/hbase.hstore.blockingStoreFiles'](
                    hdp_test_base.TestUserInput(
                        hdp_test_base.TestUserInputConfig(
                            '', '',
                            'hbase-site/hbase.hstore.blockingStoreFiles'),
                        "112"),
                    cluster_spec.configurations)
            self.assertEqual("112", cluster_spec.configurations['hbase-site'][
                             'hbase.hstore.blockingStoreFiles'])
            self.assertEqual("112", cluster_spec.configurations['global'][
                             'hstore_blockingstorefiles'])
            ui_handlers[
                'hbase-site/hbase.hstore.compactionThreshold'](
                    hdp_test_base.TestUserInput(
                        hdp_test_base.TestUserInputConfig(
                            '', '',
                            'hbase-site/hbase.hstore.compactionThreshold'),
                        "113"),
                    cluster_spec.configurations)
            self.assertEqual("113", cluster_spec.configurations['hbase-site'][
                             'hbase.hstore.compactionThreshold'])
            self.assertEqual("113", cluster_spec.configurations['global'][
                             'hstore_compactionthreshold'])
            ui_handlers[
                'hbase-site/hfile.block.cache.size'](
                    hdp_test_base.TestUserInput(
                        hdp_test_base.TestUserInputConfig(
                            '', '', 'hbase-site/hfile.block.cache.size'),
                        "114"),
                    cluster_spec.configurations)
            self.assertEqual("114", cluster_spec.configurations['hbase-site'][
                             'hfile.block.cache.size'])
            self.assertEqual("114", cluster_spec.configurations['global'][
                             'hfile_blockcache_size'])
            ui_handlers[
                'hbase-site/hbase.hregion.max.filesize'](
                    hdp_test_base.TestUserInput(
#.........这里部分代码省略.........
开发者ID:zhangjunli177,项目名称:sahara,代码行数:101,代码来源:test_services.py



注:本文中的sahara.tests.unit.plugins.hdp.hdp_test_base.create_clusterspec函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python edp_test_utils.create_cluster函数代码示例发布时间:2022-05-27
下一篇:
Python utils.get_fake_cluster函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap