com.sleepycat.je.cleaner
Class OffsetList

java.lang.Object
  extended by com.sleepycat.je.cleaner.OffsetList

public class OffsetList
extends java.lang.Object

List of LSN offsets as a linked list of segments. The reasons for using a list of this type and not a java.util.List are:

The algorithms here use traversal of the list segments rather than recursion to avoid using a lot of stack space.


Nested Class Summary
static class OffsetList.Segment
          One segment of a OffsetList containing at most SEGMENT_CAPACITY values.
 
Constructor Summary
OffsetList()
           
 
Method Summary
 boolean add(long value, boolean checkDupOffsets)
          Adds the given value and returns whether a new segment was allocated.
 int size()
           
 long[] toArray()
          Returns an array of all values as longs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OffsetList

public OffsetList()
Method Detail

add

public boolean add(long value,
                   boolean checkDupOffsets)
Adds the given value and returns whether a new segment was allocated.


size

public int size()

toArray

public long[] toArray()
Returns an array of all values as longs. If a writer thread is appending to the list while this method is excuting, some values may be missing from the returned array, but the operation is safe.