在mapreduce中难以理解 [英] Having difficulty in mapreduce to understand
问题描述
我已经看到下面的链接,它是python入门mapreduce的开始!
http://code.google.com/p/appengine-mapreduce/wiki/GettingStartedInPython
但我仍然无法理解它的工作方式。
mapreduce.yaml
$ b我正在执行下面的代码,但无法理解究竟发生了什么? $ b
mapreduce:
- 名称:Testmapper
映射器:
input_reader:mapreduce.input_readers.DatastoreInputReader
处理器:main.process
params:
- name:entity_kind
default:main.userDetail
mapreduce / main.py
一些代码
class userDetail (db.Model):
name = db.StringProperty()
某些代码
def process(u):
u.name = mahesh
yield op.db.Put(u)
我正在执行此操作
但是无法理解发生了什么
主要的是我想用mapreduce做就是从实体搜索或计数记录
所以任何人都可以请帮助我??
提前致谢 您正在设置所有 如果你想计算你的实体使用: I have seen the below link which is of getting started mapreduce with python http://code.google.com/p/appengine-mapreduce/wiki/GettingStartedInPython But still I am not able to understand how its working. I am executing below code but not able to understand what exactly is happening? mapreduce.yaml mapreduce/main.py I am executing this and it gives me status = success in status page. But not able to understand what happend The main thing I want do with mapreduce is to search or count records from entity So anyone can please help me?? Thanks in advance You are setting the If you want to count your entities use :
这篇关于在mapreduce中难以理解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! userDetail $ c $>的
mahesh
值添加到 StringProperty名称
从mapreduce导入操作作为op
def process(实体):
yield op.counters.Increment(counter1)
mapreduce:
- name: Testmapper
mapper:
input_reader: mapreduce.input_readers.DatastoreInputReader
handler: main.process
params:
- name: entity_kind
default: main.userDetail
some code
class userDetail(db.Model):
name = db.StringProperty()
some code
def process(u):
u.name="mahesh"
yield op.db.Put(u)
"mahesh"
value to the StringProperty name
of all your userDetail
entities.from mapreduce import operation as op
def process(entity):
yield op.counters.Increment("counter1")