com.sleepycat.je.cleaner
Class DbFileSummaryMap

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

public class DbFileSummaryMap
extends java.lang.Object


Constructor Summary
DbFileSummaryMap(boolean countParentMapEntry)
          Creates a map of Long file number to DbFileSummary.
 
Method Summary
 boolean contains(java.lang.Long fileNum)
           
 java.util.Set<java.util.Map.Entry<java.lang.Long,DbFileSummary>> entrySet()
           
 DbFileSummary get(java.lang.Long fileNum, boolean adjustMemBudget, boolean checkResurrected, FileManager fileManager)
          Returns the DbFileSummary for the given file, allocating it if necessary.
 long getMemorySize()
           
 void init(EnvironmentImpl env)
          Starts memory budgeting.
 boolean remove(java.lang.Long fileNum)
          Removes the DbFileSummary for the given file.
 void repair(EnvironmentImpl env)
          Removes entries for deleted files that were created by JE 3.3.74 and earlier.
 int size()
           
 void subtractFromMemoryBudget()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DbFileSummaryMap

public DbFileSummaryMap(boolean countParentMapEntry)
Creates a map of Long file number to DbFileSummary. The init() method must be called after creating this object.

Always counts this object and its contained objects in the memory budget. If countParentMapEntry is true, also counts a single HashMap entry that contains this object. This option allows all memory budget adjustments for LocalUtilizationTracker to be contained in this class.

Method Detail

init

public void init(EnvironmentImpl env)
Starts memory budgeting. The map and its entries will be counted in the budget. When adding entries via the get() method prior to calling this method, the adjustMemBudget parameter must be false. After calling this method, the adjustMemBudget parameter must be true.

This method is separate from the constructor so that the map may be read from the log without having the EnvironmentImpl object available.


get

public DbFileSummary get(java.lang.Long fileNum,
                         boolean adjustMemBudget,
                         boolean checkResurrected,
                         FileManager fileManager)
Returns the DbFileSummary for the given file, allocating it if necessary.

Must be called under the log write latch.

Parameters:
fileNum - the file identifying the summary.
adjustMemBudget - see init().
checkResurrected - is true if this method should check fileNum and return null if the file does not exist.
fileManager - is used to check for resurrected files and may be null if checkResurrected is false.

remove

public boolean remove(java.lang.Long fileNum)
Removes the DbFileSummary for the given file.

Must be called under the log write latch.


getMemorySize

public long getMemorySize()

subtractFromMemoryBudget

public void subtractFromMemoryBudget()

entrySet

public java.util.Set<java.util.Map.Entry<java.lang.Long,DbFileSummary>> entrySet()

contains

public boolean contains(java.lang.Long fileNum)

size

public int size()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

repair

public void repair(EnvironmentImpl env)
Removes entries for deleted files that were created by JE 3.3.74 and earlier. [#16610]