Retry not my vbucket error for optimized sets. SPY-88

Change-Id: I729781636917f80714cf8d9460e4523e876e1258
Reviewed-on: http://review.couchbase.org/16251
Tested-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Change vbucket retry logging to debug level. SPY-87

Change-Id: I31aa045ff6d328858fa44e53720e38b20b8d38dc
Reviewed-on: http://review.couchbase.org/16257
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Make queueReconnect protected so subclasses can request reconnects.

In fixing JCBC-53 on the Couchbase Java client, a need to queue
reconnections in some cluster configuration updates was found to be
required.  This change allows that.

Change-Id: I25ce3945b4e5e6527dd680031237be22faed69ee
Reviewed-on: http://review.couchbase.org/16335
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Fixed tap message test cases

The flags were wrong here. We were passing a long, but the flag said
it was an int.

Change-Id: I58af8a9899025fc54db4d374bce6ca5d29b309af
Reviewed-on: http://review.couchbase.org/15947
Tested-by: Matt Ingenthron <matt@couchbase.com>
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Create an ErrorCode class for error codes

This allows us to use error codes in other places than just
operations. This class defines all of the Memcached error codes
as well as two client specific codes (timed out and canceled). The
reason for client specific error codes is that is gives the user
something definitive to test against when error cases happen.

Change-Id: I6b4b21ec8448444103d8e73b440df6085bdc1e33
Reviewed-on: http://review.couchbase.org/15948
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
OperationStatus now has an error code

Having error codes will make it easier for users who get errors
to test for what error it is. Right now we only have the message
string and this can actually be different for the same error type.

Change-Id: I067e3145d5d95b09d7ca0ad0445bcfa5d5784d51
Reviewed-on: http://review.couchbase.org/15949
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Make the OperationState volatile.  SPY-88

Change-Id: Id8a871c018a6a6372367129b8924e5a833f83644
Reviewed-on: http://review.couchbase.org/16255
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Add javadoc for OperationFuture.

Change-Id: I9cce09cb58bf8e7ee4afe33f70ec01638b126d85
Reviewed-on: http://review.couchbase.org/16256
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Check if op is null before asserting in OperationFuture

On another note, the change Matt put in that added this causes
two other test failures that I didn't have time to fix. I should
have run make test before pushing his change.

Change-Id: I8bc580f3305191521949a28ce70bca0da8b24d2b
Reviewed-on: http://review.couchbase.org/17026
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
SPY-90: getStats() can return an error

Change-Id: Ida7f9ec4aa101873d464a42db9e5b2b55f2910fa
Reviewed-on: http://review.couchbase.org/17028
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Fixed parsing of delete tap packet

We weren't taking the revid into account

Change-Id: Ice82717ada14c7e85b6191470d7174189f878073
Reviewed-on: http://review.couchbase.org/17640
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
JCBC-52: Fix StringUtils.join()

This function was implemented incorrectly. It was returning
a,b,c,

when it should have been returning
a,b,c

This change fixes this issue.

Change-Id: I822bd3accc2dd2b122b1b44dfe79d8ed36250cf2
Reviewed-on: http://review.couchbase.org/17027
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Comment correction in MemcachedConnection.  Non-javadoc.

Change-Id: Idf5f35739cb286a8e808891a202964ca67e685cf
Reviewed-on: http://review.couchbase.org/17666
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
JCBC-72: Make OperationException extendable

This change is needed for a ViewException object in
Couchbase Client.

Change-Id: I7730bf378e9437d6575d5e9880295a25571d28f6
Reviewed-on: http://review.couchbase.org/18196
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Let offline try to work with already downloaded mvn.

Change-Id: I7d41ef0e1781fc1c1f3b3ca01cf07edf5b3d3639
Reviewed-on: http://review.couchbase.org/17667
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Matt Ingenthron <matt@couchbase.com>
add TAP Opcodes for start/end checkpoint

Change-Id: Ic90fee141df1485ac55e6fdfc5a922f6a158803b
Reviewed-on: http://review.couchbase.org/13570
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Reviewed-by: Marty Schoch <marty.schoch@gmail.com>
Tested-by: Michael Wiederhold <mike@couchbase.com>
Correct test for StringUtils.join().

Change-Id: I9c320db96a1a1587d39696195f44a1d775cdd0a8
Reviewed-on: http://review.couchbase.org/18682
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Reviewed-by: Michael Nitschinger <michael@nitschinger.at>
Tested-by: Matt Ingenthron <matt@couchbase.com>
add support for TAP request/response with checkpoint info

Change-Id: If646c70aaa345f3dd1191257dfcedc1aaacdc7b1
Reviewed-on: http://review.couchbase.org/13571
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: Matt Ingenthron <matt@couchbase.com>
Disable optimization by default, remove assert. SPY-88.

This is only a workaround at the moment for SPY-88, but
it was found that the addition of the assert with a
javadoc change and changing OperationState to volatile
would cause failures in test cases like the
testParallelSetGet() indicating there is a thread
safety issue.

While trying to find the specific cause, it seems the best
approach for now is to disable optimization.

The assert, while correct, is also being disabled since
it seems to trigger issues with getBulk which seems to
call the complete() more frequently than it should.

This combination of changes seems to be a tested, stable
workaround until a proper fix may be implemented.

Change-Id: I755b18aa487247a445657726ae2dc8dad6a27991
Reviewed-on: http://review.couchbase.org/18670
Reviewed-by: Michael Wiederhold <mike@couchbase.com>
Tested-by: Matt Ingenthron <matt@couchbase.com>
Revert ErrorCode and OperationStatus changes.

This is a squashed revert of two separate commits. After
disabling optimization, I still found failing tests. I had
thought it was related at first, but after doing a bisect
it clearly identified the "Create an ErrorCode class" as
the culprit. In combination with the OperationState
correctly being volatile, it would regularly fail in the
midst of bulk operations.

This commit reverts:
"OperationStatus now has an error code"
 commit cdc26cdfaeecc63714c1edcf297d6ffc2c9b8554 and
"Create an ErrorCode class for error codes"
 commit 82ad6cb4629a2c98fdebc55ad10f058cd2767ff9.

Change-Id: Id6e04ed1787e140c5072a78cece682c45fe06313
Reviewed-on: http://review.couchbase.org/18683
Reviewed-by: Raghavan N. Srinivas <raghavan.srinivas@gmail.com>
Tested-by: Raghavan N. Srinivas <raghavan.srinivas@gmail.com>