Package org.terrier.structures.indexing
Class DocumentIndexBuilder
- java.lang.Object
-
- org.terrier.structures.indexing.DocumentIndexBuilder
-
public class DocumentIndexBuilder extends java.lang.ObjectA builder for the document index.- Author:
- Vassilis Plachouras
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.DataOutputStreamdosThe stream to which we write the data.protected booleanfieldsdoes this index have fieldsprotected FSArrayFile.ArrayFileWriterfileWriterutility for writing to diskprotected IndexOnDiskindexindex object of the index currently being createdprotected static org.slf4j.LoggerloggerThe logger usedprotected intnumberOfDocumentIndexEntriesThe total number of entries in the document index.protected java.lang.StringstructureNameName of the structure to which we're writing
-
Constructor Summary
Constructors Constructor Description DocumentIndexBuilder(IndexOnDisk i, java.lang.String _structureName)Deprecated.DocumentIndexBuilder(IndexOnDisk i, java.lang.String _structureName, boolean fields)Construct a DocumentIndex associated with the specified index
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntryToBuffer(org.apache.hadoop.io.Writable die)Adds to the index a new entry, giving to it the next available document id.voidclose()Closes the random access file.voidfinishedCollections()Closes the underlying file after finished processing the collections.
-
-
-
Field Detail
-
logger
protected static final org.slf4j.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 IndexOnDisk index
index object of the index currently being created
-
fields
protected boolean fields
does this index have fields
-
fileWriter
protected FSArrayFile.ArrayFileWriter fileWriter
utility for writing to disk
-
-
Constructor Detail
-
DocumentIndexBuilder
public DocumentIndexBuilder(IndexOnDisk i, java.lang.String _structureName, boolean fields)
Construct a DocumentIndex associated with the specified index- Parameters:
i- Index being constructed_structureName- the name of the structure being createdfields- does this index have fields
-
DocumentIndexBuilder
@Deprecated public DocumentIndexBuilder(IndexOnDisk i, java.lang.String _structureName)
Deprecated.
-
-
Method Detail
-
addEntryToBuffer
public void addEntryToBuffer(org.apache.hadoop.io.Writable die) throws java.io.IOExceptionAdds 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.
-
-