I think we more or less have that rule today.

the problem with coprocessors is that you only have a pre and post.
assuming you hold a reference on the pre to then use it on the post,
if you get a failure in the mid of an operation (after the pre) the post is
no longer called.
so.. what happens you hold the reference forever? or you have strange
timeout logic to cleanup?

I'm +1 to make it explicit to not hold references.
(but this is probably a general rule, rather than just cell specific)

Matteo


On Thu, Feb 18, 2016 at 11:09 AM, Stack <st...@duboce.net> wrote:

> In HBase 2.0, CPs can read Cells passed them on a CP hook invocation but
> they must not retain references beyond the life of the invocation; they
> must copy Cells if they intend to retain them beyond the invocation, pass
> the Cells off to upper tiers, or return them otherwise to clients.
>
> The above stricture is explicitly put on CPs going forward as it can no
> longer be presumed Cells are self-contained. In particular, Cells may not
> 'own' their memory but rather just referencing a backing, memory block.
> Internal reference-counting to which CPs cannot be made privvy determines
> when it is safe to let go of the backing memory. If a CP retains Cell
> references beyond an invocation, it may find that a later read returns
> unexpected results.
>
> For obvious reasons, HBase cannot pass CPs Cell copies on each invocation.
>
> Are you all good with this?
>
> If so, we'll add the above to Interfaces and message it to downstreamers,
> etc.
>
> Thanks,
> Anoop, Ram, and St.Ack
>

Reply via email to