org.terrier.structures.indexing
Class DocumentIndexBuilder

java.lang.Object
  extended by org.terrier.structures.indexing.DocumentIndexBuilder

public class DocumentIndexBuilder
extends java.lang.Object

A builder for the document index.

Author:
Vassilis Plachouras

Field Summary
protected  java.io.DataOutputStream dos
          The stream to which we write the data.
protected  Index index
          index object of the index currently being created
protected static org.apache.log4j.Logger logger
          The logger used
protected  int numberOfDocumentIndexEntries
          The total number of entries in the document index.
protected  java.lang.String structureName
          Name of the structure to which we're writing
 
Constructor Summary
DocumentIndexBuilder(Index i, java.lang.String _structureName)
          Construct a DocumentIndex associated with the specified index
 
Method Summary
 void addEntryToBuffer(org.apache.hadoop.io.Writable die)
          Adds to the index a new entry, giving to it the next available document id.
 void close()
          Closes the random access file.
 void finishedCollections()
          Closes the underlying file after finished processing the collections.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
The logger used


structureName

protected java.lang.String structureName
Name of the structure to which we're writing


dos

protected java.io.DataOutputStream dos
The stream to which we write the data.


numberOfDocumentIndexEntries

protected int numberOfDocumentIndexEntries
The total number of entries in the document index.


index

protected Index index
index object of the index currently being created

Constructor Detail

DocumentIndexBuilder

public DocumentIndexBuilder(Index i,
                            java.lang.String _structureName)
Construct a DocumentIndex associated with the specified index

Parameters:
i - Index being constructed
_structureName - the name of the structure being created
Method Detail

addEntryToBuffer

public void addEntryToBuffer(org.apache.hadoop.io.Writable die)
                      throws java.io.IOException
Adds to the index a new entry, giving to it the next available document id.

Parameters:
die - The document index entry being written
Throws:
java.io.IOException - Throws an exception in the case of an IO error.

close

public void close()
Closes the random access file.


finishedCollections

public void finishedCollections()
Closes the underlying file after finished processing the collections.



Terrier 3.5. Copyright © 2004-2011 University of Glasgow