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

Benedict commented on CASSANDRA-8707:
-------------------------------------

I was playing with another small refactor to the ref counting code, and somehow 
managed to butcher my git history so that I overrode my backup copy with the 
new version as well (still not sure what I did), and uploaded it. The upshot is 
there's an extra refactor in there. I can attempt to rollback the change if you 
prefer, but it isn't too drastic and I think makes the API cleaner.

Essentially, I remerged RefCountedImpl with Ref, but in the opposite way. Now 
you just create a Ref object, which sorts out creating all of the background 
gubbins. The Ref object both manages a single reference and the creation of new 
references. This simplifies some of the new helper classes I've created, and I 
think creates a lower cognitive burden on the user of the API. The biggest 
upshot is there is no concept of a sharedRef(); the first Ref you create you 
can simply stash somewhere (which we do in SSTableReader). I think this is 
cleaner, as it's not always necessary to have a "sharedRef". 

Let me know what you think. I've done my best to keep all of the changes into 
relatively small easily digested commits, so hopefully the review burden won't 
be too problematic. But we can rework it if necessary.

> Move SegmentedFile, IndexSummary and BloomFilter to utilising RefCounted
> ------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8707
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8707
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Benedict
>            Assignee: Benedict
>             Fix For: 2.1.3
>
>
> There are still a few bugs with resource management, especially around 
> SSTableReader cleanup, esp. when intermixing with compaction. This migration 
> should help. We can simultaneously "simplify" the logic in SSTableReader to 
> not track the replacement chain, only to take a new reference to each of the 
> underlying resources.



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

Reply via email to