basho/riak_kv — pull request #1004 by rzezeski (2014-07-16 23:00:07+00:00)
Title: Check AAE throttle only when AAE is enabled

Move the AAE throttle check to the actual tick function to prevent it
from running when AAE is disabled. Otherwise, users see AAE throttle
messages when AAE is not enabled and that is just plain confusing.

Some unit tests failed but they don't seem related. I figured
I'd get this PR up as a start.

```
Failures:

1) riak_kv_pb_object:empty_bucket_key_test_/0:398: RpbPutReq with empty key is disallowed
Failure/Error: ?assertMatch({ ok , _ }, Result)
expected: = { ok , _ }
got: {error,closed}
%% src/riak_kv_pb_object.erl:398:in `riak_kv_pb_object:-empty_bucket_key_test_/0-fun-1-/0`

2) riak_kv_pb_object:empty_bucket_key_test_/0:402: RpbPutReq with empty bucket is disallowed
Failure/Error: ?assertMatch({ ok , _ }, Result)
expected: = { ok , _ }
got: {error,closed}
%% src/riak_kv_pb_object.erl:402:in `riak_kv_pb_object:-empty_bucket_key_test_/0-fun-3-/0`

3) riak_kv_pb_object:empty_bucket_key_test_/0:406: RpbGetReq with empty key is disallowed
Failure/Error: ?assertMatch({ ok , _ }, Result)
expected: = { ok , _ }
got: {error,closed}
%% src/riak_kv_pb_object.erl:406:in `riak_kv_pb_object:-empty_bucket_key_test_/0-fun-5-/0`

4) riak_kv_pb_object:empty_bucket_key_test_/0:409: RpbGetReq with empty bucket is disallowed
Failure/Error: ?assertMatch({ ok , _ }, Result)
expected: = { ok , _ }
got: {error,closed}
%% src/riak_kv_pb_object.erl:409:in `riak_kv_pb_object:-empty_bucket_key_test_/0-fun-7-/0`
```

This is meant to address the first part of #969.