Package org.terrier.structures.bit
Class BitPostingIndex
- java.lang.Object
-
- org.terrier.structures.bit.BitPostingIndex
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,PostingIndex<BitIndexPointer>
public class BitPostingIndex extends java.lang.Object implements PostingIndex<BitIndexPointer>
Class for various bit compressed index implementations, including parents to current DirectIndex and InvertedIndex implementations. Index properties:- index.STRUCTURENAME.data-files - how many files represent this structure.
- index.STRUCTURENAME.data-source - one of {file,fileinmem} or a class implements BitInSeekable.
- index.STRUCTURENAME.fields.count - how many fields are in use by this structures.
- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected DocumentIndex
doi
protected int
fieldCount
protected IndexOnDisk
index
protected java.lang.reflect.Constructor<? extends IterablePosting>
postingConstructor
protected java.lang.Class<? extends IterablePosting>
postingImplementation
-
Constructor Summary
Constructors Modifier Constructor Description protected
BitPostingIndex(java.lang.String filename, byte fileCount, java.lang.Class<? extends IterablePosting> _postingImplementation, java.lang.String _dataSource)
Deprecated.BitPostingIndex(java.lang.String filename, byte fileCount, java.lang.Class<BasicIterablePosting> _postingImplementation, java.lang.String _dataSource, int _fieldCount)
protected
BitPostingIndex(java.lang.String filename, byte fileCount, DocumentIndex _doi, java.lang.Class<? extends IterablePosting> _postingImplementation, java.lang.String _dataSource, int _fieldCount)
BitPostingIndex(IndexOnDisk _index, java.lang.String _structureName, java.lang.Class<? extends IterablePosting> _postingImplementation)
Constructs an instance of the BitPostingIndex.BitPostingIndex(IndexOnDisk _index, java.lang.String _structureName, DocumentIndex _documentIndex, java.lang.Class<? extends IterablePosting> _postingImplementation)
Constructs an instance of the BitPostingIndex.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
IterablePosting
getPostings(Pointer _pointer)
Returns the posting iterator given a pointer.protected void
setPostingImplementation(java.lang.Class<? extends IterablePosting> postingClass)
-
-
-
Field Detail
-
postingImplementation
protected java.lang.Class<? extends IterablePosting> postingImplementation
-
postingConstructor
protected java.lang.reflect.Constructor<? extends IterablePosting> postingConstructor
-
doi
protected DocumentIndex doi
-
index
protected IndexOnDisk index
-
fieldCount
protected int fieldCount
-
-
Constructor Detail
-
BitPostingIndex
public BitPostingIndex(IndexOnDisk _index, java.lang.String _structureName, java.lang.Class<? extends IterablePosting> _postingImplementation) throws java.io.IOException
Constructs an instance of the BitPostingIndex.- Parameters:
_index
-_structureName
-_postingImplementation
-- Throws:
java.io.IOException
-
BitPostingIndex
public BitPostingIndex(IndexOnDisk _index, java.lang.String _structureName, DocumentIndex _documentIndex, java.lang.Class<? extends IterablePosting> _postingImplementation) throws java.io.IOException
Constructs an instance of the BitPostingIndex.- Parameters:
_index
-_structureName
-_documentIndex
-_postingImplementation
-- Throws:
java.io.IOException
-
BitPostingIndex
public BitPostingIndex(java.lang.String filename, byte fileCount, java.lang.Class<BasicIterablePosting> _postingImplementation, java.lang.String _dataSource, int _fieldCount) throws java.io.IOException
- Throws:
java.io.IOException
-
BitPostingIndex
@Deprecated protected BitPostingIndex(java.lang.String filename, byte fileCount, java.lang.Class<? extends IterablePosting> _postingImplementation, java.lang.String _dataSource) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
BitPostingIndex
protected BitPostingIndex(java.lang.String filename, byte fileCount, DocumentIndex _doi, java.lang.Class<? extends IterablePosting> _postingImplementation, java.lang.String _dataSource, int _fieldCount) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
setPostingImplementation
protected void setPostingImplementation(java.lang.Class<? extends IterablePosting> postingClass) throws java.io.IOException
- Throws:
java.io.IOException
-
getPostings
public IterablePosting getPostings(Pointer _pointer) throws java.io.IOException
Returns the posting iterator given a pointer.- Specified by:
getPostings
in interfacePostingIndex<BitIndexPointer>
- Returns:
- the posting iterator given a pointer.
- Throws:
java.io.IOException
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-