Adjustments to insert_to_ooc (#2998)
Adjustments to insert_to_ooc (#2998)

* Find subindex before acquiring lock

Within `insert_to_ooc`'s closure `store`, determine the `subindex` based
on the `region` and `index` before acquiring the lock. This can be done
independently of writing the data. So allow it to proceed in parallel
and be done before actually writing out the data. Should cutdown the
time the lock is held.

* Construct `insert_to_ooc`'s graph in a `for`-loop

Makes it a little easier to read and follow what is happening in the
graph construction step at the end of `insert_to_ooc`.

blaze/dask,jcrist/dask,blaze/dask,jakirkham/dask,jakirkham/dask,mrocklin/dask,ContinuumIO/dask,jcrist/dask,ContinuumIO/dask,mrocklin/dask,dask/dask,dask/dask