lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-916) CoreContainer :: register(String, SolrCore, boolean) documentation clarification about returnPrev argument
Date Tue, 28 Apr 2009 13:04:31 GMT

    [ https://issues.apache.org/jira/browse/SOLR-916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12703631#action_12703631
] 

Mark Miller commented on SOLR-916:
----------------------------------

I could go either way. The name change certainly makes some sense, but even as is, a core
that is returned closed is not very useful. Null could just as well be returned. But when
you ask to returnPrev, a working open core is guaranteed to be returned if a previous one
existed. I wouldnt feel so bad leaving it as it is - your change almost seems to strengthen
the contract - you have to return the closed core as well. Neither side is a very strong argument
to me and I could go either way.

> CoreContainer :: register(String, SolrCore, boolean)  documentation clarification about
returnPrev argument
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-916
>                 URL: https://issues.apache.org/jira/browse/SOLR-916
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 1.3
>         Environment: Tomcat 6, JRE 6 
>            Reporter: Kay Kay
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: SOLR-916.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> In CoreContainer.java :: register(name, core, returnPrev) - the documentation says 
>   it would return a previous core having the same name if it existed *and returnPrev
= true*.
>   * @return a previous core having the same name if it existed and returnPrev==true
>   */
>  public SolrCore register(String name, SolrCore core, boolean returnPrev) ..
> But as per the code towards the end - the previous core is returned anyway, irrespective
of the value of returnPrev. The difference, though, seems to be that when returnPrev is false,
the previous core (of the same name, if exists) is closed.
> Which one of them is correct . If the code were correct , would the variable be better
renamed as closePrevious , as opposed to returnPrevious.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message