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

Loading...
Searching...
No Matches
TermsHash.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 TERMSHASH_H
8#define TERMSHASH_H
9
10#include "InvertedDocConsumer.h"
11
12 namespace Lucene {
13
18 class TermsHash : public InvertedDocConsumer {
19 public:
20 TermsHash(const DocumentsWriterPtr& docWriter, bool trackAllocations, const TermsHashConsumerPtr& consumer, const TermsHashPtr& nextTermsHash);
21 virtual ~TermsHash();
22
23 LUCENE_CLASS(TermsHash);
24
25 public:
26 TermsHashConsumerPtr consumer;
27 TermsHashPtr nextTermsHash;
28 int32_t bytesPerPosting;
29 int32_t postingsFreeChunk;
30 DocumentsWriterWeakPtr _docWriter;
31 bool trackAllocations;
32
33 protected:
34 Collection<RawPostingListPtr> postingsFreeList;
35 int32_t postingsFreeCount;
36 int32_t postingsAllocCount;
37
38 public:
40 virtual InvertedDocConsumerPerThreadPtr addThread(const DocInverterPerThreadPtr& docInverterPerThread);
41 virtual TermsHashPerThreadPtr addThread(const DocInverterPerThreadPtr& docInverterPerThread, const TermsHashPerThreadPtr& primaryPerThread);
42
43 virtual void setFieldInfos(const FieldInfosPtr& fieldInfos);
44
48 virtual void abort();
49
50 void shrinkFreePostings(MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, const SegmentWriteStatePtr& state);
51
53 virtual void closeDocStore(const SegmentWriteStatePtr& state);
54
56 virtual void flush(MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, const SegmentWriteStatePtr& state);
57
59 virtual bool freeRAM();
60
61 void recyclePostings(Collection<RawPostingListPtr> postings, int32_t numPostings);
62
63 void getPostings(Collection<RawPostingListPtr> postings);
64};
65
66}
67
68#endif
InvertedDocConsumer.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::Collection
Utility template class to handle collections that can be safely copied and shared.
Definition Collection.h:17
Lucene::InvertedDocConsumer
Definition InvertedDocConsumer.h:14
Lucene::InvertedDocConsumer::fieldInfos
FieldInfosPtr fieldInfos
Definition InvertedDocConsumer.h:21
Lucene::TermsHash
This class implements InvertedDocConsumer, which is passed each token produced by the analyzer on eac...
Definition TermsHash.h:18
Lucene::TermsHash::recyclePostings
void recyclePostings(Collection< RawPostingListPtr > postings, int32_t numPostings)
Lucene::TermsHash::_docWriter
DocumentsWriterWeakPtr _docWriter
Definition TermsHash.h:30
Lucene::TermsHash::trackAllocations
bool trackAllocations
Definition TermsHash.h:31
Lucene::TermsHash::getPostings
void getPostings(Collection< RawPostingListPtr > postings)
Lucene::TermsHash::postingsAllocCount
int32_t postingsAllocCount
Definition TermsHash.h:36
Lucene::TermsHash::postingsFreeChunk
int32_t postingsFreeChunk
Definition TermsHash.h:29
Lucene::TermsHash::closeDocStore
virtual void closeDocStore(const SegmentWriteStatePtr &state)
Close doc stores.
Lucene::TermsHash::bytesPerPosting
int32_t bytesPerPosting
Definition TermsHash.h:28
Lucene::TermsHash::flush
virtual void flush(MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
Flush a new segment.
Lucene::TermsHash::~TermsHash
virtual ~TermsHash()
Lucene::TermsHash::shrinkFreePostings
void shrinkFreePostings(MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
Lucene::TermsHash::addThread
virtual TermsHashPerThreadPtr addThread(const DocInverterPerThreadPtr &docInverterPerThread, const TermsHashPerThreadPtr &primaryPerThread)
Lucene::TermsHash::nextTermsHash
TermsHashPtr nextTermsHash
Definition TermsHash.h:27
Lucene::TermsHash::addThread
virtual InvertedDocConsumerPerThreadPtr addThread(const DocInverterPerThreadPtr &docInverterPerThread)
Add a new thread.
Lucene::TermsHash::setFieldInfos
virtual void setFieldInfos(const FieldInfosPtr &fieldInfos)
Lucene::TermsHash::consumer
TermsHashConsumerPtr consumer
Definition TermsHash.h:26
Lucene::TermsHash::postingsFreeList
Collection< RawPostingListPtr > postingsFreeList
Definition TermsHash.h:34
Lucene::TermsHash::freeRAM
virtual bool freeRAM()
Attempt to free RAM, returning true if any RAM was freed.
Lucene::TermsHash::abort
virtual void abort()
Abort (called after hitting AbortException) NOTE: do not make this sync'd; it's not necessary (DW ens...
Lucene::TermsHash::TermsHash
TermsHash(const DocumentsWriterPtr &docWriter, bool trackAllocations, const TermsHashConsumerPtr &consumer, const TermsHashPtr &nextTermsHash)
Lucene::TermsHash::postingsFreeCount
int32_t postingsFreeCount
Definition TermsHash.h:35
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::FieldInfosPtr
boost::shared_ptr< FieldInfos > FieldInfosPtr
Definition LuceneTypes.h:127
Lucene::DocumentsWriterPtr
boost::shared_ptr< DocumentsWriter > DocumentsWriterPtr
Definition LuceneTypes.h:123
Lucene::SegmentWriteStatePtr
boost::shared_ptr< SegmentWriteState > SegmentWriteStatePtr
Definition LuceneTypes.h:222
Lucene::DocumentsWriterWeakPtr
boost::weak_ptr< DocumentsWriter > DocumentsWriterWeakPtr
Definition LuceneTypes.h:123
Lucene::DocInverterPerThreadPtr
boost::shared_ptr< DocInverterPerThread > DocInverterPerThreadPtr
Definition LuceneTypes.h:121
Lucene::TermsHashPerThreadPtr
boost::shared_ptr< TermsHashPerThread > TermsHashPerThreadPtr
Definition LuceneTypes.h:251
Lucene::TermsHashConsumerPtr
boost::shared_ptr< TermsHashConsumer > TermsHashConsumerPtr
Definition LuceneTypes.h:247
Lucene::InvertedDocConsumerPerThreadPtr
boost::shared_ptr< InvertedDocConsumerPerThread > InvertedDocConsumerPerThreadPtr
Definition LuceneTypes.h:165
Lucene::TermsHashPtr
boost::shared_ptr< TermsHash > TermsHashPtr
Definition LuceneTypes.h:246

clucene.sourceforge.net