本文整理汇总了Python中mrjob.runner.MRJobRunner._hadoop_conf_args方法的典型用法代码示例。如果您正苦于以下问题:Python MRJobRunner._hadoop_conf_args方法的具体用法?Python MRJobRunner._hadoop_conf_args怎么用?Python MRJobRunner._hadoop_conf_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrjob.runner.MRJobRunner
的用法示例。
在下文中一共展示了MRJobRunner._hadoop_conf_args方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_hadoop_output_format
# 需要导入模块: from mrjob.runner import MRJobRunner [as 别名]
# 或者: from mrjob.runner.MRJobRunner import _hadoop_conf_args [as 别名]
def test_hadoop_output_format(self):
format = 'org.apache.hadoop.mapred.SequenceFileOutputFormat'
runner = MRJobRunner(conf_path=False, hadoop_output_format=format)
assert_equal(runner._hadoop_conf_args(0, 1),
['-outputformat', format])
# test multi-step job
assert_equal(runner._hadoop_conf_args(0, 2), [])
assert_equal(runner._hadoop_conf_args(1, 2),
['-outputformat', format])
示例2: test_jobconf
# 需要导入模块: from mrjob.runner import MRJobRunner [as 别名]
# 或者: from mrjob.runner.MRJobRunner import _hadoop_conf_args [as 别名]
def test_jobconf(self):
jobconf = {'FOO': 'bar', 'BAZ': 'qux', 'BAX': 'Arnold'}
runner = MRJobRunner(conf_path=False, jobconf=jobconf)
assert_equal(runner._hadoop_conf_args(0, 1),
['-jobconf', 'BAX=Arnold',
'-jobconf', 'BAZ=qux',
'-jobconf', 'FOO=bar',])
示例3: test_cmdenv
# 需要导入模块: from mrjob.runner import MRJobRunner [as 别名]
# 或者: from mrjob.runner.MRJobRunner import _hadoop_conf_args [as 别名]
def test_cmdenv(self):
cmdenv = {'FOO': 'bar', 'BAZ': 'qux', 'BAX': 'Arnold'}
runner = MRJobRunner(conf_path=False, cmdenv=cmdenv)
assert_equal(runner._hadoop_conf_args(0, 1),
['-cmdenv', 'BAX=Arnold',
'-cmdenv', 'BAZ=qux',
'-cmdenv', 'FOO=bar',])
示例4: test_hadoop_extra_args_comes_first
# 需要导入模块: from mrjob.runner import MRJobRunner [as 别名]
# 或者: from mrjob.runner.MRJobRunner import _hadoop_conf_args [as 别名]
def test_hadoop_extra_args_comes_first(self):
runner = MRJobRunner(
conf_path=False,
cmdenv={'FOO': 'bar'},
hadoop_input_format='FooInputFormat',
hadoop_output_format='BarOutputFormat',
jobconf={'baz': 'quz'},
hadoop_extra_args=['-libjar', 'qux.jar'])
# hadoop_extra_args should come first
conf_args = runner._hadoop_conf_args(0, 1)
assert_equal(conf_args[:2], ['-libjar', 'qux.jar'])
assert_equal(len(conf_args), 10)
示例5: test_hadoop_extra_args
# 需要导入模块: from mrjob.runner import MRJobRunner [as 别名]
# 或者: from mrjob.runner.MRJobRunner import _hadoop_conf_args [as 别名]
def test_hadoop_extra_args(self):
extra_args = ['-foo', 'bar']
runner = MRJobRunner(conf_path=False, hadoop_extra_args=extra_args)
assert_equal(runner._hadoop_conf_args(0, 1), extra_args)
示例6: test_empty
# 需要导入模块: from mrjob.runner import MRJobRunner [as 别名]
# 或者: from mrjob.runner.MRJobRunner import _hadoop_conf_args [as 别名]
def test_empty(self):
runner = MRJobRunner(conf_path=False)
assert_equal(runner._hadoop_conf_args(0, 1), [])