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

Jonathan Ellis commented on CASSANDRA-414:
------------------------------------------

Yeah, it's a little subtle.  The article I linked is a good explanation, the 
javadoc alone isn't sufficient or at least wasn't for me.

A Reference of any type has a get() method that returns the actual referent.  
Here that would be the SSTR.  But ReferenceQueue holds the Reference wrapper, 
not the actual SSTRs.  (When you pass a RQ to the Reference constructor, the 
Reference will be enqueued on that RQ when its referent is GC'd.  The referent 
itself already GC'd or in the process of being GC'd so it can't be put on the 
RQ or you would get back to the Bad Old Days of finalizer resurrection bugs.)

Now, if the referent is no longer live, get() will return null.  Since the 
point of the RQ design is to do cleanup after the object is dead, we subclass 
PhantomReference and store a reference to the path, so we don't actually need 
the SSTR to do the delete.  (In fact for PR in particular get() _always_ 
returns null but that is not really essential to understanding what is going on 
here.)

> remove sstableLock
> ------------------
>
>                 Key: CASSANDRA-414
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-414
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>             Fix For: 0.5
>
>         Attachments: 
> 0001-CASSANDRA-414-combine-addToList-and-storeLocation-ren.txt, 
> 0001-CASSANDRA-414-combine-addToList-and-storeLocation-ren.txt, 
> 0001-CASSANDRA-414-combine-addToList-and-storeLocation-ren.txt, 
> 0002-convert-ssTables_-to-a-Set-since-the-filename-is-enca.txt, 
> 0002-remove-sstableLock.-re-order-a-few-ops-so-that-we-can.txt, 
> 0002-remove-sstableLock.-re-order-a-few-ops-so-that-we-can.txt, 
> 0003-Replace-sstableLock-with-SSTableTracker-which-perform.txt
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to