Merge pull request #1004 from basho/bugfix/969

Check AAE throttle only when AAE is enabled

Reviewed-by: slfritchie
Update all branch pointers to 2.0 branches
Use SC bucket types and buckets to know ensembles

If we use a default bucket property with a different n_val from the
strongly consistent bucket type, ensembles for that bucket type will
never be created. The problem seems to stem from the fact that
riak_kv_ensembles:required_ensembles/1 checks all current bucket n_vals
for ensembles to create, but doesn't check bucket types that don't yet
have buckets created. Since all buckets are created on demand with a
put, and it's not possible to put if the ensemble doesn't exist, the
buckets and ensembles never get created.

To fix this we now iterate through all bucket types and collect all
n_vals from them, as well as the n_vals from the existing buckets in
order to figure out the set of all n_vals required to create ensembles.

Fixes #1007
prevent secondary systems (e.g. yz) from blocking vnode handoff indefinitely

* add a recejection count and maximum number of rejections (configurable)
* includes changes to riak_kv.schema
add cfish schema test for handoff.max_rejects
Remove ring id optimization in riak_kv_ensembles

Since the ring does not change when bucket types are activated we remove
the check for a changing ring id that was supposed to prevent
unnecessary work. Leaving the optimization in would require changing
riak_core to trigger on cluster metadata changes in addition to ring
changes. This change thus prevents us from having to change riak_core
at the expense of some extra work to check if the ensembles have changed
when they probably haven't.
Change application:get_env/2 -> app_helper:get_env
Update tools.mk to 0.5.6
Fix Edoc syntax errors in riak_client.erl
Fix Edoc errors in riak_kv_test_util

Because we don't compile docs with TEST defined, the @doc comments
remain, but the function definitions themselves aren't seen by edoc.
This makes edoc think there are just bare `%% @doc ...` comments. This
change just removes the `@doc` bit.
Fix EDoc syntax errors in riak_index.erl
Fix Edoc syntax errors in riak_kv_bucket
Fix Edoc syntax errors in riak_kv_counter

This resulted in a cryptic function clause error from the edoc code
itself.
Fix Edoc syntax errors in riak_kv_crdt
Fix Edoc syntax errors in riak_kv_delete

Removes completely wrong arity spec. Useless.
Fix Edoc syntax errors in riak_kv_gcounter
Fix Edoc syntax errors in riak_kv_memory_backend

Since we don't compile docs with TEST defined, this just ends up being a
bare `@private` tag, which EDoc doesn't understand.
Fix Edoc syntax errors in riak_kv_multi_backend

* Move module-level doc to top-level
* Remove tags from functions only defined with TEST
Fix Edoc syntax errors

s/@Doc/@doc
Fix Edoc syntax errors in riak_kv_gcounter

The .erl extension causes Edoc to fail with a function clause error.