MB-7656 Add bitmap data structure and operations

Change-Id: Idabd34c8f56602fc3adca87021c75d2932756a46
Reviewed-on: http://review.couchbase.org/24287
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7656 Add sorted list data structure

Change-Id: I80526c46790d925983d5e300301e323561ced65b
Reviewed-on: http://review.couchbase.org/24339
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7656 Move json collator to src/views/

So that all view related code is clearly separated
from database related code.

Change-Id: Ibc9e48c8f6ee71c2283a11427d8c97d2f72e9860
Reviewed-on: http://review.couchbase.org/24420
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7656 Add index header structure

Change-Id: If97d5011a3422e328dcac97ffcb31cc85aabe47d
Reviewed-on: http://review.couchbase.org/24461
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Remove reference to no longer existing file win32.c

Change-Id: If010fa135fe9cb32602a58d2ad03198a79409205
Reviewed-on: http://review.couchbase.org/24602
Reviewed-by: Aaron Miller <apage43@ninjawhale.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629: Make btree chunk size configurable

Change-Id: Ia24b1f9ea1579c6c06b5f424b2da00f00c4eb943
Reviewed-on: http://review.couchbase.org/25095
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629: Allow different chunk threshold sizes for KV and KP nodes

Change-Id: Ibc5a727b45bbbba563a717f39ae636ec15f37501
Reviewed-on: http://review.couchbase.org/25140
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629, MB-7656 Add mapreduce library

To be used by the view compactor, view builder and view updater.
This is a C++ library, that links against the V8 JavaScript engine,
but it exposes a pure C API to the outside.

Change-Id: I4f80f7d490e31dd3b43e50007a6c23133baaa7b5
Reviewed-on: http://review.couchbase.org/25257
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629, MB-7656 Delete context object

On context destruction, delete as well the context
object, and not just its members.

Change-Id: I25f3fb23d25e242fced7aa2d33d773c896509a12
Reviewed-on: http://review.couchbase.org/25307
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629: Add structures and operations for view reductions

Change-Id: I75adc5d666b73a115a6154ca8c55084f75493d6f
Reviewed-on: http://review.couchbase.org/25368
Tested-by: Fulu Li <fulu@couchbase.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629 Use other reduction values for view unit tests

The new values were produced by CouchDB (Erlang), therefore
it's better to check that we can decode these values and
encode them back to the exact same byte sequence that CouchDB
produced.

Change-Id: I796aceeb603eca03ed9b1756fe5c9fbdd125e709
Reviewed-on: http://review.couchbase.org/25418
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
Merge branch '2.0.2' into master

Change-Id: I131483ca0bcf2a665245ec775ebfe9057aadcc46
MB 7629: Add structures and operations for view btree keys

Change-Id: I939abd94f91a3e855c94b50dd8d736e358542df3
Reviewed-on: http://review.couchbase.org/25450
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Tested-by: Fulu Li <fulu@couchbase.com>
MB-7629 Use other key values for view unit tests

The new values were produced by CouchDB (Erlang), therefore
it's better to check that we can decode these values and
encode them back to the exact same byte sequence that CouchDB
produced.

Change-Id: Id38793f574233d8d3c578999db3502f824f29432
Reviewed-on: http://review.couchbase.org/25490
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629 Remove unnecessary code

It does nothing at all, except using some cpu and
increasing the source code size.

Change-Id: Icfe6184e6eb7ea10bab542c024d37b766de906bc
Reviewed-on: http://review.couchbase.org/25491
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7656 Fix function return value to void

void * was useless, likely a typo.

Change-Id: I82e3aa4e59452f649b88cef71d6fc25398d345a6
Reviewed-on: http://review.couchbase.org/25598
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629 Fix warning on implicit cast

src/views/reductions.c: In function 'decode_view_btree_reductions':
src/views/reductions.c:48:8: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]

Change-Id: Ia52e7dd666e7ccfa6b2414c1ad68182ee4568360
Reviewed-on: http://review.couchbase.org/25599
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629 Remove unused function

src/views/reductions.c: At top level:
src/views/reductions.c:255:13: warning: 'enc_uint48' defined but not used [-Wunused-function]

Change-Id: I0d6d171bcf3c80896ae3f8539169e82a4422e1c8
Reviewed-on: http://review.couchbase.org/25600
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7629 Remove unused variable

Change-Id: Idedec34ecb4b968b6378c5fd16d53e63dca6c07c
Reviewed-on: http://review.couchbase.org/25601
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
MB-7656 Fix warning about possibly uninitialized var

Change-Id: Id4849e5f0067a6471469a5d2dfd55eecfe8d1605
Reviewed-on: http://review.couchbase.org/25602
Reviewed-by: Volker Mische <volker.mische@gmail.com>
Reviewed-by: Fulu Li <fulu@couchbase.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>