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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 (DocumentsWriterPtr docWriter, bool trackAllocations, TermsHashConsumerPtr consumer, TermsHashPtr nextTermsHash)
virtual | ~TermsHash ()
virtual String | getClassName ()
boost::shared_ptr< TermsHash > | shared_from_this ()
virtual InvertedDocConsumerPerThreadPtr | addThread (DocInverterPerThreadPtr docInverterPerThread)
| Add a new thread. More...
virtual TermsHashPerThreadPtr | addThread (DocInverterPerThreadPtr docInverterPerThread, TermsHashPerThreadPtr primaryPerThread)
virtual void | setFieldInfos (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. More...
void | shrinkFreePostings (MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, SegmentWriteStatePtr state)
virtual void | closeDocStore (SegmentWriteStatePtr state)
| Close doc stores. More...
virtual void | flush (MapInvertedDocConsumerPerThreadCollectionInvertedDocConsumerPerField threadsAndFields, SegmentWriteStatePtr state)
| Flush a new segment. More...
virtual bool | freeRAM ()
| Attempt to free RAM, returning true if any RAM was freed. More...
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 < InvertedDocConsumer > | shared_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. More...
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (LuceneObjectPtr other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## 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< RawPostingListPtr > | postingsFreeList
int32_t | postingsFreeCount
int32_t | postingsAllocCount

## 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

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

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

virtual

## Member Function Documentation

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

inline static

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.

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

virtual

Add a new thread.

Implements Lucene::InvertedDocConsumer.

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

virtual

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

virtual

Close doc stores.

Implements Lucene::InvertedDocConsumer.

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

virtual

Flush a new segment.

Implements Lucene::InvertedDocConsumer.

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

virtual

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

Implements Lucene::InvertedDocConsumer.

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

inline virtual

Reimplemented from Lucene::InvertedDocConsumer.

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

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

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

virtual

Reimplemented from Lucene::InvertedDocConsumer.

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

inline

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

## Field Documentation

DocumentsWriterWeakPtr Lucene::TermsHash::_docWriter

int32_t Lucene::TermsHash::bytesPerPosting

TermsHashConsumerPtr Lucene::TermsHash::consumer

TermsHashPtr Lucene::TermsHash::nextTermsHash

int32_t Lucene::TermsHash::postingsAllocCount

protected

int32_t Lucene::TermsHash::postingsFreeChunk

int32_t Lucene::TermsHash::postingsFreeCount

protected

Collection<RawPostingListPtr> Lucene::TermsHash::postingsFreeList

protected

bool Lucene::TermsHash::trackAllocations

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

- TermsHash.h

clucene.sourceforge.net