lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Deleting first IndexCommit
Date Thu, 03 Jul 2008 15:43:43 GMT

Jason Rutherglen wrote:

> It's for recovery, a commit to an index may have occurred but other  
> commits as part of a global commit failed, so it's for rollback in  
> the event of failure.

Ahh got it.

> Are you saying the delete does not immediately happen when  
> IndexCommit.delete is called using IndexDeletionPolicy?

Well ... it happens nearly immediately.  When you call that delete()  
method it merely records that fact that you want to delete that  
commit.  Then when you return from onInit/onCommit, IndexFileDeleter  
walks through the commits you had deleted, decRef's all files  
referenced by each commit, deleting any file that hits refCount 0.

> I don't mind using IndexWriter, I am just looking for a more  
> straightforward API for managing the index generations than using a  
> callback class like IndexDeletionPolicy.

I agree we could push for a more straightforward API here over time,  
but I think it's not as high priority as the other stuff we're working  
through.  Or at least I'm feeling very busy!!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message