com.sleepycat.je.rep.vlsn
Class VLSNIndex.ForwardVLSNScanner
java.lang.Object
com.sleepycat.je.rep.vlsn.VLSNIndex.ForwardVLSNScanner
- Enclosing class:
- VLSNIndex
public static class VLSNIndex.ForwardVLSNScanner
- extends Object
Scans VLSNs in a forward direction, used by feeders.
Method Summary |
long |
getApproximateLsn(VLSN vlsn)
When doing an approximate search, the target vlsn may be a non-mapped
vlsn within a bucket, or it may be between two different buckets. |
long |
getPreciseLsn(VLSN vlsn)
|
long |
getStartingLsn(VLSN vlsn)
Use the <= mapping to the requested VLSN to find the starting lsn to
use for a scan. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
VLSNIndex.ForwardVLSNScanner
public VLSNIndex.ForwardVLSNScanner(VLSNIndex vlsnIndex)
getStartingLsn
public long getStartingLsn(VLSN vlsn)
- Use the <= mapping to the requested VLSN to find the starting lsn to
use for a scan. This can only be used on a VLSN that is known to be
in the range.
getPreciseLsn
public long getPreciseLsn(VLSN vlsn)
- Parameters:
vlsn
- We're requesting a LSN mapping for this vlsn
- Returns:
- If there is a mapping for this VLSN, return it, else return
NULL_LSN. We assume that we checked that this VLSN is in the
VLSNIndex's range.
- See Also:
VLSNIndex.BackwardVLSNScanner.getPreciseLsn(com.sleepycat.je.utilint.VLSN)
getApproximateLsn
public long getApproximateLsn(VLSN vlsn)
- When doing an approximate search, the target vlsn may be a non-mapped
vlsn within a bucket, or it may be between two different buckets.
For example, suppose we have two buckets:
vlsn 1 -> lsn 10
vlsn 5 -> lsn 50
vlsn 7 -> lsn 70
vlsn 20 -> lsn 120
vlsn 25 -> lsn 125
If the vlsn we are looking for is 4, the LTE lsn for an approximate
return value will be vlsn 1-> lsn 10, in the same bucket. If we are
looking for vlsn 9, the LTE lsn for an approximate return value will
be vlsn 7->lsn 70, which is the last mapping in an earlier bucket.
- Parameters:
vlsn
- We're requesting a LSN mapping for this vlsn
- Returns:
- If there is a mapping for this VLSN, return it. If it does
not exist, return the nearest non-null mapping, where nearest the
<= LSN. We assume that we checked that this VLSN is in the
VLSNIndex's range.
Copyright (c) 2004-2012 Oracle. All rights reserved.