cassandra-commits mailing list archives

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


Benedict commented on CASSANDRA-7119:


* 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:
>             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

View raw message