cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefania (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11973) Is MemoryUtil.getShort() supposed to return a sign-extended or non-sign-extended value?
Date Wed, 29 Jun 2016 06:13:45 GMT

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

Stefania commented on CASSANDRA-11973:
--------------------------------------

All test failures accounted for; dtests on trunk are currently unstable but this is true on
the unpatched branch as well.

Committed to 2.2. as 38ed06136388be5a9d731b62bfcb0ae4d4e6c458 and merged upwards, thank you
for the patch!

> Is MemoryUtil.getShort() supposed to return a sign-extended or non-sign-extended value?
> ---------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-11973
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11973
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Rei Odaira
>            Assignee: Rei Odaira
>            Priority: Minor
>             Fix For: 2.2.x, 3.0.x, 3.x
>
>         Attachments: 11973-2.2.txt
>
>
> In org.apache.cassandra.utils.memory.MemoryUtil.getShort(), the returned value of unsafe.getShort(address)
is bit-wise-AND'ed with 0xffff, while that of getShortByByte(address) is not. This inconsistency
results in different returned values when the short integer is negative. Which is preferred
behavior? Looking at NativeClustering and NativeCellTest, it seems like non-sign-extension
is assumed.
> By the way, is there any reason MemoryUtil.getShort() and MemoryUtil.getShortByByte()
return "int", not "short"?



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

Mime
View raw message