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
2
// 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
clucene.sourceforge.net