basho/riak_kv — pull request #703 by engelsanchez (2013-10-17 00:24:40+00:00)
Title: Fix MR/bucket types incompatibility

This adds a special case to keep the old format for bkey streams when
using the default bucket. It also changes the order of jsonified lists
for bkey/keydata items that have a bucket type, moving the bucket type
last. That should make all existing JS and Erlang MR reduce functions
compatible as long as they don't have to deal with bucket types (within
the same bucket, etc). The functions will only need updating to deal
with bucket types by accessing the 4th item in the list. This is
compatible with the old format, as it will be null in pre-bucket types
Riak. That way no complicated checks for list length are needed to
determine the order of the items. Keydata, the 3rd item in the list,
will be null when a bucket type is present as a 4th member. Erlang
reduce functions will need a new clause if bucket types will be present,
but not if only default. All MR riak tests should pass with this now.

/cc @Vagabond @beerriot