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


Python MRJobLauncher.make_runner方法代码示例

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


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

示例1: test_hadoop_runner

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
 def test_hadoop_runner(self):
     # you can't instantiate a HadoopJobRunner without Hadoop installed
     launcher = MRJobLauncher(args=["--no-conf", "-r", "hadoop", "", "--hadoop-streaming-jar", "HUNNY"])
     with no_handlers_for_logger("mrjob.runner"):
         with patch.dict(os.environ, {"HADOOP_HOME": "100-Acre Wood"}):
             with launcher.make_runner() as runner:
                 self.assertIsInstance(runner, HadoopJobRunner)
开发者ID:duedil-ltd,项目名称:mrjob,代码行数:9,代码来源:test_launch.py

示例2: test_hadoop_runner

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
 def test_hadoop_runner(self):
     # you can't instantiate a HadoopJobRunner without Hadoop installed
     launcher = MRJobLauncher(args=['--no-conf', '-r', 'hadoop', '',
                                    '--hadoop-streaming-jar', 'HUNNY'])
     with no_handlers_for_logger('mrjob.runner'):
         with patch.dict(os.environ, {'HADOOP_HOME': '100-Acre Wood'}):
             with launcher.make_runner() as runner:
                 self.assertIsInstance(runner, HadoopJobRunner)
开发者ID:Asana,项目名称:mrjob,代码行数:10,代码来源:test_launch.py

示例3: test_no_file_args_required

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
    def test_no_file_args_required(self):
        words1 = self.makefile('words1', b'kit and caboodle\n')
        words2 = self.makefile('words2', b'baubles\nbangles and beads\n')

        job = MRJobLauncher(
            args=['-r', 'local', tests.sr_wc.__file__, words1, words2])
        job.sandbox()

        with job.make_runner() as runner:
            runner.run()

            lines = list(to_lines(runner.cat_output()))
            self.assertEqual(len(lines), 1)
            self.assertEqual(int(lines[0]), 7)
开发者ID:Affirm,项目名称:mrjob,代码行数:16,代码来源:test_local.py

示例4: _make_launcher

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
    def _make_launcher(self, *args):
        """Make a launcher, add a mock runner (``launcher.mock_runner``), and
        set it up so that ``launcher.make_runner().__enter__()`` returns
        ``launcher.mock_runner()``.
        """
        launcher = MRJobLauncher(args=['--no-conf', ''] + list(args))
        launcher.sandbox()

        launcher.mock_runner = Mock()
        launcher.mock_runner.stream_output.return_value = [b'a line\n']

        launcher.make_runner = MagicMock()  # include __enter__
        launcher.make_runner.return_value.__enter__.return_value = (
            launcher.mock_runner)

        return launcher
开发者ID:etiennebatise,项目名称:mrjob,代码行数:18,代码来源:test_launch.py

示例5: test_emr_runner

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
 def test_emr_runner(self):
     launcher = MRJobLauncher(args=['--no-conf', '-r', 'emr', ''])
     with no_handlers_for_logger('mrjob.runner'):
         with launcher.make_runner() as runner:
             self.assertIsInstance(runner, EMRJobRunner)
开发者ID:DrMavenRebe,项目名称:mrjob,代码行数:7,代码来源:test_launch.py

示例6: test_emr_runner

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
 def test_emr_runner(self):
     launcher = MRJobLauncher(args=["--no-conf", "-r", "emr", ""])
     with no_handlers_for_logger("mrjob"):
         with patch_fs_s3():
             with launcher.make_runner() as runner:
                 self.assertIsInstance(runner, EMRJobRunner)
开发者ID:duedil-ltd,项目名称:mrjob,代码行数:8,代码来源:test_launch.py

示例7: test_local_runner

# 需要导入模块: from mrjob.launch import MRJobLauncher [as 别名]
# 或者: from mrjob.launch.MRJobLauncher import make_runner [as 别名]
 def test_local_runner(self):
     launcher = MRJobLauncher(args=["--no-conf", "-r", "local", ""])
     with no_handlers_for_logger("mrjob.runner"):
         with launcher.make_runner() as runner:
             self.assertIsInstance(runner, LocalMRJobRunner)
开发者ID:duedil-ltd,项目名称:mrjob,代码行数:7,代码来源:test_launch.py


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