DESCRIPTION

JCBC-726: Make all methods cold and auto-releasable.

Motivation
----------
Using hot subjects with bytebuffers in the responses, while valid,
is just too error prone and can lead to subtle leaks in user level
code.

Modifications
-------------
This changeset wraps all "hot" methods that hold bytebuffers in
responses with a cold one (Observable.defer) and also adds a wraper
that, if someone unsubscribes before the result could be dispatched,
auto releases the buffer (since it is now refcnted).

There is a slight GC impact, but it needs to be correct first, we
can optimize later. Much better to have a little more GC but we
can avoid leaks in nearly all cases.

Result
------
More correct behaviour with observables, also everything is now
"cold" and therefore easier to reason about. In addition, user
retry logic now does not have to defer on their own.

Change-Id: If4ead5b8aadab41e1817187fc8999b6831c34445


COMMENTS

author: Natasha Sullivan
date: 2015-03-11 13:27:28.052000000

Uploaded patch set 2: Commit message was updated.

-------------------------------------
author: Estrella Humphrey
date: 2015-03-12 09:14:15.978000000

Patch Set 2: Code-Review-1

considering migrating this change directly into core's ClusterFacade.send
maybe will need to a (package-protected?) sendHot method that doesn't wrap, especially for things like RequestHandler.scheduleForRetry

-------------------------------------
author: Natasha Sullivan
date: 2015-03-12 13:13:10.424000000

Abandoned

did a new one for core

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