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


Python Pipeline.from_runner_api方法代码示例

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


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

示例1: run

# 需要导入模块: from apache_beam.pipeline import Pipeline [as 别名]
# 或者: from apache_beam.pipeline.Pipeline import from_runner_api [as 别名]
 def run(self, request, context):
   job_id = uuid.uuid4().get_hex()
   pipeline_result = Pipeline.from_runner_api(
       request.pipeline,
       'DirectRunner',
       PipelineOptions()).run()
   self.jobs[job_id] = pipeline_result
   return beam_job_api_pb2.SubmitJobResponse(jobId=job_id)
开发者ID:eljefe6a,项目名称:incubator-beam,代码行数:10,代码来源:server.py

示例2: test_simple

# 需要导入模块: from apache_beam.pipeline import Pipeline [as 别名]
# 或者: from apache_beam.pipeline.Pipeline import from_runner_api [as 别名]
  def test_simple(self):
    """Tests serializing, deserializing, and running a simple pipeline.

    More extensive tests are done at pipeline.run for each suitable test.
    """
    p = beam.Pipeline()
    p | beam.Create([None]) | beam.Map(lambda x: x)  # pylint: disable=expression-not-assigned
    proto = p.to_runner_api()

    p2 = Pipeline.from_runner_api(proto, p.runner, p._options)
    p2.run()
开发者ID:eljefe6a,项目名称:incubator-beam,代码行数:13,代码来源:pipeline_test.py

示例3: test_parent_pointer

# 需要导入模块: from apache_beam.pipeline import Pipeline [as 别名]
# 或者: from apache_beam.pipeline.Pipeline import from_runner_api [as 别名]
  def test_parent_pointer(self):
    class MyPTransform(beam.PTransform):

      def expand(self, p):
        self.p = p
        return p | beam.Create([None])

    p = beam.Pipeline()
    p | MyPTransform()  # pylint: disable=expression-not-assigned
    p = Pipeline.from_runner_api(Pipeline.to_runner_api(p), None, None)
    self.assertIsNotNone(p.transforms_stack[0].parts[0].parent)
    self.assertEquals(p.transforms_stack[0].parts[0].parent,
                      p.transforms_stack[0])
开发者ID:dpmills,项目名称:incubator-beam,代码行数:15,代码来源:pipeline_test.py


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