lucene indexingChain

lucene的indexingChain的生成,主要涉及兩個類LiveIndexWriterConfig和DocumentsWriter. LiveIndexWriterConfig中得到indexingChain和indexerThreadPool, 而後在生成DocumentsWriter時初始化indexerThreadPool, 在初始化時會生成DocumentsWriterPerThread和ThreadState的一一對應關係,在生成DocumentsWriterPerThread時,會調用IndexingChain的getChain方法。這樣每一個DocumentsWriterPerThread就得到了本身的indexingChain.這樣在調用dwpt的updateDocument方法時就會逐一調用indexingChain中的consumer.
相關文章
相關標籤/搜索