LbmRidReaderBase Class Reference

LbmRidReaderBase provides an interace for reading RIDs from bit segments. More...

#include <LbmRidReader.h>

Inheritance diagram for LbmRidReaderBase:

LbmSegment LbmIterableRidReader LbmRidReader LbmTupleRidReader List of all members.

Public Member Functions

ExecStreamResult advanceToRid (LcsRid rid)
 Advances input to the next rowid >= rid where rowid corresponds to a set bit in a bitmap segment.
ExecStreamResult readRidAndAdvance (LcsRid &rid)
 Retrieves rid and sets up caller to advance forward to the next set bit in the input for the next call.
uint getZeroLengthByteCount (uint8_t segDescByte)
 Get the number of bytes to store the length of zero bytes.
LcsRid getStartRID ()
 
Returns:
startRID of this bitmap segment


Static Public Member Functions

static LcsRid roundToByteBoundary (LcsRid rid)
 Rounds a rid value down to the nearest byte boundary.
static bool setSegLength (uint8_t &segDescByte, uint segLen)
 Sets the length descriptor for a new segment with zero trailing zeros.
static bool adjustSegLength (uint8_t &segDescByte, uint segLen)
 Set segment length in an existing descriptor with the new segment length.
static uint getSegLength (uint8_t segDescByte)
 Get the segment length encoded in SegmentDescriptor.

Static Public Attributes

static const uint LbmOneByteSize = 8
 One byte in the bitmap encodes 8 RIDs.
static const uint LbmOneByteSizeBitShift = 3
static const LcsRidPrimitive LbmOneByteSizeBitMask

Protected Member Functions

void resetState ()
 Resets state variables so next call to rid reader will read a new tuple from the input stream.
ExecStreamResult searchForNextRid ()
 Scans forward in the current byte segment until you hit a set bit.
void initCommon ()
 Common initialization method, called by all other init methods.
uint computeSpaceForZeroBytes (uint nZeroBytes)
 Computes the number of bytes required to store a specified number of zero bytes.
uint computeSegLength (PBuffer segDesc)
 Computes the length of the remaining segments in the current bitmap segment, starting at the one specified by the input segment descriptor.
uint computeSegDescLength (PBuffer segDesc)
 Computes the length of the remaining segment descriptors in the current bitmap segment, starting at the one specified by the input segment descriptor.
uint countSegments ()
 Returns the number of segments in an entry.

Static Protected Member Functions

static uint byteArray2Value (PBuffer array, uint arraySize)
 Get value stored in a byte array.
static uint value2ByteArray (uint value, PBuffer array, uint arraySize)
 Store value in a byte array.
static void readSegDescAndAdvance (PBuffer &pSegDesc, uint &bmSegLen, uint &zeroBytes)
 Decodes the lengths stored in the descriptor for a segment, based on where the segment descriptor is currently pointing, and advances the segment descriptor to the next descriptor.

Protected Attributes

LbmSegmentReader segmentReader
 Segment reader.
bool firstReadDone
 True if initial read has been completed.
uint curByte
 Unread bits from current byte.
LcsRid curRid
 Position in current bit segment.
bool moveNext
 True if need to move to the next bit.
LcsRid nextRid
 Next rid value that should be read.
LcsRid startRID
 Starting rid in the bitmap segment (if singleton, startRID == RID column in entryTuple).
PBuffer pSegDescStart
 Increment forward from pSegDescStart.
PBuffer pSegDescEnd
PBuffer pSegStart
 Decrement backward from pSegStart.
PBuffer pSegEnd

Static Protected Attributes

static const uint LbmHalfByteSize = 4
 Use half of a byte to encode the segment length, or the zero bytes length.
static const uint8_t LbmSegLengthMask = 0xf0
 The upper 4 bits of Segment Descriptor byte is used to store the length of the corresponding segment.
static const uint8_t LbmZeroLengthMask = 0x0f
 The lower 4 bits of Segment Descriptor byte is used to store the length of the "gap" following the corresponding segment(till the next segment or the next LbmEntry).
static const uint LbmZeroLengthCompact = 12
 If the length of zero bytes(a byte composed of 8 bits of 0s) is less than 12, the length can be stored within the segment descriptor.
static const uint LbmZeroLengthExtended
 Additional bytes(maximumn is 3 bytes) in which the length is stored.
