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

Shai Erera commented on LUCENE-3454:
------------------------------------

So now we ended up with mergeIfNeeded and maybeMerge()? At the start of this 
issue, it looks like we agreed to consolidate all methods under a single 
maybeMerge(). Mike suggested to have two variants of this, one that doesn't 
take maxNumSegments and one that does ... I'm fine with that too, as long as we 
have a single name.

I also agree with Mark, all these maybe's/ifNeeded (IR has these now too !) 
should be part of the Javadocs, not the method names. For instance, 
IW.rollback() closes the IndexWriter, but the method is not called 
rollbackAndClose. IMO, that is even more confusing than the IfNeeded versions, 
because I do not anticipate the instance to be closed just because I 
rolled-back changes.

IndexReader.openIfNeeded in fact does reopen() (the old version), but it's not 
called reopenIfNeeded. So we force the users to read the javadocs in order to 
understand that openIfNeeded reuses the unchanged segments from the given 
IndexReader and only opens the new ones ...

Names are hard, and I think we should opt for simple and intuitive ones. 
Javadocs should be used to clarify what the method does in more details. I 
personally was never confused by optimize(), so I don't mind if it's kept. But 
apparently others were confused by it (have no idea why) ...

I don't mind maybeMerge() (perhaps because it's not a new API), but if we want 
to remove the maybe-ness, let's call it something like invokeMergePolicy() 
(with and without maxNumSegments)? We can replace invoke by some other verb, 
maybe consultMP / runMerges ...?
                
> rename optimize to a less cool-sounding name
> --------------------------------------------
>
>                 Key: LUCENE-3454
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3454
>             Project: Lucene - Java
>          Issue Type: Improvement
>    Affects Versions: 3.4, 4.0
>            Reporter: Robert Muir
>            Assignee: Michael McCandless
>         Attachments: LUCENE-3454.patch
>
>
> I think users see the name optimize and feel they must do this, because who 
> wants a suboptimal system? but this probably just results in wasted time and 
> resources.
> maybe rename to collapseSegments or something?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to