org.terrier.structures
Interface BitIndexPointer

All Superinterfaces:
BitFilePosition, Pointer, org.apache.hadoop.io.Writable
All Known Implementing Classes:
BasicDocumentIndexEntry, BasicLexiconEntry, BlockFieldLexiconEntry, BlockLexiconEntry, DocumentIndexEntry, FieldDocumentIndexEntry, FieldLexiconEntry, SimpleBitIndexPointer, SimpleDocumentIndexEntry

public interface BitIndexPointer
extends BitFilePosition, org.apache.hadoop.io.Writable, Pointer

A pointer implementation for BitPostingIndex structures. It has all the attrbutes of a Pointer. However, BitIndexPointer supports a FileNumber attribute, which allows a single Bit structure to be represented by several underlying files. Moreover, as this is a BitFilePosition, the offset is recorded in terms of bytes (a long) and bits (a byte). In practive, the FileNumber is recorded in 5 spare bits of the "bit" byte, so valid FileNumbers are 0-31 (MAX_FILE_ID).

Since:
3.0
Author:
Craig Macdonald

Field Summary
static byte BIT_MASK
          amount to mask byte by to obtain bit offset
static byte FILE_SHIFT
          amount to shift byte by to obtain file id
static byte MAX_FILE_ID
          largest permissible file id using most implementations
 
Method Summary
 byte getFileNumber()
          Returns the file number: 0-32
 void setBitIndexPointer(BitIndexPointer pointer)
          Update this pointer to reflect the same values as the specified pointer
 void setFileNumber(byte fileId)
          Set the file number
 
Methods inherited from interface org.terrier.structures.BitFilePosition
getOffset, getOffsetBits, setOffset, setOffset
 
Methods inherited from interface org.apache.hadoop.io.Writable
readFields, write
 
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 - - pointer to use to set the offset, bit offset and file Id parameters.

setFileNumber

void setFileNumber(byte fileId)
Set the file number


getFileNumber

byte getFileNumber()
Returns the file number: 0-32



Terrier 3.5. Copyright © 2004-2011 University of Glasgow