static const uint LbmMaxSegSize = 16
 Maximum size(in bytes) for a bitmap segment.

Detailed Description

LbmRidReaderBase provides an interace for reading RIDs from bit segments.

It utilizes LbmSegmentReader to read byte segments and then advances within the byte to find set bits, returning the RIDs corresponding to those bits.

Author:
Zelaine Fong
Version:
Id
//open/dev/fennel/lucidera/bitmap/LbmRidReader.h#10

Definition at line 43 of file LbmRidReader.h.


Member Function Documentation

void LbmRidReaderBase::resetState (  )  [protected]

Resets state variables so next call to rid reader will read a new tuple from the input stream.

Definition at line 61 of file LbmRidReader.cpp.

References curByte, curRid, and moveNext.

Referenced by initCommon(), and searchForNextRid().

00062 {
00063     // set state information so that next call to readRidAndAdvance
00064     // will read "nextRid"
00065     moveNext = false;
00066     curByte = 0;
00067     curRid = LcsRid(7);
00068 }

ExecStreamResult LbmRidReaderBase::searchForNextRid (  )  [protected]

Scans forward in the current byte segment until you hit a set bit.

If the current byte segment is exhausted, new segments are read in.

Returns:
EXECRC_YIELD if rid available for reading

Reimplemented in LbmIterableRidReader.

Definition at line 70 of file LbmRidReader.cpp.

References LbmSegmentReader::advanceToRid(), curByte, curRid, EXECRC_YIELD, firstOneBit, firstReadDone, LbmSegment::LbmOneByteSize, moveNext, nextRid, opaqueToInt(), LbmSegmentReader::readCurrentByteSegment(), resetState(), LbmSegment::roundToByteBoundary(), and segmentReader.

Referenced by advanceToRid(), and readRidAndAdvance().

00071 {
00072     // recompute bitOffset in current byte base on current rid
00073     uint bitOffset = opaqueToInt(curRid) % LbmOneByteSize;
00074 
00075     // get current byte (local copy)
00076     uint b = curByte;
00077 
00078     // if the moveNext flag is set, it means that we are still positioned
00079     // at the bit the user already read, so move forward one bit
00080     if (moveNext) {
00081         bitOffset++;
00082         b >>= 1;
00083         moveNext = false;
00084     }
00085 
00086     while (true) {
00087         // scan forward until we hit a bit that is set, or until we've
00088         // used up all the set bits
00089 
00090         uint shift = firstOneBit[b];
00091         b >>= shift;
00092         bitOffset += shift;
00093 
00094         // if we didn't find anything, then get another byte and try again
00095         if (b == 0) {
00096             bitOffset = 0;
00097 
00098             ExecStreamResult rc = segmentReader.advanceToRid(nextRid);
00099             if (rc != EXECRC_YIELD) {
00100                 resetState();
00101                 return rc;
00102             }
00103             firstReadDone = true;
00104 
00105             // get start rid of the segment just read
00106             uint len;
00107             PBuffer pB;
00108             segmentReader.readCurrentByteSegment(curRid, pB, len);
00109             b = *pB;
00110 
00111             nextRid = curRid + LbmOneByteSize;
00112         } else {
00113             break;
00114         }
00115     }
00116 
00117     // compute current rid, now that we've found a set bit
00118     curRid = roundToByteBoundary(curRid) + bitOffset;
00119     curByte = b;
00120 
00121     return EXECRC_YIELD;
00122 }

void LbmRidReaderBase::initCommon (  )  [protected]

Common initialization method, called by all other init methods.

Reimplemented in LbmIterableRidReader.

Definition at line 54 of file LbmRidReader.cpp.

References firstReadDone, nextRid, and resetState().

Referenced by LbmRidReader::init(), and LbmIterableRidReader::initCommon().

00055 {
00056     firstReadDone = false;
00057     nextRid = LcsRid(0);
00058     resetState();
00059 }

ExecStreamResult LbmRidReaderBase::advanceToRid ( LcsRid  rid  ) 

Advances input to the next rowid >= rid where rowid corresponds to a set bit in a bitmap segment.

Parameters:
rid desired rid
Returns:
EXECRC_YIELD if successfully advanced to a rid

Definition at line 124 of file LbmRidReader.cpp.

