本文整理汇总了Python中mrjob.job.MRJob._runner_kwargs方法的典型用法代码示例。如果您正苦于以下问题:Python MRJob._runner_kwargs方法的具体用法?Python MRJob._runner_kwargs怎么用?Python MRJob._runner_kwargs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mrjob.job.MRJob
的用法示例。
在下文中一共展示了MRJob._runner_kwargs方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_empty
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _runner_kwargs [as 别名]
def test_empty(self):
mr_job = MRJob()
self.assertEqual(mr_job._runner_kwargs()['hadoop_input_format'],
None)
self.assertEqual(mr_job._runner_kwargs()['hadoop_output_format'],
None)
示例2: test_libjars_attr_relative_path
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _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._runner_kwargs()['libjars'],
[os.path.join(job_dir, 'cookie.jar'), '/left/dora.jar'])
示例3: test_cmd_line_options
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _runner_kwargs [as 别名]
def test_cmd_line_options(self):
mr_job = MRJob([
'--jobconf', 'mapred.foo=bar',
'--jobconf', 'mapred.foo=baz',
'--jobconf', 'mapred.qux=quux',
])
self.assertEqual(mr_job._runner_kwargs()['jobconf'],
{'mapred.foo': 'baz', # second option takes priority
'mapred.qux': 'quux'})
示例4: test_libjars_environment_variables
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _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._runner_kwargs()['libjars'],
['$A/cookie.jar', os.path.join(job_dir, '$B/honey.jar')])
示例5: _test_runner_kwargs
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _runner_kwargs [as 别名]
def _test_runner_kwargs(self, runner_alias):
launcher = MRJob(args=['/path/to/script', '-r', runner_alias])
runner_class = launcher._runner_class()
kwargs = launcher._runner_kwargs()
option_names = set(kwargs) - self.NON_OPTION_KWARGS - {'mrjob_cls'}
self.assertEqual(
option_names,
# libjars can be set by the job
(runner_class.OPT_NAMES -
self.CONF_ONLY_OPTIONS)
)
示例6: test_override_libjars
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _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._runner_kwargs()['libjars'], ['honey.jar'])
示例7: test_libjars_attr_plus_option
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _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._runner_kwargs()['libjars'],
['/left/dora.jar', 'honey.jar'])
示例8: test_libjars_attr
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _runner_kwargs [as 别名]
def test_libjars_attr(self):
with patch.object(MRJob, 'LIBJARS', ['/left/dora.jar']):
job = MRJob()
self.assertEqual(job._runner_kwargs()['libjars'],
['/left/dora.jar'])
示例9: test_libjar_option
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _runner_kwargs [as 别名]
def test_libjar_option(self):
job = MRJob(['--libjar', 'honey.jar'])
self.assertEqual(job._runner_kwargs()['libjars'], ['honey.jar'])
示例10: test_default
# 需要导入模块: from mrjob.job import MRJob [as 别名]
# 或者: from mrjob.job.MRJob import _runner_kwargs [as 别名]
def test_default(self):
job = MRJob()
self.assertEqual(job._runner_kwargs()['libjars'], [])