JCBC-403: Harden reconfigures on view-based workloads.

This changeset makes sure that even on view-based workloads, lost
streaming connections are detected properly, leading to faster
working states again. In particular, it contains:

 - Signaling an outdated config also on failing http requests
 - Signaling an outdated config on bulkget workloads (by identifying
   inactive nodes)
 - Making sure the proper resubscriber is called with the bucket
   config when the monitor is disconnected.

Change-Id: Ib64faa78a983347d38479a1ab1c3ac9c181ae7ed
Reviewed-on: http://review.couchbase.org/32727
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Updating Spymemcached to 2.10.5

Removing the shutdown method because it is now part of the
inherited spymemcached connection.

Change-Id: Icf881d3de30f11655920091600badba3987e615d
Reviewed-on: http://review.couchbase.org/33285
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Brett Lawson <brett19@gmail.com>
configurable cluster.adminname, cluster.password

provide option to set cluster.adminname and cluster.password in the
build.xml test related properties section.

Change-Id: I46c2e595ed16d477bbd09062cf554c7df2915928
Reviewed-on: http://review.couchbase.org/33137
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-400 : New feature test for credential encryption CRAM-MD5 or PLAIN

Change-Id: I003f5987f56392bd50b871e7a1eb4182008ccc2b
Reviewed-on: http://review.couchbase.org/32355
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Deepti Dawar <deepti.dawar@globallogic.com>
JCBC-337: Update Config from NMVB-Responses.

This changeset takes an incoming "Not My VBucket" response from the server,
does some conversion logic and then passes it on to the ConfigurationProvider.

The config then gets parsed and stored as any other configuration coming
from a streaming response. A test case is added to veriy that behaviour.

Change-Id: I83a838ca0c086426779c092001329b00d11a19e7
Reviewed-on: http://review.couchbase.org/32425
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Suppress unchecked warnings on completion listeners.

Change-Id: Icf7af9df6b7a1fa3df6892ec0a3b3e4175f86d33
Reviewed-on: http://review.couchbase.org/30375
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-337: Implement a Combined Configuration Provider (Binary + HTTP)

This changeset provides a combined http and binary configuration provider. It is
designed to handle bootstrap and monitoring completely autonomously, further
decoupling it from the rest of the codebase.

Change-Id: I13b5029b98c9327cac6927ea35efe529edbb2f84
Reviewed-on: http://review.couchbase.org/32589
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Correcting mailmap for shortlog

Change-Id: I83c239dc4a7ced77059261ae7c689d0ae6bd54cd
Reviewed-on: http://review.couchbase.org/30682
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-240 Add total number of rows in ViewResponse

Change-Id: I82bcb65e48e3d6fde8d5361ee242f89960d38a6f
Reviewed-on: http://review.couchbase.org/25027
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Rename config types for clarity.

This changeset renames the DefaultConfig in CouchbaseConfig and
the CacheConfig into MemcacheConfig to more accurately describe
the type of buckets they are referring to.

Change-Id: Icfa43b63595a362d14c1b0938094fc1d4fcc56b3
Reviewed-on: http://review.couchbase.org/30373
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Use CouchbaseConfig instead of the incorrectly used DefaultConfig.

Change-Id: I2081ef6cf37b83c8a3cb9c7237b01ccafdcf58eb
Reviewed-on: http://review.couchbase.org/33788
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-418: Fix potential deadlock when reconfiguring.

This changeset fixes a potential deadlock which can happen during
reconfiguration and a failing node. When a 500 error response comes
back from the server, the httpcore IO pool handles the retry and
passes it back to our logic, where it grabs a new node to ask. This
node list is synchronized.

In parallel, when a reconfiguration happens, we synchronize on this
list and mark the appropriate node in the pool for shutdown. We
arrive in a deadlock situation because in our code the node list
is synchronized (waiting/holding) and in the httpcore code there
is a lock (waiting/holding) on the internal node to shutdown, but
it is still hold by the retry process.

This changeset moves the actual shutdown out of the synchronized
block, making sure that parallel requests can progress. The node
has been removed out of the list already, so it will not be
tried again for a regular view request (and we can shut down the
open connections behind the scenes).

Change-Id: I0f65d440ce593d0a795ee068e5d84348b9207b5b
Reviewed-on: http://review.couchbase.org/33827
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Enable SNAPSHOT uploading through ant target.

This changeset adds an additional ant target which deploys snapshot
releases directly into the sonatype snapshot repository.

See https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-7c.DeploySnapshotsandStageReleaseswithAnt
for more details on how to setup local authentication.

Change-Id: I3dc26b70c3547e42c0181486bc4e189b5e30ace9
Reviewed-on: http://review.couchbase.org/33881
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Upgrade Spymemcached to 2.10.6

Change-Id: I48d1f2857f9d4b3e394e994f8a9344ace029a278
Reviewed-on: http://review.couchbase.org/33907
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
JCBC-417: Expose (async)getsFromReplica.

This changeset exposes the same replica read functionality as before,
but this time also exposes its underlying CASValue. The signature is
a mix between a replica get and a gets operation.

Change-Id: Id094092280115e66af6962eb8898a6e4b5f27f78
Reviewed-on: http://review.couchbase.org/33884
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Harden "bucket state"-dependent test cases.

This changeset makes sure that various test cases which depend
on bucket state (that is mostly warmup happening) are more
resilient to false-negatives. This is mostly achieved through
larger allowed timeouts, which allows slower disks also to
catch up between the unit tests.

It increases the timeout for the http cluster
operations in the test from 2.5 seconds (operationTimeout) to
the more realistic HttpTimeout (75 seconds).

Change-Id: I4d884c74802ad9906b3a44e91ff9b45f1ca6b650
Reviewed-on: http://review.couchbase.org/32306
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>