References curByte, curRid, EXECRC_YIELD, firstReadDone, LbmSegment::LbmOneByteSize, moveNext, nextRid, opaqueToInt(), LbmSegment::roundToByteBoundary(), and searchForNextRid().

00125 {
00126     assert(firstReadDone);
00127 
00128     // if we are marked for an advance, then treat this rid
00129     // as at least curRid + 1
00130     if (moveNext) {
00131         if (rid < curRid + 1) {
00132             rid = curRid + 1;
00133         }
00134         moveNext = false;
00135     }
00136 
00137     // do we need a new byte?
00138     if (rid >= roundToByteBoundary(curRid) + LbmOneByteSize) {
00139         // mark current byte as invalid, so that call to search
00140         // will read in a new byte with the desired rid
00141         curByte = 0;
00142         nextRid = rid;
00143 
00144         // read in the new byte
00145         ExecStreamResult rc = searchForNextRid();
00146         if (rc != EXECRC_YIELD) {
00147             return rc;
00148         }
00149     }
00150 
00151     // first, move forward to current byte in desired rid
00152     if (rid > curRid) {
00153         curByte >>= opaqueToInt(rid - curRid);
00154         curRid = rid;
00155     }
00156 
00157     // then, advance to first bit that is set
00158     return searchForNextRid();
00159 }

ExecStreamResult LbmRidReaderBase::readRidAndAdvance ( LcsRid &  rid  ) 

Retrieves rid and sets up caller to advance forward to the next set bit in the input for the next call.

Parameters:
rid rid value to be retrieved
Returns:
EXECRC_YIELD if successfully read a rid

Definition at line 161 of file LbmRidReader.cpp.

References curRid, EXECRC_YIELD, moveNext, and searchForNextRid().

Referenced by LcsRowScanExecStream::fillRidRunBuffer(), and LbmIterableRidReader::searchForNextRid().

00162 {
00163     // advance to position we are supposed to be at, and then keep
00164     // advancing until we hit a set bit
00165     ExecStreamResult rc = searchForNextRid();
00166     if (rc != EXECRC_YIELD) {
00167         return rc;
00168     }
00169 
00170     // set return value
00171     rid = curRid;
00172 
00173     // remember to advance the next time this method is called
00174     moveNext = true;
00175 
00176     return EXECRC_YIELD;
00177 }

uint LbmSegment::byteArray2Value ( PBuffer  array,
uint  arraySize 
) [static, protected, inherited]

Get value stored in a byte array.

The least significant bytes in the value is stored at the first location in the array.

Parameters:
array a byte array
arraySize size of the array(number of bytes)
Returns:
the value stored in this array.

Definition at line 27 of file LbmSegment.cpp.

References LbmSegment::LbmOneByteSize.

Referenced by LbmEntry::adjustEntry(), LbmEntry::getCompressedRowCount(), and LbmSegment::readSegDescAndAdvance().

00028 {
00029     uint value = 0;
00030     while (arraySize > 0) {
00031         value = value * (uint)(1 << LbmOneByteSize) + array[arraySize - 1];
00032         arraySize --;
00033     }
00034     return value;
00035 }

uint LbmSegment::value2ByteArray ( uint  value,
PBuffer  array,
uint  arraySize 
) [static, protected, inherited]

Store value in a byte array.

The least significant bytes in the value is stored at the first location in the array.

Parameters:
value 
array a byte array
arraySize size of the array(number of bytes)
Returns:
number of bytes used to store the value; 0 if the value requires more than arraySize bytes to store.

Definition at line 38 of file LbmSegment.cpp.

References LbmSegment::LbmOneByteSize.

Referenced by LbmEntry::setZeroLength().

00039 {
00040     assert(value != 0);
00041 
00042     uint size = 0;
00043 
00044     while (value > 0 && size < arraySize) {
00045         array[size] = (uint8_t)(value & 0xff);
00046         value = value >> LbmOneByteSize;
00047         size ++;
00048     }
00049     /*
00050      * If value is non-zero, it means that the value cannot be encoded
00051      * within an array of arraySize. Return 0 in that case.
00052      */
00053     if (value > 0) {
00054         size = 0;
00055     }
00056 
00057     return size;
00058 }

uint LbmSegment::computeSpaceForZeroBytes ( uint  nZeroBytes  )  [protected, inherited]

Computes the number of bytes required to store a specified number of zero bytes.

