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