Remove warnings from c files

Change-Id: I4c86738cb25e6951c72d6b0a351675af5104fb4f
Reviewed-on: http://review.couchbase.org/31311
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MB-9769: Test case where item_pager hangs

- Noticed that in test_item_pager testcase,
sometimes the chunk of data removed makes mem_used
just a little lesser than the high_water_mark,
in this case mem_used never goes all the way down
to being lesser than or equal to the low_wat_mark.

- Fix ensures that in the above mentioned case
whenever the mem_used crosses the high_wat_mark,
mem_used always comes down to being lesser than or
equal to the low_wat_mark.

Change-Id: I61ceb94bdc59909c40881785e48d500c5dd98e99
Reviewed-on: http://review.couchbase.org/31310
Reviewed-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
Tested-by: Sundararaman Sridharan <sundar.sridharan@gmail.com>
MB-9715: Fixup UPR step

Check the result value from the message producers and
propagate errors back to the core, and return
the correct return value to avoid spinning and
eating up the CPU.

Change-Id: I360d014884425a62e8e8ec1ae60614ceaf8a6ccb
Reviewed-on: http://review.couchbase.org/31121
Reviewed-by: David Liao <david.liao@couchbase.com>
Tested-by: David Liao <david.liao@couchbase.com>
MB-9423: Add a 30 second timeout to cbepctl and cbstats

Change-Id: I392a9efab924de99e9ddbf4171b368b02327453d
Reviewed-on: http://review.couchbase.org/31273
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Fix failing upr producer stream unit test

Change-Id: I41d56069240e0c2c84d58b638c936731f16b0414
Reviewed-on: http://review.couchbase.org/31352
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Use forward_iterator_tag for histogram

Looks like we're missing some methods in order to be
a random iterator (getting tons of errors with MSVC).
Since we're not using them in both directions anyway
the easiest solution was just to move it to a forward
iterator (errors from template code generates a LOT
of unreadable errors ;-) )

Change-Id: I9a8df00b6b18b6096336cffcb31d09a88cdbf044
Reviewed-on: http://review.couchbase.org/31327
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Remove unused optional parameter to ThreadLocal

Change-Id: I8f1dd362de01bd7ca7baa76326cb61beec3f534c
Reviewed-on: http://review.couchbase.org/31328
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Remove unused functionality in AtomicQueue

Change-Id: Ic18d74484ed89d1d7e0debc7f007c38946c2b9a5
Reviewed-on: http://review.couchbase.org/31329
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Create a simplified AtomicQueue for windows

This currenly use a single mutex for each operation.
Given that it is only used for TAP and UPR and that we won't
have _that_ many concurrent thread calling it it might be good
enough for windows currently.

Change-Id: Ibeed856c0694556e7e5caae3e9a412d7f5a1fb1a
Reviewed-on: http://review.couchbase.org/31330
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Use C++ atomics if available for spinlock

Change-Id: I6b707f168b399015523926d3e7eb93aca382f497
Reviewed-on: http://review.couchbase.org/31331
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
fix unit test worker stats

Change-Id: I3c07fe3d8208d91531720e14460687b8590a06fc
Reviewed-on: http://review.couchbase.org/31350
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
add unit test for max_threads override feature

By default, ep-engine will spawn 2X times the number of cpu
cores, threads. But we also have an way to override this
by specifying a non-zero max_threads parameter.
Enhance existing unit test to test this feature too

Change-Id: I1f8e0a680bb79f0883a86e763fb13bcaab6ee6e4
Reviewed-on: http://review.couchbase.org/31384
Reviewed-by: David Liao <david.liao@couchbase.com>
Tested-by: David Liao <david.liao@couchbase.com>
Ignore win32 build artifacts

Change-Id: I53734cf77f2c301ec8c2fc877d384797f588d30a
Reviewed-on: http://review.couchbase.org/31414
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MSVC don't support alarm()

It is just used as a safety net anyway

Change-Id: Ic2861abefe4363a25bdb75a35c826343922df2ba
Reviewed-on: http://review.couchbase.org/31412
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Removed unused functionality in RCPtr

Change-Id: I262f6e4ffeabb968c989dead51d7db9319167898
Reviewed-on: http://review.couchbase.org/31336
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Use our own thread wrapper for tests

Change-Id: Id32ebcaa3ae2967cbc4c8fbdcb6ccff641ff2353
Reviewed-on: http://review.couchbase.org/31411
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Revert "MB-9715: Fixup UPR step"

This reverts commit cac72f4cd6abff127364c9251d42bb5a45a71c68.

Change-Id: Ifcb9ca1da7699787bc18ec79a61895030c61f5b8
Reviewed-on: http://review.couchbase.org/31429
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Use dirutils from platform/

Change-Id: I271c8dde19ce76d61b13f55f302d8d2e753a2446
Reviewed-on: http://review.couchbase.org/31418
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
Fixup error message for failed to remove file

Change-Id: I2a9d355ee53b4a70c3ef240ba4e39a4475350a31
Reviewed-on: http://review.couchbase.org/31422
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Trond Norbye <trond.norbye@gmail.com>
MB-9741 Replace usage of QueuedItem with Item class.

This is the first phase of reducing memory used by keys/metadata of items.
This checkin now replace QueuedItem with Item used by Checkpoing Manager
and prepares for using Item class in StoredValue. QueuedItem is removed
from the code base.

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