Package it.unimi.di.big.mg4j.index
Class FileHPIndex
- java.lang.Object
-
- it.unimi.di.big.mg4j.index.Index
-
- it.unimi.di.big.mg4j.index.BitStreamIndex
-
- it.unimi.di.big.mg4j.index.BitStreamHPIndex
-
- it.unimi.di.big.mg4j.index.FileHPIndex
-
- All Implemented Interfaces:
Serializable
public class FileHPIndex extends BitStreamHPIndex
A file-based high-performance index.An instance of this class stores additional index data for indices based on files: for instance, basename, compression flags, etc.
- Since:
- 0.9
- Author:
- Paolo Boldi, Sebastiano Vigna
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class it.unimi.di.big.mg4j.index.BitStreamIndex
BitStreamIndex.PropertyKeys
-
Nested classes/interfaces inherited from class it.unimi.di.big.mg4j.index.Index
Index.EmptyIndexIterator, Index.UriKeys
-
-
Field Summary
Fields Modifier and Type Field Description String
basename
The basename of this index.File
indexFile
The file containing the index.File
positionsFile
The file containing the positions.-
Fields inherited from class it.unimi.di.big.mg4j.index.BitStreamIndex
bufferSize, countCoding, DEFAULT_BUFFER_SIZE, DEFAULT_FIXED_QUANTUM, DEFAULT_HEIGHT, DEFAULT_QUANTUM, FIXED_POINT_BITS, FIXED_POINT_MULTIPLIER, frequencyCoding, height, offsets, pointerCoding, positionCoding, quantum, readerConstructor
-
Fields inherited from class it.unimi.di.big.mg4j.index.Index
field, hasCounts, hasPayloads, hasPositions, keyIndex, maxCount, numberOfDocuments, numberOfOccurrences, numberOfPostings, numberOfTerms, payload, prefixMap, properties, singletonSet, sizes, termMap, termProcessor
-
-
Constructor Summary
Constructors Constructor Description FileHPIndex(String basename, long numberOfDocuments, long numberOfTerms, long numberOfPostings, long numberOfOccurrences, int maxCount, Payload payload, CompressionFlags.Coding frequencyCoding, CompressionFlags.Coding pointerCoding, CompressionFlags.Coding countCoding, CompressionFlags.Coding positionCoding, int quantum, int height, int bufferSize, TermProcessor termProcessor, String field, Properties properties, StringMap<? extends CharSequence> termMap, PrefixMap<? extends CharSequence> prefixMap, IntBigList sizes, LongBigList offsets)
-
Method Summary
Modifier and Type Method Description InputBitStream
getInputBitStream(int bufferSize)
Returns an input bit stream over the index.FileInputStream
getInputStream()
Returns an input stream over the index.InputBitStream
getPositionsInputBitStream(int bufferSize)
Returns an input bit stream over the index.InputStream
getPositionsInputStream()
Returns an input stream over the index.String
toString()
-
Methods inherited from class it.unimi.di.big.mg4j.index.BitStreamHPIndex
getConstructor, getReader
-
Methods inherited from class it.unimi.di.big.mg4j.index.BitStreamIndex
featureName, gaussianGolombModulus, golombModulus, quantumSigma
-
Methods inherited from class it.unimi.di.big.mg4j.index.Index
documents, documents, documents, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getInstance, getInstance, getInstance, getInstance, getInstance, getReader, getTermProcessor, keyIndex
-
-
-
-
Field Detail
-
basename
public final String basename
The basename of this index. All file names will be stemmed from the basename. It may benull
.
-
indexFile
public final File indexFile
The file containing the index. It may benull
.
-
positionsFile
public final File positionsFile
The file containing the positions. It may benull
. // TODO: Why ?
-
-
Constructor Detail
-
FileHPIndex
public FileHPIndex(String basename, long numberOfDocuments, long numberOfTerms, long numberOfPostings, long numberOfOccurrences, int maxCount, Payload payload, CompressionFlags.Coding frequencyCoding, CompressionFlags.Coding pointerCoding, CompressionFlags.Coding countCoding, CompressionFlags.Coding positionCoding, int quantum, int height, int bufferSize, TermProcessor termProcessor, String field, Properties properties, StringMap<? extends CharSequence> termMap, PrefixMap<? extends CharSequence> prefixMap, IntBigList sizes, LongBigList offsets)
-
-
Method Detail
-
toString
public String toString()
- Overrides:
toString
in classBitStreamIndex
-
getInputStream
public FileInputStream getInputStream() throws FileNotFoundException
Description copied from class:BitStreamIndex
Returns an input stream over the index.- Specified by:
getInputStream
in classBitStreamIndex
- Returns:
- an input stream over the index.
- Throws:
FileNotFoundException
-
getInputBitStream
public InputBitStream getInputBitStream(int bufferSize) throws FileNotFoundException
Description copied from class:BitStreamIndex
Returns an input bit stream over the index.- Specified by:
getInputBitStream
in classBitStreamIndex
- Parameters:
bufferSize
- a suggested buffer size.- Returns:
- an input bit stream over the index.
- Throws:
FileNotFoundException
-
getPositionsInputStream
public InputStream getPositionsInputStream() throws IOException
Description copied from class:BitStreamHPIndex
Returns an input stream over the index.- Specified by:
getPositionsInputStream
in classBitStreamHPIndex
- Returns:
- an input stream over the index.
- Throws:
IOException
-
getPositionsInputBitStream
public InputBitStream getPositionsInputBitStream(int bufferSize) throws IOException
Description copied from class:BitStreamHPIndex
Returns an input bit stream over the index.- Specified by:
getPositionsInputBitStream
in classBitStreamHPIndex
- Parameters:
bufferSize
- a suggested buffer size.- Returns:
- an input bit stream over the index.
- Throws:
IOException
-
-