1
我正在使用google mapreduce lib来处理我的数据。在处理数据时,计数器用于映射器功能。但我不知道如何通过最终方法获得反击结果。如何在AppEngine MapReduce中获得计数器结果?
def mapper(obj):
yield obj
yield operation.counters.Increment("process-obj")
class Test(base_handler.PipelineBase):
"""A pipeline to ingest log as CSV in Google Storage
"""
def run(self, setting_id):
filepath = yield mapreduce_pipeline.MapperPipeline(
"test",
"mapper",
"mapreduce.input_readers.DatastoreInputReader",
output_writer_spec="mapreduce.output_writers.FileOutputWriter",
params={
},
shards=10
)
def finalized(self):
# how to read the counter process-obj
# how to get the setting_id
pass
冷静,这正是我期待的!谢谢 – lucemia