[ 
https://issues.apache.org/jira/browse/CASSANDRA-8793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14347554#comment-14347554
 ] 

Ariel Weisberg commented on CASSANDRA-8793:
-------------------------------------------

* SafeMemoryWriter.withByteOrder should be setByteOrder? I thought that "with" 
implied that the original instance isn't changed and you get a new version, but 
maybe I have the idiom wrong.
* SafeMemoryWriter doesn't have a lot of @Override annotations. 
* Implementing DataOutput, but outputting little endian breaks the contract of 
the interface (or is it superclass) which is yikes. Guessing this isn't new to 
this change.
* Memory.setShort invokes setBounds with the wrong second argument, it is 
checking for four bytes not two. Another argument for boring unit tests that 
check these boundary conditions.
* withByte order was added even though it was already little endian or was the 
previous code emitting the wrong byte order? Does that imply a test should have 
caught it the change between versions of the code?
* Comments are easy to follow now (or maybe I just know what they are saying 
already)
* Bounds checking is done twice, once for ensure capacity, once for writing to 
the buffer. If you could consolidate those say by calling a subclass method on 
a failed bounds check that provides the policy then it would only have to emit 
instructions for the check once?

> Avoid memory allocation when searching index summary
> ----------------------------------------------------
>
>                 Key: CASSANDRA-8793
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8793
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Benedict
>            Priority: Minor
>             Fix For: 3.0
>
>
> Currently we build a byte[] for each comparison, when we could just fill the 
> details into a DirectByteBuffer



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to