cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-7119) Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup
Date Wed, 30 Apr 2014 18:22:15 GMT

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

Benedict commented on CASSANDRA-7119:
-------------------------------------

LGTM

* Could use a test case for the timestamp summation (and I don't understand it, so have to
trust you're right on that one)
* Could call !isLive(Long.MIN_VALUE) in cases where we called isMarkedForDelete(Long.MIN_VALUE)
to avoid further System.currentTimeMillis() - or could simply call instanceof DeletedCell.
Or leave it as is.
* I was under the impression we defaulted to explicit imports, not package.* (though I don't
see a spec either way in the codestyle)



> Optimise isLive(System.currentTimeMillis()) + minor Cell cleanup
> ----------------------------------------------------------------
>
>                 Key: CASSANDRA-7119
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7119
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Aleksey Yeschenko
>            Assignee: Aleksey Yeschenko
>            Priority: Minor
>             Fix For: 2.1 beta2
>
>
> There are lots of Cell#isMakredForDeleteAt(System.currentTimeMillis()) and Cell#isLive(System.currentTimeMillis())
calls in the codebase - including in Cell#reconcile(), while we only need to pass the current
time to the ExpiringCell. System.currentTimeMillis() is cheap, but not calling it at all is
cheaper (and it's not *that* cheap when virtualised under certain configs).
> There is also another form - calling isMarkedForDelete() with Long.MIN_VALUE/Long.MAX_VALUE,
when we know we aren't expecting an ExpiringCell, ever.
> So the patch adds an argument-less isLive() method that only calls System.currentTimeMillis()
for ExpiringCell.
> To reduce duplication between Native* and Buffer*, isMarkedForDelete() has been removed
entirely in favor of the shorter-to-type isLive() (plus I never really liked the name anyway).
> Also performs minor clean up and fixes one minor bug:
> - removes the unused Cell#getMarkedForDeleteAt() method
> - removes redundant Override-s in AbstractCell
> - corrects BufferCounterUpdateCell#reconcile() to sum the timestamps and not pick the
max (must have slipped through 6694)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message