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


Python MRWordCount.HADOOP_INPUT_FORMAT方法代码示例

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


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

示例1: test_hadoop_extra_args_comes_first

# 需要导入模块: from tests.mr_word_count import MRWordCount [as 别名]
# 或者: from tests.mr_word_count.MRWordCount import HADOOP_INPUT_FORMAT [as 别名]
    def test_hadoop_extra_args_comes_first(self):
        job = MRWordCount(
            ['--cmdenv', 'FOO=bar',
             '--hadoop-arg', '-libjar', '--hadoop-arg', 'qux.jar',
             '--jobconf', 'baz=qux',
             '--partitioner', 'java.lang.Object'])
        job.HADOOP_INPUT_FORMAT = 'FooInputFormat'
        job.HADOOP_OUTPUT_FORMAT = 'BarOutputFormat'

        with job.make_runner() as runner:
            hadoop_args = runner._hadoop_args_for_step(0)
            self.assertEqual(hadoop_args[:2], ['-libjar', 'qux.jar'])
            self.assertEqual(len(hadoop_args), 12)
开发者ID:ENuge,项目名称:mrjob,代码行数:15,代码来源:test_runner.py

示例2: test_hadoop_input_format

# 需要导入模块: from tests.mr_word_count import MRWordCount [as 别名]
# 或者: from tests.mr_word_count.MRWordCount import HADOOP_INPUT_FORMAT [as 别名]
    def test_hadoop_input_format(self):
        input_format = "org.apache.hadoop.mapred.SequenceFileInputFormat"

        # one-step job
        job1 = MRWordCount()
        # no cmd-line argument for this because it's part of job semantics
        job1.HADOOP_INPUT_FORMAT = input_format
        with job1.make_runner() as runner1:
            self.assertEqual(runner1._hadoop_args_for_step(0), ["-inputformat", input_format])

        # multi-step job: only use -inputformat on the first step
        job2 = MRTwoStepJob()
        job2.HADOOP_INPUT_FORMAT = input_format
        with job2.make_runner() as runner2:
            self.assertEqual(runner2._hadoop_args_for_step(0), ["-inputformat", input_format])
            self.assertEqual(runner2._hadoop_args_for_step(1), [])
开发者ID:irskep,项目名称:mrjob,代码行数:18,代码来源:test_runner.py

示例3: test_hadoop_extra_args_comes_first

# 需要导入模块: from tests.mr_word_count import MRWordCount [as 别名]
# 或者: from tests.mr_word_count.MRWordCount import HADOOP_INPUT_FORMAT [as 别名]
    def test_hadoop_extra_args_comes_first(self):
        job = MRWordCount(
            [
                "--cmdenv",
                "FOO=bar",
                "--hadoop-arg",
                "-libjar",
                "--hadoop-arg",
                "qux.jar",
                "--jobconf",
                "baz=qux",
                "--partitioner",
                "java.lang.Object",
            ]
        )
        job.HADOOP_INPUT_FORMAT = "FooInputFormat"
        job.HADOOP_OUTPUT_FORMAT = "BarOutputFormat"

        with job.make_runner() as runner:
            hadoop_args = runner._hadoop_args_for_step(0)
            self.assertEqual(hadoop_args[:2], ["-libjar", "qux.jar"])
            self.assertEqual(len(hadoop_args), 12)
开发者ID:irskep,项目名称:mrjob,代码行数:24,代码来源:test_runner.py


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