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

Shai Erera commented on LUCENE-4246:
------------------------------------

{quote}
Shai objected to how verbose this is for "normal" usage, and I agree,
so I proposed adding a sugar mehod "commitAndClose" that would just
call waitForMerges(), commit(), close(). I was hoping to hear from
Shai whether that's an OK compromise...
{quote}

I am ok with commitAndClose. I think it will be valuable for simple apps, not 
to mention our tests. Complex apps can probably add 2-3 more lines of code to 
their "close" logic.

Also, I think that the separation to the different methods give apps more 
control over what happens on close(). I.e. today, app can choose between 
close(true) and close(false), both always commit and optionally wait for 
merges. With the separation, apps could distinguish between "I need to close in 
a hurry" to "I need to close quickly, but commit changes" to "I have time to 
close, so finish merges, commit and close". Maybe we should even give these 
recipes in IW#close or IW class javadocs.
                
> Fix IndexWriter.close() to not commit or wait for pending merges
> ----------------------------------------------------------------
>
>                 Key: LUCENE-4246
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4246
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Robert Muir
>             Fix For: 4.1
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to