Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures.indexing.singlepass.hadoop
Class SimpleDocumentIndexBuilder

java.lang.Object
  extended by uk.ac.gla.terrier.structures.indexing.DocumentIndexBuilder
      extended by uk.ac.gla.terrier.structures.indexing.singlepass.hadoop.SimpleDocumentIndexBuilder

public class SimpleDocumentIndexBuilder
extends DocumentIndexBuilder

A simple DocumentIndexBuilder. Only records Docno and length of document

Since:
2.2
Version:
$Revision: 1.2 $
Author:
Richard McCreadie and Craig Macdonald

Constructor Summary
SimpleDocumentIndexBuilder(Index i)
           
 
Method Summary
 void addEntryToBuffer(java.lang.String docno, int docLength)
          Adds to the index a new entry, giving to it the next available document id.
 void addEntryToBuffer(java.lang.String docno, int docLength, FilePosition directIndexOffset)
          Adds to the index a new entry, giving to it the next available document id.
 void finishedCollections()
          Closes the underlying file after finished processing the collections.
 
Methods inherited from class uk.ac.gla.terrier.structures.indexing.DocumentIndexBuilder
close
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDocumentIndexBuilder

public SimpleDocumentIndexBuilder(Index i)
Method Detail

addEntryToBuffer

public void addEntryToBuffer(java.lang.String docno,
                             int docLength,
                             FilePosition directIndexOffset)
                      throws java.io.IOException
Description copied from class: DocumentIndexBuilder
Adds to the index a new entry, giving to it the next available document id. The entry is writen first to the buffer, which afterwards has to be flushed to the file on disk.

Overrides:
addEntryToBuffer in class DocumentIndexBuilder
Parameters:
docno - String the document number.
docLength - int the number of indexed tokens in the document.
directIndexOffset - FilePosition the ending position of the document's entry in the direct index.
Throws:
java.io.IOException - Throws an exception in the case of an IO error.

addEntryToBuffer

public void addEntryToBuffer(java.lang.String docno,
                             int docLength)
                      throws java.io.IOException
Description copied from class: DocumentIndexBuilder
Adds to the index a new entry, giving to it the next available document id. The entry is writen first to the buffer, which afterwards has to be flushed to the file on disk.

Overrides:
addEntryToBuffer in class DocumentIndexBuilder
Parameters:
docno - String the document number.
docLength - int the number of indexed tokens in the document.
Throws:
java.io.IOException - Throws an exception in the case of an IO error.

finishedCollections

public void finishedCollections()
Description copied from class: DocumentIndexBuilder
Closes the underlying file after finished processing the collections.

Overrides:
finishedCollections in class DocumentIndexBuilder

Terrier IR Platform
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow