当前位置: 首页>>代码示例>>Python>>正文


Python MRJob.job_runner_kwargs方法代码示例

本文整理汇总了Python中mrjob.job.MRJob.job_runner_kwargs方法的典型用法代码示例。如果您正苦于以下问题:Python MRJob.job_runner_kwargs方法的具体用法?Python MRJob.job_runner_kwargs怎么用?Python MRJob.job_runner_kwargs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mrjob.job.MRJob的用法示例。


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

示例1: test_empty

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_empty(self):
        mr_job = MRJob()

        self.assertEqual(mr_job.job_runner_kwargs()['hadoop_input_format'],
                         None)
        self.assertEqual(mr_job.job_runner_kwargs()['hadoop_output_format'],
                         None)
开发者ID:tempcyc,项目名称:mrjob,代码行数:9,代码来源:test_job.py

示例2: test_deprecated_command_line_options

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_deprecated_command_line_options(self):
        mr_job = MRJob([
            '--hadoop-input-format',
            'org.apache.hadoop.mapred.lib.NLineInputFormat',
            '--hadoop-output-format',
            'org.apache.hadoop.mapred.FileOutputFormat',
            ])

        with logger_disabled('mrjob.job'):
            assert_equal(mr_job.job_runner_kwargs()['hadoop_input_format'],
                         'org.apache.hadoop.mapred.lib.NLineInputFormat')
            assert_equal(mr_job.job_runner_kwargs()['hadoop_output_format'],
                         'org.apache.hadoop.mapred.FileOutputFormat')
开发者ID:gimlids,项目名称:LTPM,代码行数:15,代码来源:job_test.py

示例3: test_cmd_line_options

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_cmd_line_options(self):
        mr_job = MRJob(
            ["--partitioner", "java.lang.Object", "--partitioner", "org.apache.hadoop.mapreduce.Partitioner"]
        )

        # second option takes priority
        self.assertEqual(mr_job.job_runner_kwargs()["partitioner"], "org.apache.hadoop.mapreduce.Partitioner")
开发者ID:ndimiduk,项目名称:mrjob,代码行数:9,代码来源:test_job.py

示例4: test_libjars_attr_relative_path

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_attr_relative_path(self):
        job_dir = os.path.dirname(MRJob.mr_job_script())

        with patch.object(MRJob, "LIBJARS", ["cookie.jar", "/left/dora.jar"]):
            job = MRJob()

            self.assertEqual(
                job.job_runner_kwargs()["libjars"], [os.path.join(job_dir, "cookie.jar"), "/left/dora.jar"]
            )
开发者ID:davidmarin,项目名称:mrjob,代码行数:11,代码来源:test_job.py

示例5: test_cmd_line_options

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_cmd_line_options(self):
        mr_job = MRJob([
            '--partitioner', 'java.lang.Object',
            '--partitioner', 'org.apache.hadoop.mapreduce.Partitioner'
        ])

        # second option takes priority
        self.assertEqual(mr_job.job_runner_kwargs()['partitioner'],
                         'org.apache.hadoop.mapreduce.Partitioner')
开发者ID:tempcyc,项目名称:mrjob,代码行数:11,代码来源:test_job.py

示例6: test_libjars_attr_relative_path

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_attr_relative_path(self):
        job_dir = os.path.dirname(MRJob.mr_job_script())

        with patch.object(MRJob, 'LIBJARS', ['cookie.jar', '/left/dora.jar']):
            job = MRJob()

            self.assertEqual(
                job.job_runner_kwargs()['libjars'],
                [os.path.join(job_dir, 'cookie.jar'), '/left/dora.jar'])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:11,代码来源:test_job.py

示例7: test_libjars_environment_variables

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_environment_variables(self):
        job_dir = os.path.dirname(MRJob.mr_job_script())

        with patch.dict("os.environ", A="/path/to/a", B="b"):
            with patch.object(MRJob, "LIBJARS", ["$A/cookie.jar", "$B/honey.jar"]):
                job = MRJob()

                # libjars() peeks into envvars to figure out if the path
                # is relative or absolute
                self.assertEqual(
                    job.job_runner_kwargs()["libjars"], ["$A/cookie.jar", os.path.join(job_dir, "$B/honey.jar")]
                )
开发者ID:davidmarin,项目名称:mrjob,代码行数:14,代码来源:test_job.py

示例8: test_libjars_environment_variables

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_environment_variables(self):
        job_dir = os.path.dirname(MRJob.mr_job_script())

        with patch.dict('os.environ', A='/path/to/a', B='b'):
            with patch.object(MRJob, 'LIBJARS',
                              ['$A/cookie.jar', '$B/honey.jar']):
                job = MRJob()

                # libjars() peeks into envvars to figure out if the path
                # is relative or absolute
                self.assertEqual(
                    job.job_runner_kwargs()['libjars'],
                    ['$A/cookie.jar', os.path.join(job_dir, '$B/honey.jar')])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:15,代码来源:test_job.py

示例9: test_libjar_option

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjar_option(self):
        job = MRJob(['--libjar', 'honey.jar'])

        self.assertEqual(job.job_runner_kwargs()['libjars'], ['honey.jar'])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:6,代码来源:test_job.py

示例10: test_libjars_attr_plus_option

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_attr_plus_option(self):
        with patch.object(MRJob, "LIBJARS", ["/left/dora.jar"]):
            job = MRJob(["--libjar", "honey.jar"])

            self.assertEqual(job.job_runner_kwargs()["libjars"], ["/left/dora.jar", "honey.jar"])
开发者ID:davidmarin,项目名称:mrjob,代码行数:7,代码来源:test_job.py

示例11: test_override_libjars

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_override_libjars(self):
        with patch.object(MRJob, 'libjars', return_value=['honey.jar']):
            job = MRJob(['--libjar', 'cookie.jar'])

            # ignore switch, don't resolve relative path
            self.assertEqual(job.job_runner_kwargs()['libjars'], ['honey.jar'])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:8,代码来源:test_job.py

示例12: test_libjars_attr_plus_option

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_attr_plus_option(self):
        with patch.object(MRJob, 'LIBJARS', ['/left/dora.jar']):
            job = MRJob(['--libjar', 'honey.jar'])

            self.assertEqual(job.job_runner_kwargs()['libjars'],
                             ['/left/dora.jar', 'honey.jar'])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:8,代码来源:test_job.py

示例13: test_libjars_attr

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_attr(self):
        with patch.object(MRJob, "LIBJARS", ["/left/dora.jar"]):
            job = MRJob()

            self.assertEqual(job.job_runner_kwargs()["libjars"], ["/left/dora.jar"])
开发者ID:davidmarin,项目名称:mrjob,代码行数:7,代码来源:test_job.py

示例14: test_default

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_default(self):
        job = MRJob()

        self.assertEqual(job.job_runner_kwargs()['libjars'], [])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:6,代码来源:test_job.py

示例15: test_libjars_attr

# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import job_runner_kwargs [as 别名]
    def test_libjars_attr(self):
        with patch.object(MRJob, 'LIBJARS', ['/left/dora.jar']):
            job = MRJob()

            self.assertEqual(job.job_runner_kwargs()['libjars'],
                             ['/left/dora.jar'])
开发者ID:etiennebatise,项目名称:mrjob,代码行数:8,代码来源:test_job.py


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