DAGScheduler.this should work - no need to add an instance variable


On Mon, Mar 31, 2014 at 7:13 AM, Mark Hamstra <notifications@github.com>wrote:

> In core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala:
>
> > @@ -150,7 +162,10 @@ class DAGScheduler(
> >            }
> >        }
> >      }))
> > -  }
> > +  }))
> > +
> > +  // set the dagscheduler until after the actor system is ready
> > +  taskScheduler.setDAGScheduler(this)
>
> Well, you can't access it as this since this means something else within
> the eventProcessActor, but I think this should work:
>
> private[this] val thisDAGScheduler = thisenv.actorSystem.actorOf(Props(new Actor {  // the Supervisor
>   ...
>   eventProcessActor = context.actorOf(Props(new Actor {
>     ...
>     override def preStart() {
>       taskScheduler.setDAGScheduler(thisDAGScheduler)
>     }...
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/apache/spark/pull/186/files#r11102108>
> .
>