com.sleepycat.je.dbi
Class INList

java.lang.Object
  extended by com.sleepycat.je.dbi.INList

public class INList
extends Object

The INList is a list of in-memory INs for a given environment.


Constructor Summary
INList(EnvironmentImpl envImpl)
           
INList(INList orig, EnvironmentImpl envImpl)
          Used only by tree verifier when validating INList.
 
Method Summary
 void add(IN in)
          An IN has just come into memory, add it to the list.
 void clear()
          Clear the entire list during recovery and at shutdown.
(package private)  void clearDb(DatabaseImpl dbImpl)
          Lower the generation of any IN's belonging to this deleted database so they evict quickly.
 void dump()
           
 IN first()
           
 SortedSet getINs()
           
 int getSize()
           
 Iterator iterator()
          Return an iterator over the main 'ins' set.
 void latchMajor()
          The locking hierarchy is: 1.
 void releaseMajorLatch()
           
 void releaseMajorLatchIfHeld()
           
 void remove(IN in)
          An IN is getting swept or is displaced by recovery.
 void removeLatchAlreadyHeld(IN in)
          An IN is getting evicted or is displaced by recovery.
 SortedSet tailSet(IN in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

INList

INList(EnvironmentImpl envImpl)

INList

public INList(INList orig,
              EnvironmentImpl envImpl)
       throws DatabaseException
Used only by tree verifier when validating INList. Must be called with orig.majorLatch acquired.

Throws:
DatabaseException
Method Detail

getINs

public SortedSet getINs()

getSize

public int getSize()

add

public void add(IN in)
         throws DatabaseException
An IN has just come into memory, add it to the list.

Throws:
DatabaseException

removeLatchAlreadyHeld

public void removeLatchAlreadyHeld(IN in)
                            throws DatabaseException
An IN is getting evicted or is displaced by recovery. Caller is responsible for acquiring the major latch before calling this and releasing it when they're done.

Throws:
DatabaseException

remove

public void remove(IN in)
            throws DatabaseException
An IN is getting swept or is displaced by recovery.

Throws:
DatabaseException

tailSet

public SortedSet tailSet(IN in)
                  throws DatabaseException
Throws:
DatabaseException

first

public IN first()
         throws DatabaseException
Throws:
DatabaseException

iterator

public Iterator iterator()
Return an iterator over the main 'ins' set. Returned iterator will not show the elements in addedINs. The major latch should be held before entering. The caller is responsible for releasing the major latch when they're finished with the iterator.

Returns:
an iterator over the main 'ins' set.

clear

public void clear()
           throws DatabaseException
Clear the entire list during recovery and at shutdown.

Throws:
DatabaseException

dump

public void dump()

latchMajor

public void latchMajor()
                throws DatabaseException
The locking hierarchy is: 1. INList major latch. 2. IN latch. In other words, the INList major latch must be taken before any IN latches to avoid deadlock.

Throws:
DatabaseException

releaseMajorLatchIfHeld

public void releaseMajorLatchIfHeld()
                             throws DatabaseException
Throws:
DatabaseException

releaseMajorLatch

public void releaseMajorLatch()
                       throws DatabaseException
Throws:
DatabaseException

clearDb

void clearDb(DatabaseImpl dbImpl)
       throws DatabaseException
Lower the generation of any IN's belonging to this deleted database so they evict quickly.

Throws:
DatabaseException


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