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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
Lucene::TermsHash Class Reference

This class implements InvertedDocConsumer, which is passed each token produced by the analyzer on each field. It stores these tokens in a hash table, and allocates separate byte streams per token. Consumers of this class, eg FreqProxTermsWriter and TermVectorsTermsWriter, write their own byte streams under each term. More...

#include <TermsHash.h>

+ Inheritance diagram for Lucene::TermsHash:

Public Member Functions

 TermsHash (const DocumentsWriterPtr &docWriter, bool trackAllocations, const TermsHashConsumerPtr &consumer, const TermsHashPtr &nextTermsHash)
 
virtual ~TermsHash ()
 
virtual String getClassName ()
 
boost::shared_ptr< TermsHashshared_from_this ()
 
virtual InvertedDocConsumerPerThreadPtr addThread (const DocInverterPerThreadPtr &docInverterPerThread)
 Add a new thread.
 
virtual TermsHashPerThreadPtr addThread (const DocInverterPerThreadPtr &docInverterPerThread, const TermsHashPerThreadPtr &primaryPerThread)
 
virtual void setFieldInfos (const FieldInfosPtr &fieldInfos)
 
virtual void abort ()
 Abort (called after hitting AbortException) NOTE: do not make this sync'd; it's not necessary (DW ensures all other threads are idle), and it leads to deadlock.
 
void shrinkFreePostings (MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
 
virtual void closeDocStore (const SegmentWriteStatePtr &state)
 Close doc stores.
 
virtual void flush (MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, const SegmentWriteStatePtr &state)
 Flush a new segment.
 
virtual bool freeRAM ()
 Attempt to free RAM, returning true if any RAM was freed.
 
void recyclePostings (Collection< RawPostingListPtr > postings, int32_t numPostings)
 
void getPostings (Collection< RawPostingListPtr > postings)
 
- Public Member Functions inherited from Lucene::InvertedDocConsumer
virtual ~InvertedDocConsumer ()
 
boost::shared_ptr< InvertedDocConsumershared_from_this ()
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 
- Static Public Member Functions inherited from Lucene::InvertedDocConsumer
static String _getClassName ()
 

Data Fields

TermsHashConsumerPtr consumer
 
TermsHashPtr nextTermsHash
 
int32_t bytesPerPosting
 
int32_t postingsFreeChunk
 
DocumentsWriterWeakPtr _docWriter
 
bool trackAllocations
 
- Data Fields inherited from Lucene::InvertedDocConsumer
FieldInfosPtr fieldInfos
 

Protected Attributes

Collection< RawPostingListPtrpostingsFreeList
 
int32_t postingsFreeCount
 
int32_t postingsAllocCount
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Detailed Description

This class implements InvertedDocConsumer, which is passed each token produced by the analyzer on each field. It stores these tokens in a hash table, and allocates separate byte streams per token. Consumers of this class, eg FreqProxTermsWriter and TermVectorsTermsWriter, write their own byte streams under each term.

Constructor & Destructor Documentation

◆ TermsHash()

Lucene::TermsHash::TermsHash ( const DocumentsWriterPtr docWriter,
bool  trackAllocations,
const TermsHashConsumerPtr consumer,
const TermsHashPtr nextTermsHash 
)

◆ ~TermsHash()

virtual Lucene::TermsHash::~TermsHash ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::TermsHash::_getClassName ( )
inlinestatic

◆ abort()

virtual void Lucene::TermsHash::abort ( )
virtual

Abort (called after hitting AbortException) NOTE: do not make this sync'd; it's not necessary (DW ensures all other threads are idle), and it leads to deadlock.

Implements Lucene::InvertedDocConsumer.

◆ addThread() [1/2]

virtual InvertedDocConsumerPerThreadPtr Lucene::TermsHash::addThread ( const DocInverterPerThreadPtr docInverterPerThread)
virtual

Add a new thread.

Implements Lucene::InvertedDocConsumer.

◆ addThread() [2/2]

virtual TermsHashPerThreadPtr Lucene::TermsHash::addThread ( const DocInverterPerThreadPtr docInverterPerThread,
const TermsHashPerThreadPtr primaryPerThread 
)
virtual

◆ closeDocStore()

virtual void Lucene::TermsHash::closeDocStore ( const SegmentWriteStatePtr state)
virtual

Close doc stores.

Implements Lucene::InvertedDocConsumer.

◆ flush()

virtual void Lucene::TermsHash::flush ( MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField  threadsAndFields,
const SegmentWriteStatePtr state 
)
virtual

Flush a new segment.

Implements Lucene::InvertedDocConsumer.

◆ freeRAM()

virtual bool Lucene::TermsHash::freeRAM ( )
virtual

Attempt to free RAM, returning true if any RAM was freed.

Implements Lucene::InvertedDocConsumer.

◆ getClassName()

virtual String Lucene::TermsHash::getClassName ( )
inlinevirtual

Reimplemented from Lucene::InvertedDocConsumer.

◆ getPostings()

void Lucene::TermsHash::getPostings ( Collection< RawPostingListPtr postings)

◆ recyclePostings()

void Lucene::TermsHash::recyclePostings ( Collection< RawPostingListPtr postings,
int32_t  numPostings 
)

◆ setFieldInfos()

virtual void Lucene::TermsHash::setFieldInfos ( const FieldInfosPtr fieldInfos)
virtual

Reimplemented from Lucene::InvertedDocConsumer.

◆ shared_from_this()

boost::shared_ptr< TermsHash > Lucene::TermsHash::shared_from_this ( )
inline

◆ shrinkFreePostings()

void Lucene::TermsHash::shrinkFreePostings ( MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField  threadsAndFields,
const SegmentWriteStatePtr state 
)

Field Documentation

◆ _docWriter

DocumentsWriterWeakPtr Lucene::TermsHash::_docWriter

◆ bytesPerPosting

int32_t Lucene::TermsHash::bytesPerPosting

◆ consumer

TermsHashConsumerPtr Lucene::TermsHash::consumer

◆ nextTermsHash

TermsHashPtr Lucene::TermsHash::nextTermsHash

◆ postingsAllocCount

int32_t Lucene::TermsHash::postingsAllocCount
protected

◆ postingsFreeChunk

int32_t Lucene::TermsHash::postingsFreeChunk

◆ postingsFreeCount

int32_t Lucene::TermsHash::postingsFreeCount
protected

◆ postingsFreeList

Collection<RawPostingListPtr> Lucene::TermsHash::postingsFreeList
protected

◆ trackAllocations

bool Lucene::TermsHash::trackAllocations

The documentation for this class was generated from the following file:

clucene.sourceforge.net