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

ASF subversion and git services commented on SOLR-14652:
--------------------------------------------------------

Commit 5295007022b524160b76a7afc55b76d1eee26541 in lucene-solr's branch 
refs/heads/master from David Smiley
[ https://gitbox.apache.org/repos/asf?p=lucene-solr.git;h=5295007 ]

SOLR-14652: SolrCore should hold its own CoreDescriptor (#1675)

(minor refactoring)
Also:
* SolrCore's constructors don't need a "name" since it's guaranteed to always 
be the name in the coreDescriptor.  I checked.
* SolrCore's constructor shouldn't call 
coreContainer.solrCores.addCoreDescriptor(cd); because it's the container's 
responsibility to manage such things.  I made SolrCores.putCore ensure the 
descriptor is added, and this is called by CoreContainer.registerCore which is 
called after new SolrCore instances are created.
* solrCore.setName should only be called when we expect the name to change.  
Furthermore that shouldn't ever happen in SolrCloud so I added checks.
* solrCore.setName calls coreMetricManager.afterCoreSetName() which is 
something that is really only related to a rename, not name initialization 
(from the constructor).  I renamed that method and further only call it if the 
name did change from non-null.  

> SolrCore should hold its own CoreDescriptor
> -------------------------------------------
>
>                 Key: SOLR-14652
>                 URL: https://issues.apache.org/jira/browse/SOLR-14652
>             Project: Solr
>          Issue Type: Task
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: David Smiley
>            Assignee: David Smiley
>            Priority: Minor
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> SolrCore.getCoreDescriptor() surprisingly must do 
> {{coreContainer.getCoreDescriptor(name)}} instead of simply return a field on 
> itself.  I think it's more sane that a SolrCore hold onto its own descriptor 
> making it unequivocally clear it will get it.  I've seen a transient-core 
> edge case where it didn't, though I don't want to classify this issue as a 
> bug fix over that.
> Also:
>  * SolrCore's constructors don't need a "name" since it's guaranteed to 
> always be the name in the coreDescriptor.  I checked.
>  * SolrCore's constructor shouldn't call 
> {{coreContainer.solrCores.addCoreDescriptor(cd);}} because it's the 
> container's responsibility to manage such things.  I made SolrCores.putCore 
> ensure the descriptor is added, and this is called by 
> CoreContainer.registerCore which is called after new SolrCore instances are 
> created.
>  * solrCore.setName should only be called when we expect the name to change.  
> Furthermore that shouldn't ever happen in SolrCloud so I added checks.
>  * solrCore.setName calls {{coreMetricManager.afterCoreSetName()}} which is 
> something that is really only related to a _rename_, not name initialization 
> (from the constructor).  I renamed that method and further only call it if 
> the name did change from non-null.  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to