com.sleepycat.je.cleaner
Class TrackedFileSummary

java.lang.Object
  extended by com.sleepycat.je.cleaner.FileSummary
      extended by com.sleepycat.je.cleaner.TrackedFileSummary
All Implemented Interfaces:
LogReadable, LogWritable

public class TrackedFileSummary
extends FileSummary

Delta file summary info for a tracked file. Tracked files are managed by the UtilizationTracker.

The methods in this class for reading obsolete offsets may be used by multiple threads without synchronization even while another thread is adding offsets. This is possible because elements are never deleted from the lists. The thread adding obsolete offsets does so under the log write latch to prevent multiple threads from adding concurrently.


Field Summary
 
Fields inherited from class com.sleepycat.je.cleaner.FileSummary
obsoleteINCount, obsoleteLNCount, totalCount, totalINCount, totalINSize, totalLNCount, totalLNSize, totalSize
 
Constructor Summary
TrackedFileSummary(UtilizationTracker tracker, long fileNum, boolean trackDetail)
          Creates an empty tracked summary.
 
Method Summary
(package private)  void addTrackedSummary(TrackedFileSummary other)
          Adds the obsolete offsets as well as the totals of the given object.
(package private)  boolean containsObsoleteOffset(long offset)
          Returns whether the given offset is present in the tracked offsets.
 boolean getAllowFlush()
          Returns whether this summary is allowed or prohibited from being flushed or evicted during cleaning.
 long getFileNumber()
          Returns the file number being tracked.
(package private)  int getMemorySize()
          Return the total memory size for this object.
 long[] getObsoleteOffsets()
          Returns obsolete offsets as an array of longs, or null if none.
 void reset()
          Overrides reset for a tracked file, and is called when a FileSummaryLN is written to the log.
(package private)  void setAllowFlush(boolean allowFlush)
          Allows or prohibits this summary from being flushed or evicted during cleaning.
(package private)  void trackObsolete(long offset)
          Tracks the given offset as obsolete or non-obsolete.
 
Methods inherited from class com.sleepycat.je.cleaner.FileSummary
add, dumpLog, getEntriesCounted, getLogSize, getNonObsoleteCount, getObsoleteINSize, getObsoleteLNSize, getObsoleteSize, getTransactionId, isEmpty, logEntryIsTransactional, readFromLog, toString, writeToLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TrackedFileSummary

TrackedFileSummary(UtilizationTracker tracker,
                   long fileNum,
                   boolean trackDetail)
Creates an empty tracked summary.

Method Detail

getAllowFlush

public boolean getAllowFlush()
Returns whether this summary is allowed or prohibited from being flushed or evicted during cleaning. By default, flushing is allowed.


setAllowFlush

void setAllowFlush(boolean allowFlush)
Allows or prohibits this summary from being flushed or evicted during cleaning. By default, flushing is allowed.


getFileNumber

public long getFileNumber()
Returns the file number being tracked.


getMemorySize

int getMemorySize()
Return the total memory size for this object. We only bother to budget obsolete detail, not the overhead for this object, for two reasons: 1) The number of these objects is very small, and 2) unit tests disable detail tracking as a way to prevent budget adjustments here.


reset

public void reset()
Overrides reset for a tracked file, and is called when a FileSummaryLN is written to the log.

Must be called under the log write latch.

Overrides:
reset in class FileSummary

trackObsolete

void trackObsolete(long offset)
Tracks the given offset as obsolete or non-obsolete.

Must be called under the log write latch.


addTrackedSummary

void addTrackedSummary(TrackedFileSummary other)
Adds the obsolete offsets as well as the totals of the given object.


getObsoleteOffsets

public long[] getObsoleteOffsets()
Returns obsolete offsets as an array of longs, or null if none.


containsObsoleteOffset

boolean containsObsoleteOffset(long offset)
Returns whether the given offset is present in the tracked offsets. This does not indicate whether the offset is obsolete in general, but only if it is known to be obsolete in this version of the tracked information.



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