com.sleepycat.je.cleaner
Class OffsetList

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

 class OffsetList
extends 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.


Field Summary
(package private) static int SEGMENT_CAPACITY
           
 
Constructor Summary
OffsetList()
           
 
Method Summary
(package private)  boolean add(long value, boolean checkDupOffsets)
          Adds the given value and returns whether a new segment was allocated.
(package private)  boolean contains(long offset)
          Returns whether this list contains the given offset.
(package private)  boolean merge(OffsetList other)
          Merges the given list and returns whether a segment was freed.
(package private)  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
 

Field Detail

SEGMENT_CAPACITY

static final int SEGMENT_CAPACITY
See Also:
Constant Field Values
Constructor Detail

OffsetList

OffsetList()
Method Detail

add

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


merge

boolean merge(OffsetList other)
Merges the given list and returns whether a segment was freed.


toArray

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.


contains

boolean contains(long offset)
Returns whether this list contains the given offset.



Copyright 2004-2005 Sleepycat, Inc. All Rights Reserved.