BlockStats Class Reference

Track the block statistics. More...

#include <BlockStats.h>

List of all members.

Public Member Functions

 BlockStats (const char *fileName, int memSize, const char *listStatsFile=0, const char *elementStatsFile=0)
void incrementRuns (void)
 Increment the number of runs stored while indexing (during the gather stage).
void incrementTriples (void)
 Increment the number of triples stored while indexing.
void checkBlockSize (void)
 Reduce the block size to fit in available memory.
int blockSize (void)
 Returns the current block size.
int memorySize (void)
 Returns the set memory size.
bool memoryFull (void)
 Test if the memory is full based on the current Triple count. Returns true if full.
void memoryReset (void)
 Set the recorded number of Triples to zero.
int runCount (void)
 Returns the number of runs processed.
char * fileName (void)
 Returns associated index file name.
char * listStatsFile (void)
 Returns associated list statisitics file name.
char * elementStatsFile (void)
 Returns associated element statisitics file name.

Detailed Description

Track the block statistics.

BlockStats is used to track and accumulate the statistics of the current block sizes and memory usage while gathering the index terms and documents. A block is the unit of memory used when reading and writing to files.

Author
lapark
Revision
1.5.2.1
Date
2009/11/09 13:13:41
Id
BlockStats.h,v 1.5.2.1 2009/11/09 13:13:41 lapark Exp

Constructor & Destructor Documentation

BlockStats::BlockStats ( const char *  fileName,
int  memSize,
const char *  listStatsFile = 0,
const char *  elementStatsFile = 0 
)

Initialise the block statistics with the allowed memory usage (memSize), the index in use (fileName), and the optional statistics file of the lists (e.g. word.stats) and the optional element statistics file (e.g. document.stats).


Member Function Documentation

void BlockStats::checkBlockSize ( void   ) 

Reduce the block size to fit in available memory.

During the merging stage of indexing, there needs to be a block from each run copied into the memory. This function checks if this is possible based on the current number of runs and the memory size. If it is not possible, the block size is reduced until it is possible.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends

Generated on Tue Nov 10 14:12:09 2009 for textIR by  doxygen 1.6.1