[代码]solrcloud中 SolrCore 初始化

本文详细介绍了 Solr 的初始化过程,包括监听器设置、索引删除策略、索引初始化、搜索组件配置、更新处理链创建及搜索器初始化等内容。特别关注了 updateProcessChain 的组成部分及其在处理更新请求中的作用。

SolrCore init 

 
 The main procedure list as above.
1. initListeners() : the listeners is defined in the solrconfig.xml. for defaute there are tow seaerch listeners:

<listener event="newSearcher" class="solr.QuerySenderListener">
      <arr name="queries">
        <!--
           <lst><str name="q">solr</str><str name="sort">price asc</str></lst>
           <lst><str name="q">rocks</str><str name="sort">weight asc</str></lst>
          -->
      </arr>
    </listener>
    <listener event="firstSearcher" class="solr.QuerySenderListener">
      <arr name="queries">
        <lst>
          <str name="q">static firstSearcher warming in solrconfig.xml</str>
        </lst>
      </arr>
    </listener>

you can define other event listeners

2. initDeletionPolicy

3. initIndex: here, the indexWriter will be initialized according to the config info

4. searchComponents: init the search component defined in the solrconfig.xml

5. updateProcessChain: new a updateProcessChain. this Chain contain a list of  updateProcessorFactory. the processor chain wouldn't create here. just the Factory initialized. thisProcessorChain is the most importante part in the updateRequest processing. It contain 3 processor now(LogUpdateProcessor, DistributedUpdateProceeor and RunUpdateProcessor).  there will be a detail introduction of  processorChain  in next post.

6. getSearcher: init searcher predefined in the solrconfig.xml

7. create UpdateHandler: this updateHandler is defaute directUpdateHandler2. class directUpdateHandler2 direct process local update request. this class invoked byRunUpdateProcessor

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值