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
TermsHash.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 TERMSHASH_H
8 #define TERMSHASH_H
9
10 #include "InvertedDocConsumer.h"
11
12 namespace Lucene
13 {
18 class TermsHash : public InvertedDocConsumer
19 {
20 public:
21 TermsHash(DocumentsWriterPtr docWriter, bool trackAllocations, TermsHashConsumerPtr consumer, TermsHashPtr nextTermsHash);
22 virtual ~TermsHash();
23
24 LUCENE_CLASS(TermsHash);
25
26 public:
27 TermsHashConsumerPtr consumer;
28 TermsHashPtr nextTermsHash;
29 int32_t bytesPerPosting;
30 int32_t postingsFreeChunk;
31 DocumentsWriterWeakPtr _docWriter;
32 bool trackAllocations;
33
34 protected:
35 Collection<RawPostingListPtr> postingsFreeList;
36 int32_t postingsFreeCount;
37 int32_t postingsAllocCount;
38
39 public:
41 virtual InvertedDocConsumerPerThreadPtr addThread(DocInverterPerThreadPtr docInverterPerThread);
42 virtual TermsHashPerThreadPtr addThread(DocInverterPerThreadPtr docInverterPerThread, TermsHashPerThreadPtr primaryPerThread);
43
44 virtual void setFieldInfos(FieldInfosPtr fieldInfos);
45
49 virtual void abort();
50
51 void shrinkFreePostings(MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, SegmentWriteStatePtr state);
52
54 virtual void closeDocStore(SegmentWriteStatePtr state);
55
57 virtual void flush(MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, SegmentWriteStatePtr state);
58
60 virtual bool freeRAM();
61
62 void recyclePostings(Collection<RawPostingListPtr> postings, int32_t numPostings);
63
64 void getPostings(Collection<RawPostingListPtr> postings);
65 };
66 }
67
68 #endif

clucene.sourceforge.net