add store access interface to ranges

For rebalancing operations, stores need to keep track of changes (creation, etc) in the underlying ranges.
Since rebalancing needs to be synchronized through raft, it makes sense to have the bulk of the business logic in the range itself.
That necessitates an interface into the owning store. This is my attempt of providing one that keeps ranges relatively autonomous, makes it easier to initialize a range from a store and also allows the calls into the store to be mocked out completely, which makes for fun testing possibilities.
We need to add the range to the store's range map...

On Wednesday, September 10, 2014, jiangmingyang <notifications@github.com>
wrote:

> In storage/store.go:
>
> > @@ -320,3 +320,26 @@ func (s *Store) ExecuteCmd(method string, args proto.Request, reply proto.Respon
> >
> >  	return rng.ReadWriteCmd(method, args, reply)
> >  }
> > +
> > +// RebalanceAccess is an interface satisfied by Store through which ranges
>
> I still didn't understand why you need to access store for rebalancing?
>
> I'm thinking what's the implementation "rebalancing". The common steps of
> rebalancing seems to be:
> (1) create a new range replica and clone a snapshot from one existing
> replica of the same range.
> (2) add the replica to the raft.
>
> all those steps can be done inside range?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/cockroachdb/cockroach/pull/45/files#r17394547>.
>