DESCRIPTION

JCBC-591 : if bucket was closed, operations will throw a BucketClosedException

Motivation
-----------
When calling close() on a Bucket, one expects not to be able to use the bucket
operations anymore. However the bucket doesn't fail gracefully and instead
attempt to perform the operation, which results in a TimeoutException from the
underlying AsyncBucket after a delay.

Modifications
-------------
The CouchbaseAsyncBucket has been refactored. When close() operation is performed,
an internal flag is set, which can be seen through isClosed() method.

Operations that previously sent a request to the core now go through a
checkedSend method that will check the closed status. If closed, it will return
an Observable that just fails immediately with a BucketClosedException instead
of forwarding the request to the core.

Users can be impacted if they were watching for TimeoutExceptions specifically
to detect a closed bucket.

Result
------
Blocking operations on a closed bucket immediately throw a BucketClosedException.
Async operation call the subscriber's onError method with BucketClosedException.

Change-Id: Ia6de60a882ef6d81cc807a7205bb1c1002e7df42


COMMENTS

author: Estrella Humphrey
date: 2014-10-16 08:48:19.256000000

Uploaded patch set 3.

-------------------------------------
author: Estrella Humphrey
date: 2014-10-16 08:53:37.663000000

Patch Set 3: Verified+1

(1 comment)

Line:25, src/integration/java/com/couchbase/client/java/util/ClusterDependentTest.java -> sorry about the unnecessary organize import :/

-------------------------------------
author: Cory Peck
date: 2014-10-16 09:33:09.873000000

Patch Set 3: Code-Review+2

-------------------------------------
author: Estrella Humphrey
date: 2014-10-16 14:08:32.153000000

Abandoned

superseded by http://review.couchbase.org/42202 and http://review.couchbase.org/42203

-------------------------------------
