2.1.0 branch at build 2.0.2-824

Change-Id: I1a7e793d1b5ff9b7b4c9e1a9212e3259dd155fd3
Reviewed-on: http://review.couchbase.org/26696
Reviewed-by: Philip Labee <philip@couchbase.com>
Tested-by: Philip Labee <philip@couchbase.com>
MB-7735: Fix to a race in notifying / releasing TAP connections

Releasing and notifying an TAP conneciton is now synchronized
through a separate lock.

Change-Id: I36deeeaab98235500d9ba22c213c413eac1fbc04
Reviewed-on: http://review.couchbase.org/26705
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8214 remove unnecessary mutex notification

ExecutorThread::reschedule() method gets called very
often. This does not need to call mutex notification
at all since the running thread itself calls the method
during its runtime.

Change-Id: I66b0fe60c82c604d173fdab8090bd7461fe2cece
Reviewed-on: http://review.couchbase.org/26721
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-8214 replace wake() with snooze()

Calling IOManager::wake() method from running task is
unnecessary. This only causes redundant resorting of
already sorted futureQ of running thread.

Change-Id: Ife0afcd0dc7f977af314d40124e62237e3def6d6
Reviewed-on: http://review.couchbase.org/26720
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-8370 add WorkLoadPolicy class

This new class defines and applies user defined workload
access pattern while global io manager launching worker
threads for a newly registered bucket.

Change-Id: I1905786fc67b9004118f11d83196d76f95dfb136
Reviewed-on: http://review.couchbase.org/26723
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-8418 Handle stats key exceptions according to memcached errors

Change-Id: Ibfe2c046b20f6913184dbc8a251d71451f5345d7
Reviewed-on: http://review.couchbase.org/26808
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8292: Switch engine onto snaphot stats add_stat callback

The add_casted_stat function will switch the current engine off
of the thread so we need to switch it back on when entering the
snapshot stats add_stat callback.

Change-Id: I2208f37c0d028908a803176b2efabd867f8a06f3
Reviewed-on: http://review.couchbase.org/26811
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-8413 Release KVShard instances upon a bucket deletion.

Change-Id: I91db6eb20c30a37df98b23b7ac8799d0cbff7e64
Reviewed-on: http://review.couchbase.org/26846
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8413 Release CouchNotifier instances if not referenced

Change-Id: I88766f6e6da14107c0bb712b4d732448f5cc742d
Reviewed-on: http://review.couchbase.org/26845
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-8415 change num_shards parameter to num_workers

The parameter is really for setting an approximate
total number of worker threads (num_workers) not
a total number of shards for given bucket (num_shards).

Change-Id: Ica52b0b03f4da4106f46a0a4bee3bee4957f9e01
Reviewed-on: http://review.couchbase.org/26772
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Jin Lim <jin@couchbase.com>
Merge remote-tracking branch 'gerrit/2.1.0'

Change-Id: I88b9448a0799ba48f54d9e8891d0b5b44002f204