SPY-107: Ensure state of timedout is known across IO and user threads.

After seeing this in a log, I re-thought through the series of events here.

This flag on the op is known by user threads and the IO thread.  Thus it
is modified in these two different ways:

* operation is created and enqueued
* OperationFuture is returned
* .get() is called on OF
 **timed out**

* operation is removed from input queue
* elapsed time is checked
  **timed out**

Change-Id: I879f9b6459aa2fce1ddd97c5803da8c5392453a5 (cherry-picking from commit 1e8d77cf0f9cfc146f21907426c1145b47b5fe5b)
SPY-108: Verify connections are sound before completing them entirely.

Without this change, the client considers the connection to be
good any time a connection has been established.  This is not the
case in some critical situations, such as a hung process or a very
busy remote server.

Solution is to ping the server with a version op, since that can happen
before auth, and use that as a way to verify the thing is actually
alive.

Note there is also a refactoring in here renaming the variable for
the node.

Change-Id: Ie3c0bc967b0705df6e58bf8ef81b158db8576bf3
Reviewed-on: http://review.couchbase.org/23840
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 39d1a8dfca5f78e0a31bed96da669965833de7e4)
Minor checkstyle fixes.

Change-Id: I0ead0bc582f99ce2b7c39db1ca1124f72d744c4d
Reviewed-on: http://review.couchbase.org/23980
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 821844d72c47812de4823bc9632baf830e835c83)
SPY-110: Update KetamaNodeLocator allNodes on reconfigure.

This changeset updates the KetamaNodeLocator to also change the
allNodes on reconfigure, not only the ketamaNodes. This fixes
an issue where broadcast operations (which rely on the allNodes
collection) were sent to the wrong targets.

Change-Id: I1184ab8f3c564d181d832cad37e63ede2dabc631
Reviewed-on: http://review.couchbase.org/24180
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 5ca6904eb7357dee35ba53444f3cd542a1ed6f75)
SPY-111: Check if the node belongs to cluster before connect.

This changeset makes sure a node belongs to the cluster (by
verifying against the node locator), before trying to (re)-
connect. This helps in situations where a node is scheduled
for shutdown and therfore not part of the cluster, but is
still alive and may be connectable. In this case, it will
result in NPE or AssertionExceptions down the stack.

Change-Id: Ib825b487fcd77c5cb9cf7d50e5b8b3c9c227cab5
Reviewed-on: http://review.couchbase.org/24230
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 65cf4b068456e97306b88dbaaaf1811efaf9d008)
Skipping reconnect when not in cluster anymore.

This changeset skips the reconnect phase when the to be
reconnected node is not part of the cluster anymore. This
information is based on the locator.

Change-Id: I949ec1e78fd6b5fa73851d5461cbf3a70de11027
Reviewed-on: http://review.couchbase.org/24232
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 6e8c47d38c178cf6e3d763c625ed0be08102e246)
Small checkstyle fix.

Change-Id: I3b6e8613489c3d0b3dc969336121dcbb3e178531
Reviewed-on: http://review.couchbase.org/24405
Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 781cb7e18ea72127872dbfbf6881fb6fda9d35fc)
SPY-112: Throw CancellationException when future is cancelled.

This changeset throws the semantically more correct
CancellationException when a operation future is cancelled. Old
code that catches RuntimeExceptions will still work, but it allows
for more flexible catching on the application level.

Change-Id: I476f06e8989f06423be6e186c6565179e270df13
Reviewed-on: http://review.couchbase.org/24654
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com> (cherry-picking from commit 84ebf9ad0d0d8a64497d956f6e75bf74cd7883de)