Parameters:
nZeroBytes the number of zero bytes to be stored
Returns:
number of bytes required to store the zero bytes; if the length can be encoded in the segment descriptor, 0 is returned.

Definition at line 60 of file LbmSegment.cpp.

References LbmSegment::LbmOneByteSize, and LbmSegment::LbmZeroLengthCompact.

Referenced by LbmEntry::addNewAdjacentSegment(), LbmEntry::addNewMiddleSegment(), and LbmSegment::computeSegDescLength().

00061 {
00062     if (nZeroBytes <= LbmZeroLengthCompact) {
00063         return 0;
00064     }
00065 
00066     uint size = 0;
00067     while (nZeroBytes > 0) {
00068         nZeroBytes = nZeroBytes >> LbmOneByteSize;
00069         size++;
00070     }
00071 
00072     return size;
00073 }

void LbmSegment::readSegDescAndAdvance ( PBuffer pSegDesc,
uint bmSegLen,
uint zeroBytes 
) [static, protected, inherited]

Decodes the lengths stored in the descriptor for a segment, based on where the segment descriptor is currently pointing, and advances the segment descriptor to the next descriptor.

Parameters:
pSegDesc pointer to segment descriptor
bmSegLen returns length of bitmap segment
zeroBytes returns number of trailing zeros in this segment
segment

Definition at line 75 of file LbmSegment.cpp.

References LbmSegment::byteArray2Value(), LbmSegment::LbmHalfByteSize, LbmSegment::LbmZeroLengthCompact, and LbmSegment::LbmZeroLengthMask.

Referenced by LbmSegmentReaderBase::advanceSegment(), LbmSegment::computeSegDescLength(), LbmSegment::computeSegLength(), LbmEntry::containsRid(), LbmSegment::countSegments(), LbmEntry::dumpSeg(), LbmEntry::dumpSegRID(), LbmEntry::generateSegRIDs(), LbmEntry::spliceSingleton(), and LbmEntry::splitEntry().

00077 {
00078     // should only be called in the case where the bit segment has
00079     // a descriptor
00080     assert(pSegDesc != NULL);
00081     bmSegLen = (*pSegDesc >> LbmHalfByteSize) + 1;
00082     uint zeroLen = (*pSegDesc & LbmZeroLengthMask);
00083 
00084     // advance past the initial length byte
00085     pSegDesc++;
00086 
00087     if (zeroLen <= LbmZeroLengthCompact) {
00088         zeroBytes = zeroLen;
00089     } else {
00090         zeroBytes =
00091             byteArray2Value(pSegDesc, zeroLen - LbmZeroLengthCompact);
00092         pSegDesc += zeroLen - LbmZeroLengthCompact;
00093     }
00094 }

uint LbmSegment::computeSegLength ( PBuffer  segDesc  )  [protected, inherited]

Computes the length of the remaining segments in the current bitmap segment, starting at the one specified by the input segment descriptor.

Parameters:
segDesc segment descriptor of the first segment that we want to start computing the length from
Returns:
number of bytes occupied by the remaining segments in the current entry

Definition at line 110 of file LbmSegment.cpp.

References LbmSegment::pSegDescEnd, and LbmSegment::readSegDescAndAdvance().

Referenced by LbmEntry::addNewAdjacentSegment(), and LbmEntry::addNewMiddleSegment().

00111 {
00112     uint segLength = 0;
00113 
00114     while (segDesc < pSegDescEnd) {
00115         uint segBytes;
00116         uint zeroBytes;
00117         readSegDescAndAdvance(segDesc, segBytes, zeroBytes);
00118         segLength += segBytes;
00119     }
00120 
00121     return segLength;
00122 }

uint LbmSegment::computeSegDescLength ( PBuffer  segDesc  )  [protected, inherited]

Computes the length of the remaining segment descriptors in the current bitmap segment, starting at the one specified by the input segment descriptor.

Parameters:
segDesc segment descriptor of the first segment that we want to start computing the length from
Returns:
number of bytes occupied by the remaining segment descriptors in the current entry

Definition at line 96 of file LbmSegment.cpp.

References LbmSegment::computeSpaceForZeroBytes(), LbmSegment::pSegDescEnd, and LbmSegment::readSegDescAndAdvance().

Referenced by LbmEntry::addNewAdjacentSegment(), and LbmEntry::addNewMiddleSegment().

00097 {
00098     uint segDescLength = 0;
00099 
00100     while (segDesc < pSegDescEnd) {
00101         uint segBytes;
00102         uint zeroBytes;
00103         readSegDescAndAdvance(segDesc, segBytes, zeroBytes);
00104         segDescLength += computeSpaceForZeroBytes(zeroBytes) + 1;
00105     }
00106 
00107     return segDescLength;
00108 }

uint LbmSegment::countSegments (  )  [protected, inherited]

Returns the number of segments in an entry.

Definition at line 124 of file LbmSegment.cpp.

References count(), LbmSegment::pSegDescEnd, LbmSegment::pSegDescStart, and LbmSegment::readSegDescAndAdvance().

Referenced by LbmEntry::splitEntry().

00125 {
00126     uint count = 0;
00127 
00128     PBuffer segDesc = pSegDescStart;
00129     while (segDesc < pSegDescEnd) {
00130         uint segBytes;
00131         uint zeroBytes;
00132         readSegDescAndAdvance(segDesc, segBytes, zeroBytes);
00133         count++;
00134     }
00135 
00136     return count;
00137 }

LcsRid LbmSegment::roundToByteBoundary ( LcsRid  rid  )  [inline, static, inherited]

Rounds a rid value down to the nearest byte boundary.

Parameters:
rid value to be rounded
Returns:
rounded rid value

Definition at line 241 of file LbmSegment.h.

References LbmSegment::LbmOneByteSizeBitMask, and opaqueToInt().

Referenced by advanceToRid(), LbmEntry::closeCurrentSegment(), LbmEntryTest::compareExpected(), LbmSplicerExecStream::findBetterEntry(), LbmSplicerExecStream::findBTreeEntry(), LbmEntry::mergeEntry(), LbmEntry::openNewSegment(), LbmSplicerExecStream::ridOverlaps(), searchForNextRid(), LbmEntry::setRIDAdjacentSegByte(), LbmEntry::singleton2Bitmap(), LbmEntryTest::testldb35(), and LbmEntryTest::testZeroBytes().

00242 {
00243     return LcsRid(opaqueToInt(rid) & LbmOneByteSizeBitMask);
00244 }

bool LbmSegment::setSegLength ( uint8_t segDescByte,
uint  segLen 
) [inline, static, inherited]

Sets the length descriptor for a new segment with zero trailing zeros.

Parameters:
segDescByte byte that will be set with the segment length
segLen length of the segment
Returns:
true if length can be encoded in a segment descriptor

Definition at line 246 of file LbmSegment.h.

References LbmSegment::LbmHalfByteSize, and LbmSegment::LbmMaxSegSize.

Referenced by LbmEntry::addNewMiddleSegment(), LbmEntry::addSegDesc(), LbmSegmentWriter::addSegment(), LbmEntry::closeCurrentSegment(), LbmEntry::openLastSegment(), LbmEntry::openNewSegment(), and LbmEntry::setRIDAdjacentSegByte().

00247 {
00248     if (segLen > LbmMaxSegSize) {
00249         return false;
00250     }
00251     segDescByte = (uint8_t) ((segLen - 1) << LbmHalfByteSize);
00252     return true;
00253 }

bool LbmSegment::adjustSegLength ( uint8_t segDescByte,
uint  segLen 
) [inline, static, inherited]

Set segment length in an existing descriptor with the new segment length.

Also, leaves the current zero trailing bytes count untouched

Parameters:
segDescByte segment descriptor byte to be modified
segLen new segment length
Returns:
true if length can be encoded in the segment descriptor

Definition at line 255 of file LbmSegment.h.

References LbmSegment::LbmHalfByteSize, LbmSegment::LbmMaxSegSize, and LbmSegment::LbmSegLengthMask.

Referenced by LbmEntry::addNewAdjacentSegment().

00256 {
00257     if (segLen > LbmMaxSegSize) {
00258         return false;
00259     }
00260     segDescByte &= ~LbmSegLengthMask;
00261     segDescByte |= (uint8_t) ((segLen - 1) << LbmHalfByteSize);
00262     return true;
00263 }

uint LbmSegment::getSegLength ( uint8_t  segDescByte  )  [inline, static, inherited]

Get the segment length encoded in SegmentDescriptor.

Parameters:
segDescByte the seg desc byte with segment length encoded.

