Futures version of reading ArrayBasedDirectedGraph

ArrayBasedDirectedGraph was not very clear with `apply()` method on almost 200 lines. I've cut it into submethods and rewrite it to futures instead of ExecutorUtil's parallel works.
Yes, that is correct except you don't need 3. to be lazy.
FuturePool.unboundedPool is already a lazy val. In your code, you will
always use it, so making it lazy does not buy you anything.


On Fri, Jun 27, 2014 at 2:08 AM, Szymon <notifications@github.com> wrote:

> In
> cassovary-core/src/main/scala/com/twitter/cassovary/graph/ArrayBasedDirectedGraph.scala:
>
> >     */
> > -  def apply(iteratorSeq: Seq[ () => Iterator[NodeIdEdgesMaxId] ], executorService: ExecutorService,
> > -      storedGraphDir: StoredGraphDir) = {
> > +  def apply(iteratorSeq: Seq[() => Iterator[NodeIdEdgesMaxId]], executorService: ExecutorService,
>
> OK @agrewal <https://github.com/agrewal> IIUC, you suggest to
> 1. create ArrayBasedDirectedGraph class to handle everything in a class
> instead of object
> 2. We use companion object apply method to read array based directed
> graph. It takes only parallelisationLimit: Int (no: ExecutorService),
> 3. ArrayBasedDirectedGraph has lazy val futurePool: FuturePool =
> FuturePool.unboundedPool
> 4. There is a semaphore field - initialized to parallelisationLimit
> 5. You can create future in the pool only when having the semaphore
> 6. All methods invoked by the main apply() method use the futurePool from
> the class
>
> Is this correct?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/twitter/cassovary/pull/72/files#r14284790>.
>



-- 
Regards,
Ajeet