Package it.unimi.di.big.mg4j.index
Class MemoryMappedHPIndex
- 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.MemoryMappedHPIndex
-
- All Implemented Interfaces:
Serializable
public class MemoryMappedHPIndex extends BitStreamHPIndex
A memory-mappedBitStreamHPIndex
. See the discussion inMemoryMappedIndex
(and consider that since a high-performance index is actually split in two files, memory mapping is actually easier).- Since:
- 1.2
- Author:
- 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 protected ByteBufferInputStream
index
The byte buffer containing the index.protected ByteBufferInputStream
positions
The byte buffer 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 MemoryMappedHPIndex(ByteBufferInputStream index, ByteBufferInputStream positions, 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, 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 bufferSizeUnused)
Returns an input bit stream over the index.ByteBufferInputStream
getInputStream()
Returns an input stream over the index.InputBitStream
getPositionsInputBitStream(int bufferSizeUnused)
Returns an input bit stream over the index.InputStream
getPositionsInputStream()
Returns an input stream over the index.-
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, toString
-
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
-
index
protected final ByteBufferInputStream index
The byte buffer containing the index.
-
positions
protected final ByteBufferInputStream positions
The byte buffer containing the positions.
-
-
Constructor Detail
-
MemoryMappedHPIndex
public MemoryMappedHPIndex(ByteBufferInputStream index, ByteBufferInputStream positions, 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, TermProcessor termProcessor, String field, Properties properties, StringMap<? extends CharSequence> termMap, PrefixMap<? extends CharSequence> prefixMap, IntBigList sizes, LongBigList offsets)
-
-
Method Detail
-
getInputBitStream
public InputBitStream getInputBitStream(int bufferSizeUnused)
Description copied from class:BitStreamIndex
Returns an input bit stream over the index.- Specified by:
getInputBitStream
in classBitStreamIndex
- Parameters:
bufferSizeUnused
- a suggested buffer size.- Returns:
- an input bit stream over the index.
-
getInputStream
public ByteBufferInputStream getInputStream()
Description copied from class:BitStreamIndex
Returns an input stream over the index.- Specified by:
getInputStream
in classBitStreamIndex
- Returns:
- an input stream over the index.
-
getPositionsInputBitStream
public InputBitStream getPositionsInputBitStream(int bufferSizeUnused) throws IOException
Description copied from class:BitStreamHPIndex
Returns an input bit stream over the index.- Specified by:
getPositionsInputBitStream
in classBitStreamHPIndex
- Parameters:
bufferSizeUnused
- a suggested buffer size.- Returns:
- an input bit stream over the index.
- Throws:
IOException
-
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
-
-