com.sleepycat.je.cleaner
Interface FileRetryInfo


interface FileRetryInfo

Cleaner retry information for a log file.

When retry information is maintained, a log file is divided into two parts: the processed part and the unprocessed part.

The processed part always starts at the beginning of the file and has been fully cleaned except for pending entries. Those entries are returned by the pendingLsnIterator() method, and should be retried when the file is processed again.

The unprocessed part follows the processed part and starts with the LSN returned by the getFirstUnprocessedLsn() method. All entries in the log from that LSN onward, including INs, should be cleaned when the file is processed. The unprocessed part of the file is present only if the isFileFullyProcessed() method returns false.

When there are no more pending entries in the processed part of the file and the file is fully processed, the canFileBeDeleted() method will return true and the file should be deleted.


Method Summary
 boolean canFileBeDeleted()
          Returns whether all LSNs are obsolete.
 void endProcessing(boolean deleted)
          Ends processing of one cleaner cycle and indicates whether the file was actually deleted by the cleaner.
 Long getFileNumber()
          Returns the log file number.
 long getFirstUnprocessedLsn()
          When isFileFullyProcessed() is false, returns the first LSN for processing the file or null to start at the beginning of the file.
 long[] getPendingLsns()
          Returns an iterator of DbLsn objects collected in a prior cleaning attempt when setPendingLN was called, or null if no LNs are pending.
 boolean isFileFullyProcessed()
          Returns true if all entries were previously processed, or false if more entries should be processed starting with getFirstUnprocessedLsn().
 boolean isObsoleteLN(long lsn, long nodeId)
          Returns whether the given LN is known to be obsolete.
 void setFileFullyProcessed()
          Specifies that the file has been fully processed and only pending LNs may prevent the file from being deleted.
 void setFirstUnprocessedLsn(long lsn)
          Specifies that all LSNs from the given LSN have not been processed.
 void setObsoleteLN(long lsn, long nodeId)
          Changes the status of a given LN to obsolete.
 void setPendingLN(long lsn, long nodeId)
          Changes the status of a given LN to pending.
 

Method Detail

getFileNumber

public Long getFileNumber()
Returns the log file number.


endProcessing

public void endProcessing(boolean deleted)
Ends processing of one cleaner cycle and indicates whether the file was actually deleted by the cleaner.


canFileBeDeleted

public boolean canFileBeDeleted()
Returns whether all LSNs are obsolete.


setFileFullyProcessed

public void setFileFullyProcessed()
Specifies that the file has been fully processed and only pending LNs may prevent the file from being deleted.


isFileFullyProcessed

public boolean isFileFullyProcessed()
Returns true if all entries were previously processed, or false if more entries should be processed starting with getFirstUnprocessedLsn().


setFirstUnprocessedLsn

public void setFirstUnprocessedLsn(long lsn)
Specifies that all LSNs from the given LSN have not been processed.


getFirstUnprocessedLsn

public long getFirstUnprocessedLsn()
When isFileFullyProcessed() is false, returns the first LSN for processing the file or null to start at the beginning of the file.


getPendingLsns

public long[] getPendingLsns()
Returns an iterator of DbLsn objects collected in a prior cleaning attempt when setPendingLN was called, or null if no LNs are pending.


isObsoleteLN

public boolean isObsoleteLN(long lsn,
                            long nodeId)
Returns whether the given LN is known to be obsolete.


setObsoleteLN

public void setObsoleteLN(long lsn,
                          long nodeId)
Changes the status of a given LN to obsolete.


setPendingLN

public void setPendingLN(long lsn,
                         long nodeId)
Changes the status of a given LN to pending.



Copyright 2004 Sleepycat, Inc. All Rights Reserved.