Lucene++ - a full-featured, c++ search engine
API Documentation

DocFieldProcessorPerThread.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6
7 #ifndef DOCFIELDPROCESSORPERTHREAD_H
8 #define DOCFIELDPROCESSORPERTHREAD_H
9
10 #include "DocConsumerPerThread.h"
11 #include "DocumentsWriter.h"
12
13 namespace Lucene {
14
19 class DocFieldProcessorPerThread : public DocConsumerPerThread {
20 public:
21 DocFieldProcessorPerThread(const DocumentsWriterThreadStatePtr& threadState, const DocFieldProcessorPtr& docFieldProcessor);
22 virtual ~DocFieldProcessorPerThread();
23
24 LUCENE_CLASS(DocFieldProcessorPerThread);
25
26 public:
27 double docBoost;
28 int32_t fieldGen;
29 DocFieldProcessorWeakPtr _docFieldProcessor;
30 FieldInfosPtr fieldInfos;
31 DocFieldConsumerPerThreadPtr consumer;
32 Collection<DocFieldProcessorPerFieldPtr> _fields; // Holds all fields seen in current doc
33 int32_t fieldCount;
34
35 Collection<DocFieldProcessorPerFieldPtr> fieldHash; // Hash table for all fields ever seen
36 int32_t hashMask;
37 int32_t totalFieldCount;
38
39 StoredFieldsWriterPerThreadPtr fieldsWriter;
40 DocStatePtr docState;
41
42 Collection<DocFieldProcessorPerThreadPerDocPtr> docFreeList;
43 int32_t freeCount;
44 int32_t allocCount;
45
46 public:
47 virtual void initialize();
48 virtual void abort();
49 Collection<DocFieldConsumerPerFieldPtr> fields();
50
51 // If there are fields we've seen but did not see again in the last run, then free them up.
52 void trimFields(const SegmentWriteStatePtr& state);
53
54 virtual DocWriterPtr processDocument();
55
56 DocFieldProcessorPerThreadPerDocPtr getPerDoc();
57 void freePerDoc(const DocFieldProcessorPerThreadPerDocPtr& perDoc);
58
59 protected:
60 void rehash();
61 };
62
63 class DocFieldProcessorPerThreadPerDoc : public DocWriter {
64 public:
65 DocFieldProcessorPerThreadPerDoc(const DocFieldProcessorPerThreadPtr& docProcessor);
66 virtual ~DocFieldProcessorPerThreadPerDoc();
67
68 LUCENE_CLASS(DocFieldProcessorPerThreadPerDoc);
69
70 public:
71 DocWriterPtr one;
72 DocWriterPtr two;
73
74 protected:
75 DocFieldProcessorPerThreadWeakPtr _docProcessor;
76
77 public:
78 virtual int64_t sizeInBytes();
79 virtual void finish();
80 virtual void abort();
81 };
82
83 }
84
85 #endif
DocConsumerPerThread.h
DocumentsWriter.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::Collection< DocFieldProcessorPerFieldPtr >
Lucene::DocConsumerPerThread
Definition: DocConsumerPerThread.h:14
Lucene::DocFieldProcessorPerThreadPerDoc
Definition: DocFieldProcessorPerThread.h:63
Lucene::DocFieldProcessorPerThreadPerDoc::finish
virtual void finish()
Lucene::DocFieldProcessorPerThreadPerDoc::~DocFieldProcessorPerThreadPerDoc
virtual ~DocFieldProcessorPerThreadPerDoc()
Lucene::DocFieldProcessorPerThreadPerDoc::_docProcessor
DocFieldProcessorPerThreadWeakPtr _docProcessor
Definition: DocFieldProcessorPerThread.h:75
Lucene::DocFieldProcessorPerThreadPerDoc::abort
virtual void abort()
Lucene::DocFieldProcessorPerThreadPerDoc::two
DocWriterPtr two
Definition: DocFieldProcessorPerThread.h:72
Lucene::DocFieldProcessorPerThreadPerDoc::DocFieldProcessorPerThreadPerDoc
DocFieldProcessorPerThreadPerDoc(const DocFieldProcessorPerThreadPtr &docProcessor)
Lucene::DocFieldProcessorPerThreadPerDoc::one
DocWriterPtr one
Definition: DocFieldProcessorPerThread.h:68
Lucene::DocFieldProcessorPerThreadPerDoc::sizeInBytes
virtual int64_t sizeInBytes()
Lucene::DocFieldProcessorPerThread
Gathers all Fieldables for a document under the same name, updates FieldInfos, and calls per-field co...
Definition: DocFieldProcessorPerThread.h:19
Lucene::DocFieldProcessorPerThread::consumer
DocFieldConsumerPerThreadPtr consumer
Definition: DocFieldProcessorPerThread.h:31
Lucene::DocFieldProcessorPerThread::docBoost
double docBoost
Definition: DocFieldProcessorPerThread.h:24
Lucene::DocFieldProcessorPerThread::fieldInfos
FieldInfosPtr fieldInfos
Definition: DocFieldProcessorPerThread.h:30
Lucene::DocFieldProcessorPerThread::docState
DocStatePtr docState
Definition: DocFieldProcessorPerThread.h:40
Lucene::DocFieldProcessorPerThread::freeCount
int32_t freeCount
Definition: DocFieldProcessorPerThread.h:43
Lucene::DocFieldProcessorPerThread::processDocument
virtual DocWriterPtr processDocument()
Process the document. If there is something for this document to be done in docID order,...
Lucene::DocFieldProcessorPerThread::totalFieldCount
int32_t totalFieldCount
Definition: DocFieldProcessorPerThread.h:37
Lucene::DocFieldProcessorPerThread::DocFieldProcessorPerThread
DocFieldProcessorPerThread(const DocumentsWriterThreadStatePtr &threadState, const DocFieldProcessorPtr &docFieldProcessor)
Lucene::DocFieldProcessorPerThread::initialize
virtual void initialize()
Called directly after instantiation to create objects that depend on this object being fully construc...
Lucene::DocFieldProcessorPerThread::_docFieldProcessor
DocFieldProcessorWeakPtr _docFieldProcessor
Definition: DocFieldProcessorPerThread.h:29
Lucene::DocFieldProcessorPerThread::fieldHash
Collection< DocFieldProcessorPerFieldPtr > fieldHash
Definition: DocFieldProcessorPerThread.h:35
Lucene::DocFieldProcessorPerThread::hashMask
int32_t hashMask
Definition: DocFieldProcessorPerThread.h:36
Lucene::DocFieldProcessorPerThread::_fields
Collection< DocFieldProcessorPerFieldPtr > _fields
Definition: DocFieldProcessorPerThread.h:32
Lucene::DocFieldProcessorPerThread::allocCount
int32_t allocCount
Definition: DocFieldProcessorPerThread.h:44
Lucene::DocFieldProcessorPerThread::fieldGen
int32_t fieldGen
Definition: DocFieldProcessorPerThread.h:28
Lucene::DocFieldProcessorPerThread::fieldCount
int32_t fieldCount
Definition: DocFieldProcessorPerThread.h:33
Lucene::DocFieldProcessorPerThread::trimFields
void trimFields(const SegmentWriteStatePtr &state)
Lucene::DocFieldProcessorPerThread::abort
virtual void abort()
Lucene::DocFieldProcessorPerThread::rehash
void rehash()
Lucene::DocFieldProcessorPerThread::getPerDoc
DocFieldProcessorPerThreadPerDocPtr getPerDoc()
Lucene::DocFieldProcessorPerThread::docFreeList
Collection< DocFieldProcessorPerThreadPerDocPtr > docFreeList
Definition: DocFieldProcessorPerThread.h:42
Lucene::DocFieldProcessorPerThread::fields
Collection< DocFieldConsumerPerFieldPtr > fields()
Lucene::DocFieldProcessorPerThread::~DocFieldProcessorPerThread
virtual ~DocFieldProcessorPerThread()
Lucene::DocFieldProcessorPerThread::fieldsWriter
StoredFieldsWriterPerThreadPtr fieldsWriter
Definition: DocFieldProcessorPerThread.h:39
Lucene::DocFieldProcessorPerThread::freePerDoc
void freePerDoc(const DocFieldProcessorPerThreadPerDocPtr &perDoc)
Lucene::DocWriter
Consumer returns this on each doc. This holds any state that must be flushed synchronized "in docID o...
Definition: DocumentsWriter.h:402
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::DocFieldProcessorPerThreadWeakPtr
boost::weak_ptr< DocFieldProcessorPerThread > DocFieldProcessorPerThreadWeakPtr
Definition: LuceneTypes.h:117
Lucene::DocStatePtr
boost::shared_ptr< DocState > DocStatePtr
Definition: LuceneTypes.h:122
Lucene::StoredFieldsWriterPerThreadPtr
boost::shared_ptr< StoredFieldsWriterPerThread > StoredFieldsWriterPerThreadPtr
Definition: LuceneTypes.h:232
Lucene::FieldInfosPtr
boost::shared_ptr< FieldInfos > FieldInfosPtr
Definition: LuceneTypes.h:127
Lucene::DocFieldProcessorPtr
boost::shared_ptr< DocFieldProcessor > DocFieldProcessorPtr
Definition: LuceneTypes.h:115
Lucene::SegmentWriteStatePtr
boost::shared_ptr< SegmentWriteState > SegmentWriteStatePtr
Definition: LuceneTypes.h:222
Lucene::DocFieldProcessorPerThreadPerDocPtr
boost::shared_ptr< DocFieldProcessorPerThreadPerDoc > DocFieldProcessorPerThreadPerDocPtr
Definition: LuceneTypes.h:118
Lucene::DocFieldConsumerPerThreadPtr
boost::shared_ptr< DocFieldConsumerPerThread > DocFieldConsumerPerThreadPtr
Definition: LuceneTypes.h:110
Lucene::DocWriterPtr
boost::shared_ptr< DocWriter > DocWriterPtr
Definition: LuceneTypes.h:125
Lucene::DocumentsWriterThreadStatePtr
boost::shared_ptr< DocumentsWriterThreadState > DocumentsWriterThreadStatePtr
Definition: LuceneTypes.h:124
Lucene::DocFieldProcessorPerThreadPtr
boost::shared_ptr< DocFieldProcessorPerThread > DocFieldProcessorPerThreadPtr
Definition: LuceneTypes.h:117
Lucene::DocFieldProcessorWeakPtr
boost::weak_ptr< DocFieldProcessor > DocFieldProcessorWeakPtr
Definition: LuceneTypes.h:115

clucene.sourceforge.net