Hi Ikai, It's quiet useful. But I can't find the definition of MapReduceState and method getMapReduceStateFromJobID() in the model.py.
I'm using mapreduce version 100 now. I think it's the latest one. BTW, what was the blog? It seems I can learn something from it. Can you share it? Thanks! Regards, Mac On Sep 1, 3:27 am, "Ikai L (Google)" <[email protected]> wrote: > Here's how you'd get the counter value (excuse the comments, this is copied > and pasted from a blog post): > > MapReduceState mrState = MapReduceState.getMapReduceStateFromJobID( > datastore, jobId); > > // There's a bit of ceremony to get the actual > counter. This > // example is intentionally verbose for clarity. > First get all the > // Counters, > // then we get the CounterGroup, then we get the > Counter, then we > // get the count. > Counters counters = mrState.getCounters(); > CounterGroup counterGroup = > counters.getGroup("CommentWords"); > Counter counter = counterGroup.findCounter("count"); > long wordCount = counter.getValue(); // Finally! > > > > > > > > > > On Sun, Aug 29, 2010 at 12:20 AM, mac <[email protected]> wrote: > > Hi, > > > I tried to use MapReduce (http://code.google.com/p/appengine- > > mapreduce/) to do some jobs in my project. > > > I am wondering how get the value of the counters? > > > It seems that it is stored in the counters_map field in MapreduceState > > and it's in JSON format. > > > Is it the correct way to grab the value by read and parse it from > > MapreduceState directly? > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google App Engine" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<google-appengine%2Bunsubscrib > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/google-appengine?hl=en. > > -- > Ikai Lan > Developer Programs Engineer, Google App Engine > Blog:http://googleappengine.blogspot.com > Twitter:http://twitter.com/app_engine > Reddit:http://www.reddit.com/r/appengine -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
