Package org.terrier.structures
Interface BitIndexPointer
-
- All Superinterfaces:
BitFilePosition
,Pointer
,org.apache.hadoop.io.Writable
- All Known Implementing Classes:
BasicDocumentIndexEntry
,BasicLexiconEntry
,DocumentIndexEntry
,FieldDocumentIndexEntry
,FieldLexiconEntry
,MultiDocumentEntry
,NonIncrementalDocumentIndexEntry
,SimpleBitIndexPointer
,SimpleDocumentIndexEntry
,Tr3BlockFieldLexiconEntry
,Tr3BlockLexiconEntry
,Tr4BasicLexiconEntry
,Tr4FieldLexiconEntry
public interface BitIndexPointer extends BitFilePosition, org.apache.hadoop.io.Writable, Pointer
APointer
specialisation for somePostingIndex
structures. It has all the methods of aPointer
. However, some implementations (e.g. BitPostingIndex) supports a "file number" attribute, which allows a single index data structure to be represented by several underlying files. Moreover, as this is aBitFilePosition
, the offset is recorded in terms of bytes (a long) and bits (a byte). In practice, the "file number" is recorded in 5 spare bits of the "bit" byte, so valid "file numbers" are 0 - 31 (seeMAX_FILE_ID
).- Since:
- 3.0
- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description static byte
BIT_MASK
amount to mask byte by to obtain bit offsetstatic byte
FILE_SHIFT
amount to shift byte by to obtain file idstatic byte
MAX_FILE_ID
largest permissible file id using most implementations
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte
getFileNumber()
Returns the file number (byte value in the 0-31 range)void
setBitIndexPointer(BitIndexPointer pointer)
Update this pointer to reflect the same values as the specified pointervoid
setFileNumber(byte fileId)
Set the file number.-
Methods inherited from interface org.terrier.structures.BitFilePosition
getOffset, getOffsetBits, setOffset, setOffset
-
Methods inherited from interface org.terrier.structures.Pointer
getNumberOfEntries, pointerToString, setNumberOfEntries, setPointer
-
-
-
-
Field Detail
-
MAX_FILE_ID
static final byte MAX_FILE_ID
largest permissible file id using most implementations- See Also:
- Constant Field Values
-
BIT_MASK
static final byte BIT_MASK
amount to mask byte by to obtain bit offset- See Also:
- Constant Field Values
-
FILE_SHIFT
static final byte FILE_SHIFT
amount to shift byte by to obtain file id- See Also:
- Constant Field Values
-
-
Method Detail
-
setBitIndexPointer
void setBitIndexPointer(BitIndexPointer pointer)
Update this pointer to reflect the same values as the specified pointer- Parameters:
pointer
- the pointer to use to set the byte offset, bit offset and file number parameters.
-
setFileNumber
void setFileNumber(byte fileId)
Set the file number.- Parameters:
fileId
- the file number.
-
getFileNumber
byte getFileNumber()
Returns the file number (byte value in the 0-31 range)- Returns:
- the file number (byte value in the 0-31 range)
-
-