lucene 記憶體索引儲存每個field裡內容的相關代碼

來源:互聯網
上載者:User

標籤:Lucene   os   ar   sp   檔案   資料   div   2014   on   

相關的類調用關係DocumentsWriterPerThread ——>DocFieldProcessor DocumentsWriterPerThread裡的consumer對象(類型是DocFieldProcessor)負責field的內資料的儲存 1 consumer.processDocument(fieldInfos);   在儲存field內容這方面只是簡單的把docid,field和fieldinfo放入子成員storedConsumer裡 2  consumer.finishDocument();
    會取出要儲存域裡的資料,放入 bufferedDocs子物件(連續的塊記憶體,CompressingStoredFieldsWriter的子成員)裡面,在flush disk的時候在把bufferedDocs內的資料寫入磁碟 ==================================================DocFieldProcessor 負責 .fdt .fdx .tvd .tvx四個檔案的資料寫入 1 DocFieldProcessor調用TwoStoredFieldsConsumers類的flush方法寫fdt .fdx 檔案 storedConsumer.addField(docState.docID, field, fp.fieldInfo);//storedConsumer把儲存的docid,field和info資料存放區到自己的類裡面 storedConsumer.flush(state); 負責.fdt .fdx 檔案 2DocFieldProcessor調用DocInverter類的flush方法寫tvd和tvx檔案consumer.flush(childFields, state);負責.tvd .tvx 檔案 ===================================================================DocumentsWriterPerThread  /** Flush all pending docs to a new segment */lucene最重要的flush函數,該函數執行完成以後 所有資料都重新整理到磁碟,且產生的臨時檔案是最多的
FlushedSegment flush()  產生的檔案如下 -rw-r--r-- 1 bf bf 358 2014-07-11 14:53 _0.cfe
-rw-r--r-- 1 bf bf 958 2014-07-11 14:53 _0.cfs
-rw-r--r-- 1 bf bf 72 2014-07-11 14:53 _0.fdt
-rw-r--r-- 1 bf bf 62 2014-07-11 14:53 _0.fdx
-rw-r--r-- 1 bf bf 138 2014-07-11 14:53 _0.fnm
-rw-r--r-- 1 bf bf 83 2014-07-11 14:53 _0_Lucene41_0.doc
-rw-r--r-- 1 bf bf 50 2014-07-11 14:53 _0_Lucene41_0.pay
-rw-r--r-- 1 bf bf 63 2014-07-11 14:53 _0_Lucene41_0.pos
-rw-r--r-- 1 bf bf 116 2014-07-11 14:53 _0_Lucene41_0.tim
-rw-r--r-- 1 bf bf 81 2014-07-11 14:53 _0_Lucene41_0.tip
-rw-r--r-- 1 bf bf 43 2014-07-11 14:53 _0.nvd
-rw-r--r-- 1 bf bf 62 2014-07-11 14:53 _0.nvm
-rw-r--r-- 1 bf bf 288 2014-07-11 14:53 _0.si
-rw-r--r-- 1 bf bf 79 2014-07-11 14:53 _0.tvd
-rw-r--r-- 1 bf bf 62 2014-07-11 14:53 _0.tvx
-rw-r--r-- 1 bf bf 0 2014-07-11 14:48 write.lock 

lucene 記憶體索引儲存每個field裡內容的相關代碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.