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


Python EMRJobRunner.run_jobflow方法代码示例

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


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

示例1: test_with_all_job_flows

# 需要导入模块: from mrjob.emr import EMRJobRunner [as 别名]
# 或者: from mrjob.emr.EMRJobRunner import run_jobflow [as 别名]
 def test_with_all_job_flows(self):
     self.mock_emr_job_flows.update(JOB_FLOWS_BY_ID)
     emr_conn = EMRJobRunner(conf_paths=[]).make_emr_conn()
     emr_conn.run_jobflow('no name', log_uri=None)
     main(['-q', '--no-conf'])
     lines = [line for line in StringIO(self.stdout.getvalue())]
     self.assertEqual(len(lines), len(JOB_FLOWS_BY_ID) - 1)
开发者ID:DanisHack,项目名称:mrjob,代码行数:9,代码来源:test_report_long_jobs.py

示例2: test_attach_to_existing_job_flow

# 需要导入模块: from mrjob.emr import EMRJobRunner [as 别名]
# 或者: from mrjob.emr.EMRJobRunner import run_jobflow [as 别名]
    def test_attach_to_existing_job_flow(self):
        emr_conn = EMRJobRunner(conf_path=False).make_emr_conn()
        # set log_uri to None, so that when we describe the job flow, it
        # won't have the loguri attribute, to test Issue #112
        emr_job_flow_id = emr_conn.run_jobflow(
            name='Development Job Flow', log_uri=None)

        stdin = StringIO('foo\nbar\n')
        self.mock_emr_output = {(emr_job_flow_id, 1): [
            '1\t"bar"\n1\t"foo"\n2\tnull\n']}

        mr_job = MRTwoStepJob(['-r', 'emr', '-v',
                               '-c', self.mrjob_conf_path,
                               '--emr-job-flow-id', emr_job_flow_id])
        mr_job.sandbox(stdin=stdin)

        results = []
        with mr_job.make_runner() as runner:
            runner.run()

            # Issue 182: don't create the bootstrap script when
            # attaching to another job flow
            assert_equal(runner._master_bootstrap_script, None)

            for line in runner.stream_output():
                key, value = mr_job.parse_output_line(line)
                results.append((key, value))

        assert_equal(sorted(results),
            [(1, 'bar'), (1, 'foo'), (2, None)])
开发者ID:hblanks,项目名称:mrjob,代码行数:32,代码来源:emr_test.py

示例3: test_with_one_job_flow

# 需要导入模块: from mrjob.emr import EMRJobRunner [as 别名]
# 或者: from mrjob.emr.EMRJobRunner import run_jobflow [as 别名]
 def test_with_one_job_flow(self):
     emr_conn = EMRJobRunner(conf_path=False).make_emr_conn()
     emr_conn.run_jobflow('no name', log_uri=None)
     main(['-q', '--no-conf'])  # just make sure it doesn't crash
开发者ID:dataartisan,项目名称:mrjob,代码行数:6,代码来源:test_report_long_jobs.py


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