Remove FlowState and use a proxy pattern for that state

This is a pretty big change as it causes all read taps to be wrapped by a proxy, but it does remove a big wart: the global static FlowState map.

Thoughts on this one?

@cwensel Note the ProxyTap here. I had to resort to reflection to make this work due to the .id in Taps being private. It would be nice to have this ProxyTap idea supporting in cascading so that we can attach extra information to Taps we get at runtime.
lets start with a MetaTap, and I can try a MetaPipe later.

On Aug 6, 2014, at 1:02 PM, P. Oscar Boykin <notifications@github.com> wrote:

> In scalding-core/src/main/scala/com/twitter/scalding/cascading_interop/ProxyTap.scala:
> 
> > +
> > +import java.util.{ Set => JSet }
> > +
> > +/**
> > + * This is for when you might want to attach some additional state or behavior
> > + * onto an existing tap instance (for instance, one returned from createTap
> > + * in scalding source
> > + */
> > +abstract class ProxyTap[C, I, O, +T <: Tap[C, I, O]] extends Tap[C, I, O] {
> > +  def proxy: T
> > +
> > +  /**
> > +   * This sucks, but I can't see how to make the id the same, and without it
> > +   * this proxy breaks when proxies return this
> > +   */
> > +  @transient private[this] val idF = classOf[Tap[_, _, _]].getDeclaredField("id")
> It would be nice to have Pipe have a decorator, but we don't use SubAssemblies so far in scalding (other than the AggregateBy for some code in the Fields-API of scalding).
> 
> —
> Reply to this email directly or view it on GitHub.
> 

--
Chris K Wensel
chris@concurrentinc.com
http://concurrentinc.com