Definition at line 265 of file LbmSegment.h.

References LbmSegment::LbmHalfByteSize, and LbmSegment::LbmSegLengthMask.

Referenced by LbmEntry::addNewAdjacentSegment(), LbmEntry::getCompressedRowCount(), and LbmEntry::openLastSegment().

00266 {
00267     return (((segDescByte & LbmSegLengthMask) >> LbmHalfByteSize) + 1);
00268 }

uint LbmSegment::getZeroLengthByteCount ( uint8_t  segDescByte  )  [inline, inherited]

Get the number of bytes to store the length of zero bytes.

Parameters:
segDescByte the seg desc byte with length of zero bytes encoded.

Definition at line 270 of file LbmSegment.h.

References LbmSegment::LbmZeroLengthCompact, and LbmSegment::LbmZeroLengthMask.

Referenced by LbmEntry::openLastSegment(), and LbmEntry::splitEntry().

00271 {
00272     uint lengthBytes = segDescByte & LbmZeroLengthMask;
00273     if (lengthBytes > LbmZeroLengthCompact) {
00274         return (lengthBytes - LbmZeroLengthCompact);
00275     } else {
00276         return 0;
00277     }
00278 }

LcsRid LbmSegment::getStartRID (  )  [inline, inherited]

Returns:
startRID of this bitmap segment

Definition at line 280 of file LbmSegment.h.

References LbmSegment::startRID.

00281 {
00282     return startRID;
00283 }


Member Data Documentation

LbmSegmentReader LbmRidReaderBase::segmentReader [protected]

Segment reader.

Definition at line 49 of file LbmRidReader.h.

Referenced by LbmTupleRidReader::init(), LbmRidReader::init(), and searchForNextRid().

bool LbmRidReaderBase::firstReadDone [protected]

True if initial read has been completed.

Definition at line 54 of file LbmRidReader.h.

Referenced by advanceToRid(), initCommon(), and searchForNextRid().

uint LbmRidReaderBase::curByte [protected]

Unread bits from current byte.

Definition at line 59 of file LbmRidReader.h.

Referenced by advanceToRid(), resetState(), and searchForNextRid().

LcsRid LbmRidReaderBase::curRid [protected]

Position in current bit segment.

Definition at line 64 of file LbmRidReader.h.

Referenced by advanceToRid(), readRidAndAdvance(), resetState(), and searchForNextRid().

bool LbmRidReaderBase::moveNext [protected]

True if need to move to the next bit.

Definition at line 69 of file LbmRidReader.h.

Referenced by advanceToRid(), readRidAndAdvance(), resetState(), and searchForNextRid().

LcsRid LbmRidReaderBase::nextRid [protected]

Next rid value that should be read.

Definition at line 74 of file LbmRidReader.h.

Referenced by advanceToRid(), initCommon(), and searchForNextRid().

LcsRid LbmSegment::startRID [protected, inherited]

Starting rid in the bitmap segment (if singleton, startRID == RID column in entryTuple).

Definition at line 42 of file LbmSegment.h.

Referenced by LbmEntry::adjustEntry(), LbmEntry::containsRid(), LbmSeqSegmentReader::getSrid(), LbmSegment::getStartRID(), LbmEntry::growEntry(), LbmEntry::inRange(), LbmEntry::mergeEntry(), LbmEntry::mergeIntoSplitEntry(), LbmEntry::openLastSegment(), LbmEntry::produceEntryTuple(), LbmSegmentReaderBase::readBitmapSegTuple(), LbmEntry::setEntryTuple(), LbmEntry::singleton2Bitmap(), LbmEntry::spliceSingleton(), and LbmEntry::splitEntry().

PBuffer LbmSegment::pSegDescStart [protected, inherited]

Increment forward from pSegDescStart.

Definition at line 47 of file LbmSegment.h.

Referenced by LbmSegmentReaderBase::advanceSegment(), LbmSegmentReader::advanceToByte(), LbmEntry::containsRid(), LbmSegment::countSegments(), LbmEntry::getRowCount(), LbmSegmentReaderBase::init(), LbmEntry::isSingleBitmap(), LbmEntry::LbmEntry(), LbmEntry::mergeIntoSplitEntry(), LbmEntry::produceEntryTuple(), LbmSegmentReaderBase::readBitmapSegTuple(), LbmSegmentReader::readSegment(), LbmSeqSegmentReader::readSegmentAndAdvance(), LbmEntry::setEntryTuple(), LbmEntry::singleton2Bitmap(), LbmEntry::spliceSingleton(), LbmEntry::splitEntry(), and LbmEntry::toString().

