Test demonstrating that objects can not be written if a bad CRC is encountered in Bitcask
add stats for coverage query starts
 - index fsm: create, create_error, active
 - keys and bucket fsms (as 'list'): create, create_error, active
Merge branch 'master' into bitcask-badcrc-eunit-test

Preparing to bring the bad crc unit test into the present
change spawn to spawn_link
Write even on bitcask bad_crc read

Fixes issue #385
Reads on corrupted files return a bad_crc error, which were not handled.
When writing, if a bad_crc was encountered on read of an existing key,
the write failed. Files being erased, or even truncated were handled
and the write proceeds, but bit corruption would die. I don't think
there is any benefit to the different handling.
Whitespace change to trigger Travis
Make AAE default to 'off' when not configured

The intention of this commit is to make AAE be disabled by default
when performing an in-place upgrade of Riak, but be enabled by default
for new installs.

This change disables AAE when missing from the top-level app.config.
In Riak, the top-level app.config defaults to having AAE enabled, thus
overriding the default. However, users performing an in-place rolling
upgrade of Riak maintain their existing app.config which is missing
the override. Users who want to enable AAE after an upgrade will need
to add the appropriate settings to their app.config.
Merge pull request #486 from basho/jdb-aae-upgrade-off
provide a Location header for the same api version on POST

If a POST comes in to /buckets/B/keys, the Location header generated
should be of the form /buckets/B/keys/K. If the post arrived at /riak/B,
the Location should be /riak/B/K.
Merge branch '1.3'
Move setting bucket properties to riak_api, see basho/riak_api#31 basho/riak_pb#30
migrate mapred_test to riak_test

This suite had a fragile setup stage that would regularly cause the
automated testers to fail. It has been migrated to the following
riak_test modules, where it should be much more predictable:

mapred_notfound_failover
mapred_javascript
mapred_dead_pipe
mapred_buffer_prereduce
mapred_basic_compat
Merge pull request #489 from branch 'bwf-move-mapred-test'
Ignore EQC stuffs.
Remove Link headers from bucket and key lists.

While webmachine/mochiweb only accepts headers up to 8KB in size, it
has no problem producing huge headers. However, many clients cannot
handle large headers. Since the same information is produced in the
body of these requests anyway, we have no need to produce Link headers
as well. If we want to really use HATEOAS, other things need to be
reconsidered. Since we don't really have HATEOAS, let's not pretend
anymore.
Make hashtree_eqc close trees before destroy.

The hashtree API expects its backing leveldb instances to be closed
before destroying them. Without this patch, the property would abort
quickly with a badmatch error.
Merge pull request #492 from basho/sdc-hashtree-eqc-close

Make hashtree_eqc close trees before destroy.
Fix leveldb_read_block_error bug for < 2 owned indexes

Add tests for same
Fix PR/PW

Originally, PR/PW simply checked, in the validate phase of the GET/PUT
FSM that the required number of primaries were online.

However, that was insufficient. Consider PW=2, PR=2, N=3 case; if 2 primaries
are online. You do the write, but one primary and one fallback receive
the write, the third write fails (but you've already returned a result
to the client, because 2 writes succeeded). Now, when you go to read
that key, 2 primaries are still online, but you read from the primary
that just replaced the fallback and the primary that failed the write
before. Congratulations, you just failed to read-your-own-writes.

It gets worse, even. Because the node_watcher can lag behind the actual
up/down state of a node, especially if the node kernel panics or has its
NIC unplugged, primaries can be reported up for some time after they've
stopped responding (until the distributed erlang connection closes).
This means that its even easier to fail PR/PW but still have the FSM
pass the validation stage. And since R and PR are unrelated, even PW=N
could spuriously validate (if R < PR).

The solution to all this is to simply use the preflist to check we get
the required number of responses from a primary before the FSM will
return. However, this required significant modification to the
Quickcheck tests. Additionally, some simple sanity check eunit tests
were added. Most of the actual changes in this branch are just
EQC/Eunit changes and refactoring.

This also means that PR/PW will now *block* a response from returning
until they've been satisfied. Thusly, PR=2 now will wait for at least 2
replies, possibly all N if necessary, to satisfy the constraint, meaning
you don't need to specify PR *and* R anymore. The same is true for PW,
except that PW waits for DW responses, not W responses, to satisfy the
constraint.

Additionally, the rules on how DW relates to W have been changed, DW is
always at least 1 (for the coordinating put), but it is no longer
demoted to match W.
Address concerns raised during review:

* Fix test setup to be more valid
* Fix some specs
* Move idx_type to get core
* Remove w_fail_threshold
* erlang:max() -> lists:max()
* Switch error tuples to always be 2-tuples
* Update comment about meeting PR