python - Is there something like DatastoreOutputWriter? -


how write mapreduce results datastore? first thought "datastoreoutputwriter", apparently there no such thing.

clarification: question not modifying/saving entities. instead, i'd process them, , store processed results (different kind of entities) in datastore.

example: count number of users every , then, , save results new entity containing date , count.

the purpose of inputreader split job tasks each entity. write handlers handle each task passed appropriate entity.

you don't need datastoreoutputwriter since can write entity in task. mapreduce lib has tools make bit more efficient using async puts. they're recommended code doesn't use them still work. here's simple handler makes small modification , writes entity in mapper phase:

def addnewattribute(entity, *args, **kwargs):     try:         if not entity.get("newattribute"):             entity["newattribute"] = false             yield op.db.put(entity) # save entity datastore             yield op.counters.increment("touched") # use mapreduce counter track operations     except:          yield op.counters.increment("touchfail") 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -