4 messages in org.apache.lucene.java-userIndexDeletionPolicy and IndexCommitPoint
FromSent OnAttachments
Tim BrennanFeb 21, 2008 7:54 am 
Michael McCandlessFeb 21, 2008 9:24 am 
Yonik SeeleyJun 7, 2008 8:08 am 
Michael McCandlessJun 7, 2008 12:21 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:IndexDeletionPolicy and IndexCommitPointActions
From:Tim Brennan (ti@zimbra.com)
Date:Feb 21, 2008 7:54:36 am
List:org.apache.lucene.java-user

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