How do i make them methods on the Flow? Pimp the Flow?

You do mean on the Job? That makes sense to me.



On Wed, Sep 11, 2013 at 12:36 PM, P. Oscar Boykin
<notifications@github.com>wrote:

> In scalding-core/src/main/scala/com/twitter/scalding/Tool.scala:
>
> > @@ -124,6 +137,37 @@ class Tool extends hadoop.conf.Configured with hadoop.util.Tool {
> >      start(job, 0)
> >      0
> >    }
> > +
> > +  protected def writeFlowStats(flow: Flow[_], filename: String) {
> > +
> > +    def counterMap(stats: CascadingStats): Map[Any, Any] =
> > +      stats.getCounterGroups.asScala.map { group =>
> > +        (group, stats.getCountersFor(group).asScala.map { counter =>
> > +          (counter, stats.getCounterValue(group, counter))
> > +        }.toMap)
> > +      }.toMap
> > +
> > +    def statsMap(stats: CascadingStats): Map[Any, Any] =
>
> can these be public methods on the Flow instead?
>
> Not crazy about baking in JSON here. Would rather return the map if we
> want a weakly typed stats reporting.
>
> That said, I would actually prefer we make a case class to do this:
>
> case class JobStats(counters....
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/twitter/scalding/pull/591/files#r6299177>
> .
>