Use couchstore file API v4

Required to build against couchstore as of this change
http://review.couchbase.org/#/c/25605/2

Change-Id: I55c1ee959079abc5a23b517531b9cf9f9ea10d07
Reviewed-on: http://review.couchbase.org/25607
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Aaron Miller <apage43@ninjawhale.com>
MB-7435: Add tap producer stats that shows num of sent items per vb

Change-Id: Iccb666bdaf85d628305925b61a2a9e0cc975570c
Reviewed-on: http://review.couchbase.org/25243
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7435: Add a command to get estimates of keys to move

Change-Id: I8c7dfd23dceed93c8533891128c6448b284aa02f
Reviewed-on: http://review.couchbase.org/25244
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-6368: Add force shutdown variable to stats.hh

This change is needed in order to reduce code dependencies in
couch kvstore. By reducing dependencies it will allow us to
write unit tests for couch kvstore and will also reduce
dependencies for multi-reader/writer changes.

Change-Id: I0c80938b8a3b5427b7a1c6ba0f8aea1bc8cf0475
Reviewed-on: http://review.couchbase.org/25478
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-6368: Move EventuallyPersistentEngine refs out of kvstore

Change-Id: I8ad285d4f668ecbf85456d89f7028a15d97a928e
Reviewed-on: http://review.couchbase.org/25479
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-100: Remove kvstore apis for getting shard information

These are no longer needed since we don't support sqlite anymore

Change-Id: I107316edc4425b3faf82eac78df8219ba54effbe
Reviewed-on: http://review.couchbase.org/25675
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7966: Change VBucketMap name from vbuckets to vbMap

Change-Id: I215871766f95142bde8a866d8a52d7d549d99def
Reviewed-on: http://review.couchbase.org/25692
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-8115: Don't count mem_size_counted in max_counted hash stat

Change-Id: I689eb1a83465424a850a68d8a7f5d1d57a3556f9
Reviewed-on: http://review.couchbase.org/25825
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-8125: Make sure we have numeric value when setting dynamic params

Change-Id: I9666b58215b83f3eacc38e598b6ecff5eb1bc6af
Reviewed-on: http://review.couchbase.org/25807
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-8038 Release hash table partition lock before notifyIOComplete

There can be a deadlock case where a memcached worker thread
tries to grab a hash table partition lock, while the dispatcher
thread already grabs the same parition lock and tries to notify
the IO complete event to the above worker thread.

Change-Id: I550f02f315d0741f300fdb09fe903fcabb1ef4b8
Reviewed-on: http://review.couchbase.org/25834
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8143: Add missing module sys

Change-Id: I0e6697e8d677e3641d10a4bc0f233be55246338e
Reviewed-on: http://review.couchbase.org/25859
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Bin Cui <bin.cui@gmail.com>
MB-7938: Don't decr diskQueueSize if an item is being requeued

Change-Id: Iec7270e577ed8faae18078c5eed6dfbf89e795ac
Reviewed-on: http://review.couchbase.org/25880
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7435: Add tap-vbtakeover to cbstats

Change-Id: I77b03dee6ba4c76b713f1b68d61e9e079b1849e8
Reviewed-on: http://review.couchbase.org/25884
Reviewed-by: Jin Lim <jin@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7435: Fix bug related to tap cursor deregistration during backfill

When we schedule backfill we deregister the tap cursor for a specific
tap stream and as a result any backfilled tap stream would have an
incorrect estimate since we search for tap streams based on tap
cursors.

Change-Id: I16a4f8b8e9bc8eb05de0f3fe76c7babd8e0810df
Reviewed-on: http://review.couchbase.org/25885
Reviewed-by: Jin Lim <jin@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7435: Add more stats into tap-vbtakeover command

These stats provide more details on what the current state of the
tap stream is and will help in debugging.

Change-Id: Id15a8b13f930475ed3fc509709a3178e9b15ac20
Reviewed-on: http://review.couchbase.org/25886
Reviewed-by: Jin Lim <jin@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Merge remote-tracking branch 'gerrit/2.0.2'

Change-Id: I47ee0dabca3073240259441ccad0ee8a20579513