PBuffer LbmSegment::pSegDescEnd [protected, inherited]

Definition at line 48 of file LbmSegment.h.

Referenced by LbmEntry::addNewAdjacentSegment(), LbmEntry::addNewMiddleSegment(), LbmEntry::addSegDesc(), LbmSegmentReader::advanceToByte(), LbmEntry::closeCurrentSegment(), LbmSegment::computeSegDescLength(), LbmSegment::computeSegLength(), LbmEntry::containsRid(), LbmEntry::copyToMergeBuffer(), LbmSegment::countSegments(), LbmEntry::getRowCount(), LbmSegmentReaderBase::init(), LbmEntry::mergeEntry(), LbmEntry::mergeIntoSplitEntry(), LbmEntry::openLastSegment(), LbmEntry::openNewSegment(), LbmEntry::produceEntryTuple(), LbmSegmentReaderBase::readBitmapSegTuple(), LbmSeqSegmentReader::readSegmentAndAdvance(), LbmEntry::setEntryTuple(), LbmEntry::spliceSingleton(), LbmEntry::splitEntry(), and LbmEntry::toString().

PBuffer LbmSegment::pSegStart [protected, inherited]

Decrement backward from pSegStart.

Definition at line 53 of file LbmSegment.h.

Referenced by LbmEntry::adjustEntry(), LbmSegmentReaderBase::advanceSegment(), LbmSegmentReader::advanceToByte(), LbmEntry::containsRid(), LbmSegmentReaderBase::init(), LbmEntry::isSingleton(), LbmEntry::LbmEntry(), LbmEntry::mergeEntry(), LbmEntry::mergeIntoSplitEntry(), LbmEntry::openNewSegment(), LbmEntry::produceEntryTuple(), LbmSegmentReaderBase::readBitmapSegTuple(), LbmSegmentReader::readCurrentByteSegment(), LbmSeqSegmentReader::readSegmentAndAdvance(), LbmEntry::setEntryTuple(), LbmEntry::setRIDAdjacentSegByte(), LbmEntry::spliceSingleton(), LbmEntry::splitEntry(), and LbmEntry::toString().

PBuffer LbmSegment::pSegEnd [protected, inherited]

Definition at line 54 of file LbmSegment.h.

Referenced by LbmEntry::addNewRid(), LbmEntry::adjustEntry(), LbmEntry::containsRid(), LbmEntry::copyToMergeBuffer(), LbmEntry::isSingleton(), LbmEntry::mergeEntry(), LbmEntry::mergeIntoSplitEntry(), LbmEntry::openLastSegment(), LbmEntry::openNewSegment(), LbmEntry::produceEntryTuple(), LbmEntry::setEntryTuple(), LbmEntry::setRIDAdjacentSegByte(), LbmEntry::splitEntry(), and LbmEntry::toString().

const uint LbmSegment::LbmHalfByteSize = 4 [static, protected, inherited]

Use half of a byte to encode the segment length, or the zero bytes length.

Definition at line 60 of file LbmSegment.h.

Referenced by LbmEntry::adjustEntry(), LbmSegment::adjustSegLength(), LbmSegment::getSegLength(), LbmSegment::readSegDescAndAdvance(), and LbmSegment::setSegLength().

const uint8_t LbmSegment::LbmSegLengthMask = 0xf0 [static, protected, inherited]

The upper 4 bits of Segment Descriptor byte is used to store the length of the corresponding segment.

Definition at line 66 of file LbmSegment.h.

Referenced by LbmSegment::adjustSegLength(), and LbmSegment::getSegLength().

const uint8_t LbmSegment::LbmZeroLengthMask = 0x0f [static, protected, inherited]

The lower 4 bits of Segment Descriptor byte is used to store the length of the "gap" following the corresponding segment(till the next segment or the next LbmEntry).

Definition at line 73 of file LbmSegment.h.

Referenced by LbmEntry::addNewAdjacentSegment(), LbmEntry::adjustEntry(), LbmEntry::getCompressedRowCount(), LbmSegment::getZeroLengthByteCount(), LbmSegment::readSegDescAndAdvance(), LbmEntry::setZeroLength(), and LbmEntry::splitEntry().

