|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.vlsn.VLSNBucket
com.sleepycat.je.rep.vlsn.GhostBucket
class GhostBucket
A ghost bucket stands in as a placeholder for a set of vlsns that are unknown. This kind of bucket can only be present at the very beginning of the vlsn range. This fulfills an edge case that can arise when vlsns are inserted out of order, and log cleaner truncation lops off the leading edge of the index. For example, suppose vlsns were inserted in this order: vlsnIndex.put(vlsn=2, lsn=1/2) vlsnIndex.put(vlsn=1, lsn=1/0) vlsnIndex.put(vlsn=3, lsn=1/3) ... vlsnIndex.put(vlsn=5, lsn=2/9) vlsnIndex.put(vlsn=4, lsn=2/0) vlsnIndex.put(vlsn=6, lsn=2/10) .. This results in an index that has two buckets. Bucket 1 = {vlsn 2,3} and bucket 2 = {vlsn 5,6}. If we log clean file 1, we will truncate log at vlsn 3, and the new range will be vlsn 4-> vlsn 6. But the beginning and end of each range needs to have a valid bucket, and there is no bucket to represent vlsn 4. A GhostBucket is added to the head of the bucket set.
Field Summary |
---|
Fields inherited from class com.sleepycat.je.rep.vlsn.VLSNBucket |
---|
dirty, firstVLSN, lastVLSN |
Constructor Summary | |
---|---|
GhostBucket(VLSN ghostVLSN,
long firstPossibleLsn,
long lastPossibleLsn)
|
Method Summary | |
---|---|
(package private) long |
getGTELsn(VLSN vlsn)
Return a lsn as a starting point for a backward scan. |
long |
getLsn(VLSN vlsn)
There is no mapping for this VLSN, so always return NULL_LSN. |
(package private) long |
getLTEFileNumber()
Return a file number that is less or equal to the first mapped vlsn, for use in determining the CBVLSN. |
(package private) long |
getLTELsn(VLSN vlsn)
Return a lsn as a starting point for a forward scan. |
(package private) int |
getNumOffsets()
|
(package private) boolean |
isGhost()
|
(package private) static GhostBucket |
makeNewInstance(TupleInput ti)
Ideally, this would be a constructor, but we have to read several items off the tuple input first before calling super(); |
(package private) boolean |
put(VLSN vlsn,
long lsn)
Record the LSN location for this VLSN. |
(package private) VLSNBucket |
removeFromHead(EnvironmentImpl envImpl,
VLSN lastDuplicate)
Remove the mappings from this bucket that are for VLSNs <= lastDuplicate. |
(package private) void |
removeFromTail(VLSN startOfDelete,
long prevLsn)
Remove the mappings from this bucket that are for VLSNs >= startOfDelete. |
String |
toString()
|
(package private) void |
writeToTupleOutput(TupleOutput to)
|
Methods inherited from class com.sleepycat.je.rep.vlsn.VLSNBucket |
---|
close, dump, empty, fillDataEntry, follows, getFirst, getLast, getLastLsn, owns, precedes, readFromDatabase, writeToDatabase, writeToDatabase |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
GhostBucket(VLSN ghostVLSN, long firstPossibleLsn, long lastPossibleLsn)
Method Detail |
---|
static GhostBucket makeNewInstance(TupleInput ti)
boolean isGhost()
isGhost
in class VLSNBucket
void writeToTupleOutput(TupleOutput to)
writeToTupleOutput
in class VLSNBucket
long getGTELsn(VLSN vlsn)
getGTELsn
in class VLSNBucket
long getLTELsn(VLSN vlsn)
getLTELsn
in class VLSNBucket
public long getLsn(VLSN vlsn)
getLsn
in class VLSNBucket
long getLTEFileNumber()
getLTEFileNumber
in class VLSNBucket
boolean put(VLSN vlsn, long lsn)
VLSNBucket
put
in class VLSNBucket
VLSNBucket removeFromHead(EnvironmentImpl envImpl, VLSN lastDuplicate)
VLSNBucket
removeFromHead
in class VLSNBucket
void removeFromTail(VLSN startOfDelete, long prevLsn)
VLSNBucket
removeFromTail
in class VLSNBucket
startOfDelete
- is the VLSN that begins the range to delete,
inclusiveprevLsn
- is the lsn of startOfDelete.getPrev(). We'll be using it
to cap off the end of the bucket, by assigning it to the lastLsn field.int getNumOffsets()
getNumOffsets
in class VLSNBucket
public String toString()
toString
in class VLSNBucket
Object.toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |