com.sleepycat.je.cleaner
Class FileSelector

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

 class FileSelector
extends Object

Keeps track of the status of files for which cleaning is in progres.


Constructor Summary
FileSelector()
           
 
Method Summary
(package private)  void addCleanedFile(Long fileNum)
          When cleaning is complete, move the file from the to-be-cleaned set to the cleaned set.
(package private)  void addPendingLN(LN ln, DatabaseId dbId, byte[] key, byte[] dupKey)
          Adds the given LN info to the pending LN set.
(package private)  Set copySafeToDeleteFiles()
          Returns a copy of the safe-to-delete files.
(package private)  Set[] getFilesAtCheckpointStart()
          Returns a copy of the cleaned and fully-processed files at the time a checkpoint starts.
(package private)  LNInfo[] getPendingLNs()
          Returns an array of LNInfo for LNs that could not be migrated in a prior cleaning attempt, or null if no LNs are pending.
(package private)  boolean isFileCleaningInProgress(Long file)
          Returns whether the file is in any stage of the cleaning process.
(package private)  void removeDeletedFile(Long fileNum)
          Removes file from the safe-to-delete set after the file itself has finally been deleted.
(package private)  void removePendingLN(long nodeId)
          Removes the LN for the given node ID from the pending LN set.
(package private)  List selectFilesForCleaning(UtilizationProfile profile, boolean forceCleaning, Set lowUtilizationFiles, int maxBatchFiles)
          Returns the best file that qualifies for cleaning, or null if no file qualifies.
(package private)  void updateFilesAtCheckpointEnd(Set[] files)
          When a checkpoint is complete, moves the previously cleaned and fully-processed files to the checkpointed and safe-to-delete sets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSelector

FileSelector()
Method Detail

selectFilesForCleaning

List selectFilesForCleaning(UtilizationProfile profile,
                            boolean forceCleaning,
                            Set lowUtilizationFiles,
                            int maxBatchFiles)
                      throws DatabaseException
Returns the best file that qualifies for cleaning, or null if no file qualifies. This method is not thread safe and should only be called from the cleaner thread.

Parameters:
forceCleaning - is true to always select a file, even if its utilization is above the minimum utilization threshold.
lowUtilizationFiles - is a returned set of files that are below the minimum utilization threshold.
maxBatchFiles - is the maximum number of files to be selected at one time, or zero if there is no limit.
Returns:
a copy of the selected list of files, in the order to be cleaned.
Throws:
DatabaseException

isFileCleaningInProgress

boolean isFileCleaningInProgress(Long file)
Returns whether the file is in any stage of the cleaning process.


addCleanedFile

void addCleanedFile(Long fileNum)
When cleaning is complete, move the file from the to-be-cleaned set to the cleaned set.


getFilesAtCheckpointStart

Set[] getFilesAtCheckpointStart()
Returns a copy of the cleaned and fully-processed files at the time a checkpoint starts.


updateFilesAtCheckpointEnd

void updateFilesAtCheckpointEnd(Set[] files)
When a checkpoint is complete, moves the previously cleaned and fully-processed files to the checkpointed and safe-to-delete sets.


addPendingLN

void addPendingLN(LN ln,
                  DatabaseId dbId,
                  byte[] key,
                  byte[] dupKey)
Adds the given LN info to the pending LN set.


getPendingLNs

LNInfo[] getPendingLNs()
Returns an array of LNInfo for LNs that could not be migrated in a prior cleaning attempt, or null if no LNs are pending.


removePendingLN

void removePendingLN(long nodeId)
Removes the LN for the given node ID from the pending LN set.


copySafeToDeleteFiles

Set copySafeToDeleteFiles()
Returns a copy of the safe-to-delete files.


removeDeletedFile

void removeDeletedFile(Long fileNum)
Removes file from the safe-to-delete set after the file itself has finally been deleted.



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