cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rajanarayanan Thottuvaikkatumana (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8109) Avoid constant boxing in ColumnStats.{Min/Max}Tracker
Date Wed, 15 Oct 2014 09:43:34 GMT

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

Rajanarayanan Thottuvaikkatumana commented on CASSANDRA-8109:
-------------------------------------------------------------

Sylvain,
Currently these two classes are generics. When I searched the code base, these are instantiated
with Long and Integer classes. I understood the boxing issue that is described in the ticket.
Out of the below cases, can you please identify which change you want to implement?

1) Are you suggesting that these two classes should not be generics at all? If that is the
case, did you mean to change these two classes to have the properties "defaultValue" and "value"
to be declared as long? If that is the case, in MaxTracker/MinTracker "get" method, specifying
whether to return int or long will be tricky depending on the situation and client code will
be affected.

2) Keep the current design as the generic classes as it is. Change the properties "defaultValue"
and "value" to long. In this approach also, the "get" method will have issue to return the
correct data type value. Even in this case the client code will get affected

OR did you mean something else. Please clarify. 

Thanks
-Raj

> Avoid constant boxing in ColumnStats.{Min/Max}Tracker
> -----------------------------------------------------
>
>                 Key: CASSANDRA-8109
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8109
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Sylvain Lebresne
>            Assignee: Rajanarayanan Thottuvaikkatumana
>            Priority: Minor
>              Labels: lhf
>             Fix For: 3.0
>
>
> We use the {{ColumnStats.MinTracker}} and {{ColumnStats.MaxTracker}} to track timestamps
and deletion times in sstable. Those classes are generics but we really ever use them for
longs and integers. The consequence is that every call to their {{update}} method (called
for every cell during sstable write) box it's argument (since we don't store the cell timestamps
and deletion time boxed). That feels like a waste that is easy to fix: we could just make
those work on longs only for instance and convert back to int at the end when that's what
we need.



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

Mime
View raw message