本文整理汇总了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)
示例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')
示例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")
示例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"]
)
示例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')
示例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'])
示例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")]
)
示例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')])
示例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'])
示例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"])
示例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'])
示例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'])
示例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"])
示例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'], [])
示例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'])