MB-7229: Don't convert flags to host order with meta opetations

Change-Id: I70079cfca90127fc5e0e57de0557a2cf454bbff6
Reviewed-on: http://review.couchbase.org/22736
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
MB-7272 stop warmup task immediately if shutdown is being requested

Change-Id: I557f4d2e45286a57e8adf8cef305d23253ad8984
Reviewed-on: http://review.couchbase.org/23051
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-7342: Fix touch with exp time 0

Change-Id: I51256644fccbd8f5ef9a56579302219a810ccff6
Reviewed-on: http://review.couchbase.org/23024
Tested-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
MB-7357 Apply the replication backoff logic to TAP deletion events

Like TAP mutation events, TAP deletion events should be also
throttled in a destination node if its disk write queue or memory
usage is above the replication throttling threshold.

Change-Id: I79df1dd6e477fb30ddfc882f0f9c3641b60bf742
Reviewed-on: http://review.couchbase.org/23074
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-7358 Queue TAP backfill deletions into the backfill queue.

All the deletion events, which are received as part of TAP
backfill stream, should be pushed into the backfill queue
instead of the checkpoint queue in a destination node.
Otherwise, it could cause more memory overhead and data
inconsistency.

Change-Id: I7e9644d9ff6e8abf8b1d84cb428df67b26a88ba9
Reviewed-on: http://review.couchbase.org/23075
Reviewed-by: Jin Lim <jin@couchbase.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-7362 allow warmup transition to done  from any state during shutdown

Change-Id: Id4736e2340d99c421647e4e1b49a47d7d7024813
Reviewed-on: http://review.couchbase.org/23111
Reviewed-by: Chiyoung Seo <chiyoung.seo@gmail.com>
Tested-by: Jin Lim <jin@couchbase.com>
MB-6755: Fix inefficient check for data structure emptiness

Calling size() has linear complexity one some platforms, but
calling empty() always has constant complexity so it is better
to use empty().

Change-Id: Ib0e13dcc3a10b2c2c18b86b514915f6b621a9f07
Reviewed-on: http://review.couchbase.org/23411
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-6756: ++/-- should be prefix operators for non-primitive types

A postfix operator on a non-primitive type will cause the creation of a
of a temporary object, while the prefix operator does not. This change
will provide a small performance boost.

Change-Id: Ie53246216e570e6de7c4b74c97cea422cfee063b
Reviewed-on: http://review.couchbase.org/23412
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7334: Don't internally call static members with static syntax

This can cause portability issues since some compilers consider
this an error.

Change-Id: I73678fe287781c68780f79b15e90dfa23f419897
Reviewed-on: http://review.couchbase.org/23413
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7332: Exceptions should be caught by reference

Throw by value, catch by reference. Catching by value is
problematic in the face of inheritance hierarchies.

Change-Id: Ifbc81e394aa818a2755c69af7888e0ab8aa86f4a
Reviewed-on: http://review.couchbase.org/23414
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7392: stl containers should be passed by reference

Change-Id: I0a092a705b7f93766d4da55be3f197e7aa2a064d
Reviewed-on: http://review.couchbase.org/23415
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7392: DISALLOW_COPY_AND_ASSIGN() should be private

Change-Id: I7a3ef1403518643aac9b7ecdab1d14cfe18deff8
Reviewed-on: http://review.couchbase.org/23416
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7394: Remove unused variables

Change-Id: Ifd6c0fdcbb1d4d183e0e85ac420f2ec8aab00212
Reviewed-on: http://review.couchbase.org/23417
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7353: Remove the small item feature

Change-Id: Ic72432880b7016ead3278d6b411eacc7a645a750
Reviewed-on: http://review.couchbase.org/23418
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7203: Add sys import so we don't get NameError during auth

Change-Id: I87875b596a99a3bdaf95d9ae806ffe882d68b2cc
Reviewed-on: http://review.couchbase.org/23419
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-100: Remove defunct methods from CouchKVStore & KVStore

destroyInvalidVBuckets, processTxnSizeChange, setVBBatchCount
are no longer used in 2.0.

Change-Id: I7d6283f2cd86c977dbd3154e95b253cce3529c42
Reviewed-on: http://review.couchbase.org/23420
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-100: Remove valuelen field from CouchRequest class

The actualy value length can be calculated from the original
value_t class object. No need to stash it within CouchRequest
objects.

Change-Id: I460841fd6b81a3327caf512941e4f9c102a45d7b
Reviewed-on: http://review.couchbase.org/23421
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-100: Removed itemId field from CouchRequest class

itemId gets updated each time couchstore update its seq #
for a given document and stored within the return value of
set/get callback object.

Change-Id: I793a8db164263ff811fe403f73bf5591b50c3318
Reviewed-on: http://review.couchbase.org/23422
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-100: Do not attempt to notify mccouch while shutdown is in progress

When engine is in shutdown mode ep_engine can skip mccouch notification
for the newly updated header location of a vbucket file after commit.
The notification is basically required for the synchronization between
ep_engine and compactor, however, prior to the engine shutdown compactor
must have already exited by ns server.

Change-Id: I8257f997f307c00ff4a9ea2066c52c6d268c292b
Reviewed-on: http://review.couchbase.org/23423
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
MB-7399: Initialize all variables in a class by default

Change-Id: I3c165a92f5e79ed61862a5f89dde56535d07230a
Reviewed-on: http://review.couchbase.org/23424
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>