it.unimi.di.mg4j.index
Class BitStreamHPIndex

java.lang.Object
  extended by it.unimi.di.mg4j.index.Index
      extended by it.unimi.di.mg4j.index.BitStreamIndex
          extended by it.unimi.di.mg4j.index.BitStreamHPIndex
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FileHPIndex, InMemoryHPIndex, MemoryMappedHPIndex, RemoteBitStreamHPIndex

public abstract class BitStreamHPIndex
extends BitStreamIndex

A high-performance bitstream-based index.

Implementing subclasses must provide access to the index bitstream (as it happens for a BitStreamIndex) but also to the positions stream, both at byte and bit level.

Wired implementations

The standard readers associated with an instance of this class are of type BitStreamHPIndexReader. Nonetheless, it is possible to generate automatically sources for wired classes that work only for a particular set of codings and flags. The wired classes will be fetched automagically by reflection, if available. Please read the section about performance in the MG4J manual.

Since:
1.1
Author:
Sebastiano Vigna
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class it.unimi.di.mg4j.index.BitStreamIndex
BitStreamIndex.PropertyKeys
 
Nested classes/interfaces inherited from class it.unimi.di.mg4j.index.Index
Index.EmptyIndexIterator, Index.UriKeys
 
Field Summary
 
Fields inherited from class it.unimi.di.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.mg4j.index.Index
field, hasCounts, hasPayloads, hasPositions, keyIndex, maxCount, numberOfDocuments, numberOfOccurrences, numberOfPostings, numberOfTerms, payload, prefixMap, properties, singletonSet, sizes, termMap, termProcessor
 
Constructor Summary
BitStreamHPIndex(int numberOfDocuments, int 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, IntList sizes, LongList offsets)
           
 
Method Summary
protected  Constructor<? extends IndexReader> getConstructor()
           
abstract  InputBitStream getPositionsInputBitStream(int bufferSize)
          Returns an input bit stream over the index.
abstract  InputStream getPositionsInputStream()
          Returns an input stream over the index.
 IndexReader getReader(int bufferSize)
          Creates and returns a new IndexReader based on this index.
 
Methods inherited from class it.unimi.di.mg4j.index.BitStreamIndex
featureName, gaussianGolombModulus, getInputBitStream, getInputStream, golombModulus, quantumSigma, toString
 
Methods inherited from class it.unimi.di.mg4j.index.Index
documents, documents, documents, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getEmptyIndexIterator, getInstance, getInstance, getInstance, getInstance, getInstance, getReader, getTermProcessor, keyIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BitStreamHPIndex

public BitStreamHPIndex(int numberOfDocuments,
                        int 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,
                        IntList sizes,
                        LongList offsets)
Method Detail

getConstructor

protected Constructor<? extends IndexReader> getConstructor()
Overrides:
getConstructor in class BitStreamIndex

getPositionsInputBitStream

public abstract InputBitStream getPositionsInputBitStream(int bufferSize)
                                                   throws IOException
Returns an input bit stream over the index.

Parameters:
bufferSize - a suggested buffer size.
Returns:
an input bit stream over the index.
Throws:
IOException

getPositionsInputStream

public abstract InputStream getPositionsInputStream()
                                             throws IOException
Returns an input stream over the index.

Returns:
an input stream over the index.
Throws:
IOException

getReader

public IndexReader getReader(int bufferSize)
                      throws IOException
Description copied from class: Index
Creates and returns a new IndexReader based on this index. After that, you can use the reader to read this index.

Overrides:
getReader in class BitStreamIndex
Parameters:
bufferSize - the size of the buffer to be used accessing the reader, or -1 for a default buffer size.
Returns:
a new IndexReader to read this index.
Throws:
IOException