Package it.unimi.di.big.mg4j.index
Class AbstractBitStreamIndexWriter
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.AbstractBitStreamIndexWriter
-
- All Implemented Interfaces:
IndexWriter
- Direct Known Subclasses:
BitStreamHPIndexWriter
,BitStreamIndexWriter
public abstract class AbstractBitStreamIndexWriter extends Object implements IndexWriter
An abstract bitstream-based index writer, providing common variables and a basicprintStats(PrintStream)
implementation.Compression flags
Implementing subclasses need to know the compression method that they should use to write frequencies, pointers, payloads, counts and positions (and whether to write any of them). This information is passed to the constructor using a suitable flag map (see
CompressionFlags
).- Since:
- 1.2
- Author:
- Sebastiano Vigna
-
-
Field Summary
Fields Modifier and Type Field Description long
bitsForCounts
The number of bits written for counts.long
bitsForFrequencies
The number of bits written for frequencies.long
bitsForPayloads
The number of bits written for payloads.long
bitsForPointers
The number of bits written for document pointers.long
bitsForPositions
The number of bits written for positions.protected CompressionFlags.Coding
countCoding
The coding for counts.protected long
currentTerm
The current term.Map<CompressionFlags.Component,CompressionFlags.Coding>
flags
The flag map.protected CompressionFlags.Coding
frequencyCoding
The coding for frequencies.protected boolean
hasCounts
Whether this index contains counts.protected boolean
hasPayloads
Whether this index contains payloads.protected boolean
hasPositions
Whether this index contains positions.protected long
numberOfDocuments
The number of documents of the collection to be indexed.protected long
numberOfOccurrences
The number of indexed occurrences.protected long
numberOfPostings
The number of indexed postings (pairs term/document).protected CompressionFlags.Coding
pointerCoding
The coding for pointers.protected CompressionFlags.Coding
positionCoding
The coding for positions.
-
Constructor Summary
Constructors Constructor Description AbstractBitStreamIndexWriter(long numberOfDocuments, Map<CompressionFlags.Component,CompressionFlags.Coding> flags)
-
Method Summary
Modifier and Type Method Description void
printStats(PrintStream stats)
Writes to the given print stream statistical information about the index just built.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.unimi.di.big.mg4j.index.IndexWriter
close, newDocumentRecord, newInvertedList, properties, writeDocumentPointer, writeDocumentPositions, writeFrequency, writePayload, writePositionCount, writtenBits
-
-
-
-
Field Detail
-
numberOfDocuments
protected final long numberOfDocuments
The number of documents of the collection to be indexed.
-
flags
public Map<CompressionFlags.Component,CompressionFlags.Coding> flags
The flag map.
-
frequencyCoding
protected CompressionFlags.Coding frequencyCoding
The coding for frequencies.
-
pointerCoding
protected CompressionFlags.Coding pointerCoding
The coding for pointers.
-
countCoding
protected CompressionFlags.Coding countCoding
The coding for counts.
-
positionCoding
protected CompressionFlags.Coding positionCoding
The coding for positions.
-
hasPayloads
protected final boolean hasPayloads
Whether this index contains payloads.
-
hasCounts
protected final boolean hasCounts
Whether this index contains counts.
-
hasPositions
protected final boolean hasPositions
Whether this index contains positions.
-
numberOfPostings
protected long numberOfPostings
The number of indexed postings (pairs term/document).
-
numberOfOccurrences
protected long numberOfOccurrences
The number of indexed occurrences.
-
currentTerm
protected long currentTerm
The current term.
-
bitsForFrequencies
public long bitsForFrequencies
The number of bits written for frequencies.
-
bitsForPointers
public long bitsForPointers
The number of bits written for document pointers.
-
bitsForCounts
public long bitsForCounts
The number of bits written for counts.
-
bitsForPayloads
public long bitsForPayloads
The number of bits written for payloads.
-
bitsForPositions
public long bitsForPositions
The number of bits written for positions.
-
-
Constructor Detail
-
AbstractBitStreamIndexWriter
public AbstractBitStreamIndexWriter(long numberOfDocuments, Map<CompressionFlags.Component,CompressionFlags.Coding> flags)
-
-
Method Detail
-
printStats
public void printStats(PrintStream stats)
Description copied from interface:IndexWriter
Writes to the given print stream statistical information about the index just built. This method must be called afterIndexWriter.close()
.- Specified by:
printStats
in interfaceIndexWriter
- Parameters:
stats
- a print stream where statistical information will be written.
-
-