<p>我将Mapreduce管道范例设置为如下所示:</p>
<pre><code>class MRRecalculateSupportsPipeline(base_handler.PipelineBase):
def run(self, user_key):
# ...
yield mapreduce_pipeline.MapreducePipeline('user_recalculate_supports',
'myapp.mapreduces.user_recalculate_supports_map',
'myapp.mapreduces.user_recalculate_supports_reduce',
'mapreduce.input_readers.DatastoreInputReader', output_writer_spec=None,
mapper_params={"""..."""})
</code></pre>
<p>如果您想捕获此管道的完成情况,您有两个选项。在</p>
<p>A)使用管道。之后在MR管道完成后运行完成管道。在</p>
^{pr2}$
<p>{1>使用top}方法处理^-1>的完成。就个人而言,我还是选择A选项,因为您可以在<code>/_ah/*/status?root=</code>视图中跟踪路径。在</p>
<pre><code>class EmailNewReleasePipeline(base_handler.PipelineBase):
"""Email followers about a new release"""
# TODO: product_key is the name of the parameter, but it's built for albums ...
def run(self, product_key, testing=False):
# Send those emails ...
yield mapreduce_pipeline.MapreducePipeline(...)
def finalized(self):
"""Save product as launched"""
...
product.launched = True
product.put()
</code></pre>
<p>这是<a href="https://code.google.com/p/appengine-pipeline/wiki/GettingStarted#Finalization_of_pipelines" rel="nofollow">finalization of a pipeline</a>上的文档。在</p>