const uint LbmSegment::LbmZeroLengthCompact = 12 [static, protected, inherited]

If the length of zero bytes(a byte composed of 8 bits of 0s) is less than 12, the length can be stored within the segment descriptor.

Otherwise, the segment descriptor gives the length of additional bytes(maximumn is 3 bytes) in which the length is stored.

Definition at line 81 of file LbmSegment.h.

Referenced by LbmEntry::adjustEntry(), LbmSegment::computeSpaceForZeroBytes(), LbmEntry::getCompressedRowCount(), LbmSegment::getZeroLengthByteCount(), LbmSegment::readSegDescAndAdvance(), and LbmEntry::setZeroLength().

const uint LbmSegment::LbmZeroLengthExtended [static, protected, inherited]

Initial value:

Additional bytes(maximumn is 3 bytes) in which the length is stored.

It is stored with an offset of LbmZeroLengthCompact. LbmZeroLengthExtended = (uint)LbmZeroLengthMask - LbmZeroLengthCompact.

Definition at line 88 of file LbmSegment.h.

Referenced by LbmEntry::getScratchBufferSize(), LbmEntry::init(), and LbmEntry::setZeroLength().

const uint LbmSegment::LbmMaxSegSize = 16 [static, protected, inherited]

Maximum size(in bytes) for a bitmap segment.

This size is limited by the number of bits(=4 bits) in SegDesc to describe the segment length.

Definition at line 95 of file LbmSegment.h.

Referenced by LbmEntry::addSegDesc(), LbmSegment::adjustSegLength(), LbmEntry::closeCurrentSegment(), LbmEntry::getMaxBitmapSize(), LbmEntry::getMergeSpaceRequired(), LbmEntry::setRIDAdjacentSegByte(), and LbmSegment::setSegLength().

const uint LbmSegment::LbmOneByteSize = 8 [static, inherited]

One byte in the bitmap encodes 8 RIDs.

Definition at line 235 of file LbmSegment.h.

Referenced by LbmEntry::addNewAdjacentSegment(), LbmEntry::addNewMiddleSegment(), LbmEntry::addNewRid(), LbmEntry::addNewSegment(), LbmSegmentWriter::addSegment(), LbmEntry::adjustEntry(), advanceToRid(), LbmSegment::byteArray2Value(), LbmMinusExecStream::canSkipMinus(), LbmEntry::closeCurrentSegment(), LbmUnionExecStream::computeRidLimit(), LbmSegment::computeSpaceForZeroBytes(), LbmEntry::containsRid(), LbmEntry::dumpSegRID(), LbmMinusExecStream::execute(), LbmSplicerExecStream::findBetterEntry(), LbmEntryTest::generateBitmaps(), LbmEntryTest::generateCompressedBitmaps(), LbmEntry::generateSegRIDs(), LbmEntryTest::generateSingleBitmaps(), LbmEntry::getCompressedRowCount(), LbmEntry::getRowCount(), LbmIntersectExecStream::intersectSegments(), LbmMinusExecStream::minusSegments(), LbmEntry::openLastSegment(), LbmSegmentReaderBase::readBitmapSegTuple(), LbmSplicerExecStream::ridOverlaps(), searchForNextRid(), LbmEntry::segmentContainsRid(), LbmSegmentReaderBase::setBitsRead(), LbmEntry::setEntryTuple(), LbmEntry::setRID(), LbmEntry::setRIDAdjacentSegByte(), LbmEntry::setRIDSegByte(), LbmEntry::spliceSingleton(), LbmEntry::splitEntry(), LbmEntryTest::testldb35(), LbmEntryTest::testler5920(), LbmEntryTest::testZeroBytes(), and LbmSegment::value2ByteArray().

const uint LbmSegment::LbmOneByteSizeBitShift = 3 [static, inherited]

Definition at line 236 of file LbmSegment.h.

Referenced by byteNumberToRid(), and ridToByteNumber().

const LcsRidPrimitive LbmSegment::LbmOneByteSizeBitMask [static, inherited]

Initial value:

        0xfffffffffffffff8ULL

Definition at line 237 of file LbmSegment.h.

Referenced by LbmSegment::roundToByteBoundary().


The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:35 2009 for Fennel by  doxygen 1.5.1