When implementing a custom IndexDeletionPolicy, is it sufficient to just use 
the segments filename (returned by IndexCommitPoint.getSegmentsFilename()) to 
compare CommitPoints to see if they are equal?

I've looked at the code in SnapshotDeletionPolicy and it works by keeping a 
pointer to the snapshot IndexCommitPoint and comparing that against the listed 
commit points in onCommit.  This strategy doesn't seem to work if the 
IndexWriter is closed and re-opened: you get all new CommitPoint instances from 
the new Writer even if they refer to the same logical commit, and furthermore 
holding onto IndexCommitPoint references across generations of IndexWriters 
will cause significant memory pressure (an IndexCommitPoint is an instance of 
the *non-static* inner class IndexFileDeleter$CommitPoint so it points to the 
IndexFileDeleter which points to the DocumentsWriter which points to the 
Posting[] array.....so holding onto a commit point effectively keeps the 
Posting[] array around)

Am I going completely wrong here, trying to IndexDeletionPolicy across Writer 
generations?  

--tim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to