Lucene++ - a full-featured, c++ search engine
API Documentation
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
include
StoredFieldsWriter.h
Go to the documentation of this file.
1
// Copyright (c) 2009-2011 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
{
17
public
:
18
StoredFieldsWriter
(
DocumentsWriterPtr
docWriter,
FieldInfosPtr
fieldInfos
);
19
virtual
~StoredFieldsWriter
();
20
21
LUCENE_CLASS
(
StoredFieldsWriter
);
22
23
public
:
24
FieldsWriterPtr
fieldsWriter
;
25
DocumentsWriterWeakPtr
_docWriter
;
26
FieldInfosPtr
fieldInfos
;
27
int32_t
lastDocID
;
28
29
Collection<StoredFieldsWriterPerDocPtr>
docFreeList
;
30
int32_t
freeCount
;
31
int32_t
allocCount
;
32
33
public
:
34
StoredFieldsWriterPerThreadPtr
addThread
(
DocStatePtr
docState);
35
void
flush
(
SegmentWriteStatePtr
state);
36
void
closeDocStore
(
SegmentWriteStatePtr
state);
37
StoredFieldsWriterPerDocPtr
getPerDoc
();
38
void
abort
();
39
41
void
fill
(int32_t docID);
42
43
void
finishDocument
(
StoredFieldsWriterPerDocPtr
perDoc);
44
bool
freeRAM
();
45
void
free
(
StoredFieldsWriterPerDocPtr
perDoc);
46
47
protected
:
48
void
initFieldsWriter
();
49
};
50
51
class
StoredFieldsWriterPerDoc
:
public
DocWriter
52
{
53
public
:
54
StoredFieldsWriterPerDoc
(
StoredFieldsWriterPtr
fieldsWriter);
55
virtual
~StoredFieldsWriterPerDoc
();
56
57
LUCENE_CLASS
(
StoredFieldsWriterPerDoc
);
58
59
protected
:
60
StoredFieldsWriterWeakPtr
_fieldsWriter
;
61
62
public
:
63
PerDocBufferPtr
buffer
;
64
RAMOutputStreamPtr
fdt
;
65
int32_t
numStoredFields
;
66
67
public
:
68
void
reset
();
69
virtual
void
abort
();
70
virtual
int64_t
sizeInBytes
();
71
virtual
void
finish
();
72
};
73
}
74
75
#endif
clucene.sourceforge.net