com.sleepycat.je.dbi
Class INList

java.lang.Object
  extended by com.sleepycat.je.dbi.INList
All Implemented Interfaces:
java.lang.Iterable<IN>

public class INList
extends java.lang.Object
implements java.lang.Iterable<IN>

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


Constructor Summary
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 at shutdown and release its portion of the memory budget.
 boolean contains(IN in)
           
 void dump()
           
 void enable()
          Enable the INList during recovery.
 int getSize()
           
 java.util.Iterator<IN> iterator()
          Return an iterator over the main 'ins' set.
 void memRecalcBegin()
          We are starting the iteration of the INList.
 void memRecalcEnd(boolean completed)
          The reset operation is over.
 void memRecalcIterate(IN in)
          An IN was encountered during the iteration through the entire INList.
 void memRecalcUpdate(IN in, long delta)
          The size of an IN is changing.
 void remove(IN in)
          An IN is being evicted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

INList

public INList(INList orig,
              EnvironmentImpl envImpl)
       throws DatabaseException
Used only by tree verifier when validating INList.

Throws:
DatabaseException
Method Detail

getSize

public int getSize()

contains

public boolean contains(IN in)

enable

public void enable()
Enable the INList during recovery.


add

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

Throws:
DatabaseException

remove

public void remove(IN in)
            throws DatabaseException
An IN is being evicted.

Throws:
DatabaseException

iterator

public java.util.Iterator<IN> iterator()
Return an iterator over the main 'ins' set. Returned iterator may or may not show elements added or removed after the iterator is created.

Specified by:
iterator in interface java.lang.Iterable<IN>
Returns:
an iterator over the main 'ins' set.

clear

public void clear()
           throws DatabaseException
Clear the entire list at shutdown and release its portion of the memory budget.

Throws:
DatabaseException

dump

public void dump()

memRecalcBegin

public void memRecalcBegin()
We are starting the iteration of the INList. Flip the INList toggle and set the total amount to zero. After calling this method, memRecalcEnd must be called in a finally block. If it is not called, internal state will be invalid.


memRecalcIterate

public void memRecalcIterate(IN in)
An IN was encountered during the iteration through the entire INList. Add its size to the recalc total if we have not already processed it, and mark it as processed. If it was already processed, memRecalcAdd must have been called for the IN when it was added to the INList during the iteration.


memRecalcUpdate

public void memRecalcUpdate(IN in,
                            long delta)
The size of an IN is changing. Add the delta to the recalc total if it have already processed the IN. If we have not yet processed it, its total size will be added by memRecalcIterate.


memRecalcEnd

public void memRecalcEnd(boolean completed)
The reset operation is over. Only update the tree budget if the iteration was completed and the state was consistent prior to this reset operation.