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

StoredFieldsWriter.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 STOREDFIELDSWRITER_H
8 #define STOREDFIELDSWRITER_H
9
10 #include "DocumentsWriter.h"
11
12 namespace Lucene {
13
15 class StoredFieldsWriter : public LuceneObject {
16 public:
17 StoredFieldsWriter(const DocumentsWriterPtr& docWriter, const FieldInfosPtr& fieldInfos);
18 virtual ~StoredFieldsWriter();
19
20 LUCENE_CLASS(StoredFieldsWriter);
21
22 public:
23 FieldsWriterPtr fieldsWriter;
24 DocumentsWriterWeakPtr _docWriter;
25 FieldInfosPtr fieldInfos;
26 int32_t lastDocID;
27
28 Collection<StoredFieldsWriterPerDocPtr> docFreeList;
29 int32_t freeCount;
30 int32_t allocCount;
31
32 public:
33 StoredFieldsWriterPerThreadPtr addThread(const DocStatePtr& docState);
34 void flush(const SegmentWriteStatePtr& state);
35 void closeDocStore(const SegmentWriteStatePtr& state);
36 StoredFieldsWriterPerDocPtr getPerDoc();
37 void abort();
38
40 void fill(int32_t docID);
41
42 void finishDocument(const StoredFieldsWriterPerDocPtr& perDoc);
43 bool freeRAM();
44 void free(const StoredFieldsWriterPerDocPtr& perDoc);
45
46 protected:
47 void initFieldsWriter();
48 };
49
50 class StoredFieldsWriterPerDoc : public DocWriter {
51 public:
52 StoredFieldsWriterPerDoc(const StoredFieldsWriterPtr& fieldsWriter);
53 virtual ~StoredFieldsWriterPerDoc();
54
55 LUCENE_CLASS(StoredFieldsWriterPerDoc);
56
57 protected:
58 StoredFieldsWriterWeakPtr _fieldsWriter;
59
60 public:
61 PerDocBufferPtr buffer;
62 RAMOutputStreamPtr fdt;
63 int32_t numStoredFields;
64
65 public:
66 void reset();
67 virtual void abort();
68 virtual int64_t sizeInBytes();
69 virtual void finish();
70 };
71
72 }
73
74 #endif
Lucene::StoredFieldsWriterPerDoc::buffer
PerDocBufferPtr buffer
Definition: StoredFieldsWriter.h:61
Lucene::StoredFieldsWriterPerDoc::reset
void reset()
Lucene::StoredFieldsWriterPtr
boost::shared_ptr< StoredFieldsWriter > StoredFieldsWriterPtr
Definition: LuceneTypes.h:230
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
Lucene::DocumentsWriterWeakPtr
boost::weak_ptr< DocumentsWriter > DocumentsWriterWeakPtr
Definition: LuceneTypes.h:123
Lucene::PerDocBufferPtr
boost::shared_ptr< PerDocBuffer > PerDocBufferPtr
Definition: LuceneTypes.h:199
Lucene::Collection< StoredFieldsWriterPerDocPtr >
Lucene::RAMOutputStreamPtr
boost::shared_ptr< RAMOutputStream > RAMOutputStreamPtr
Definition: LuceneTypes.h:508
Lucene::StoredFieldsWriterPerDoc::sizeInBytes
virtual int64_t sizeInBytes()
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::StoredFieldsWriter::closeDocStore
void closeDocStore(const SegmentWriteStatePtr &state)
Lucene::DocumentsWriterPtr
boost::shared_ptr< DocumentsWriter > DocumentsWriterPtr
Definition: LuceneTypes.h:123
Lucene::FieldInfosPtr
boost::shared_ptr< FieldInfos > FieldInfosPtr
Definition: LuceneTypes.h:127
Lucene::StoredFieldsWriter::flush
void flush(const SegmentWriteStatePtr &state)
Lucene::StoredFieldsWriterPerDoc::~StoredFieldsWriterPerDoc
virtual ~StoredFieldsWriterPerDoc()
Lucene::SegmentWriteStatePtr
boost::shared_ptr< SegmentWriteState > SegmentWriteStatePtr
Definition: LuceneTypes.h:222
Lucene::StoredFieldsWriter::freeCount
int32_t freeCount
Definition: StoredFieldsWriter.h:29
Lucene::StoredFieldsWriter::addThread
StoredFieldsWriterPerThreadPtr addThread(const DocStatePtr &docState)
Lucene::StoredFieldsWriterPerDoc::abort
virtual void abort()
Lucene::StoredFieldsWriter::getPerDoc
StoredFieldsWriterPerDocPtr getPerDoc()
Lucene::StoredFieldsWriter::_docWriter
DocumentsWriterWeakPtr _docWriter
Definition: StoredFieldsWriter.h:24
Lucene::StoredFieldsWriter::abort
void abort()
Lucene
Definition: AbstractAllTermDocs.h:12
Lucene::FieldsWriterPtr
boost::shared_ptr< FieldsWriter > FieldsWriterPtr
Definition: LuceneTypes.h:133
Lucene::LuceneObject
Base class for all Lucene classes.
Definition: LuceneObject.h:31
Lucene::StoredFieldsWriter::fieldsWriter
FieldsWriterPtr fieldsWriter
Definition: StoredFieldsWriter.h:20
Lucene::StoredFieldsWriter::fieldInfos
FieldInfosPtr fieldInfos
Definition: StoredFieldsWriter.h:25
Lucene::StoredFieldsWriterPerDocPtr
boost::shared_ptr< StoredFieldsWriterPerDoc > StoredFieldsWriterPerDocPtr
Definition: LuceneTypes.h:231
Lucene::StoredFieldsWriterPerThreadPtr
boost::shared_ptr< StoredFieldsWriterPerThread > StoredFieldsWriterPerThreadPtr
Definition: LuceneTypes.h:232
DocumentsWriter.h
Lucene::StoredFieldsWriter::allocCount
int32_t allocCount
Definition: StoredFieldsWriter.h:30
Lucene::StoredFieldsWriterPerDoc
Definition: StoredFieldsWriter.h:50
Lucene::StoredFieldsWriter::fill
void fill(int32_t docID)
Fills in any hole in the docIDs.
Lucene::StoredFieldsWriter::freeRAM
bool freeRAM()
Lucene::StoredFieldsWriter::initFieldsWriter
void initFieldsWriter()
Lucene::StoredFieldsWriterWeakPtr
boost::weak_ptr< StoredFieldsWriter > StoredFieldsWriterWeakPtr
Definition: LuceneTypes.h:230
Lucene::StoredFieldsWriter::lastDocID
int32_t lastDocID
Definition: StoredFieldsWriter.h:26
Lucene::StoredFieldsWriter
This is a DocFieldConsumer that writes stored fields.
Definition: StoredFieldsWriter.h:15
Lucene::StoredFieldsWriterPerDoc::numStoredFields
int32_t numStoredFields
Definition: StoredFieldsWriter.h:63
Lucene::DocStatePtr
boost::shared_ptr< DocState > DocStatePtr
Definition: LuceneTypes.h:122
Lucene::StoredFieldsWriter::StoredFieldsWriter
StoredFieldsWriter(const DocumentsWriterPtr &docWriter, const FieldInfosPtr &fieldInfos)
Lucene::StoredFieldsWriterPerDoc::_fieldsWriter
StoredFieldsWriterWeakPtr _fieldsWriter
Definition: StoredFieldsWriter.h:55
Lucene::StoredFieldsWriterPerDoc::fdt
RAMOutputStreamPtr fdt
Definition: StoredFieldsWriter.h:62
Lucene::StoredFieldsWriterPerDoc::StoredFieldsWriterPerDoc
StoredFieldsWriterPerDoc(const StoredFieldsWriterPtr &fieldsWriter)
Lucene::StoredFieldsWriterPerDoc::finish
virtual void finish()
Lucene::StoredFieldsWriter::free
void free(const StoredFieldsWriterPerDocPtr &perDoc)
Lucene::StoredFieldsWriter::~StoredFieldsWriter
virtual ~StoredFieldsWriter()
Lucene::StoredFieldsWriter::docFreeList
Collection< StoredFieldsWriterPerDocPtr > docFreeList
Definition: StoredFieldsWriter.h:28
Lucene::StoredFieldsWriter::finishDocument
void finishDocument(const StoredFieldsWriterPerDocPtr &perDoc)

clucene.sourceforge.net