cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-12381) Verify use of ByteBuffer.hasArray() in whole code base
Date Thu, 04 Aug 2016 15:16:20 GMT


Sylvain Lebresne commented on CASSANDRA-12381:

bq. Netty had an issue with arrays and direct buffers recently

Cares about sharing the issue? I'm genuinely curious to start with.

But also, I don't doubt that direct ByteBuffer *can* have a backing array. The javadoc is
clear about this. What's less clear to me is that the javadoc seems to suggest to me that
*even* if a direct buffer has a backing array, then it sounds like accessing that backing
array, provided you use {{arrayOffset()}}, should be fine.

> Verify use of ByteBuffer.hasArray() in whole code base
> ------------------------------------------------------
>                 Key: CASSANDRA-12381
>                 URL:
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Robert Stupp
>            Assignee: Robert Stupp
>            Priority: Minor
>             Fix For: 3.0.x
> As [noted here|],
a direct {{ByteBuffer}} can have a backing array.
> If a direct {{ByteBuffer}} has a backing array, we should not make any assumption on
how it is actually used.
> This ticket is about to check whether uses of {{ByteBuffer.hasArray()}} need to be replaced
with {{ByteBuffer.isDirect()}}.
> (With CASSANDRA-11870 however, there is no way that such a direct {{ByteBuffer}} has
a backing array.)

This message was sent by Atlassian JIRA

View raw message