protected class AbstractJournalRM.CollectorDaemon.CollectionCoordinator extends Object
The CollectionCoordinator is also responsible for finalizing a collection which in this context acts as a barrier to clients exposing the memory reclaimed during the evacuation.
| Modifier | Constructor and Description | 
|---|---|
protected  | 
CollectionCoordinator()  | 
| Modifier and Type | Method and Description | 
|---|---|
protected void | 
actionable(AbstractJournalRM.JournalFile jrnlFile)
Inform the CollectionCoordinator of an item that could be actioned
 if the CollectorDaemon was to execute. 
 | 
protected double | 
calculateCurrentLoadFactor()
Calculate current load factor for compaction (GC). 
 | 
AbstractJournalRM.JournalFile | 
ensureReservedFile()
Return a reserved file. 
 | 
protected void | 
evacuate(AbstractJournalRM.JournalFile jrnlFile)
Inform the CollectionCoordinator of a  
AbstractJournalRM.JournalFile about
 to be evacuated. | 
void | 
exhaustiveEvac(int cBytes,
              boolean fWait)
Request the CollectorDaemon to perform an exhaustive evacuation
 and block this thread until the collection is complete. 
 | 
protected void | 
finalizeCollection()
Inform the CollectionCoordinator that a collection is complete
 and changes should be exposed. 
 | 
int | 
getAvgEvacuationMillis()
Determine the average number of milliseconds to evacuate a file. 
 | 
int | 
getEvacuatedFileCount()
Return the number of files evacuated since the statistics
 were reset. 
 | 
int | 
getExhaustiveCompactionCount()
Return the total number of exhaustive evacuations performed
 by the collector. 
 | 
long | 
getExhaustiveCompactionTime()
Return the number of milliseconds it took to perform exhaustive
 evacuations by the collector. 
 | 
AbstractJournalRM.JournalFile | 
getFinalJournalFile()
Return a  
AbstractJournalRM.JournalFile based on the context of the calling
 thread or null if it is determined that an exhaustive evacuation
 will not reclaim sufficient memory. | 
int | 
getMaxEvacuationMillis()
Determine the maximum number of milliseconds to evacuate a file. 
 | 
int | 
getReservedFileId()
Return the reserved file id. 
 | 
protected long | 
getWaitTime()
Return the amount of time the collector should wait prior to
 the next collection. 
 | 
boolean | 
hasReclaimedMemory()
Return true if memory has been reclaimed by evacuating a journal
 file or discarding of a garbage file. 
 | 
protected boolean | 
isExhaustiveEvacuation()
Return whether this is an exhaustive evacuation. 
 | 
void | 
onReleased(int cbReleased,
          int nFileId)
Notify the CollectionCoordinator that a  
AbstractJournalRM.JournalFile
 has released the provided amount of memory. | 
void | 
onStart()
Inform the CollectionCoordinator that a collection is about
 to commence. 
 | 
protected void | 
reclaimJournalFile(AbstractJournalRM.JournalFile jrnlFile)
A  
AbstractJournalRM.JournalFile has been dereferenced thus memory has
 been reclaimed. | 
protected void | 
release()
Release the reserved file(s) used thus far into the RM's  
AbstractJournalRM.JournalFile pool so that they are linked appropriately. | 
void | 
resetStatistics()
Reset the collector statistics. 
 | 
protected boolean | 
shouldExecuteFullGc()
Return whether an exhaustive evacuation should be executed. 
 | 
public AbstractJournalRM.JournalFile getFinalJournalFile()
AbstractJournalRM.JournalFile based on the context of the calling
 thread or null if it is determined that an exhaustive evacuation
 will not reclaim sufficient memory.
 This method should only be invoked in a "depleted" state when:
 non-appending
   When called on the CollectorDaemon thread this method returns a normal JournalFile, with the only exception that it will be in excess to the maximum number of permitted journal files and used exclusively by the CollectorDaemon to perform evacuation in a depleted state.
null may be returned if it is determined that an exhaustive
         evacuation will not reclaim sufficient memorypublic void exhaustiveEvac(int cBytes,
                           boolean fWait)
cBytes - the number of bytes required by this store requestfWait - whether to block the calling thread until sufficient
                memory has been reclaimedpublic void onReleased(int cbReleased,
                       int nFileId)
AbstractJournalRM.JournalFile
 has released the provided amount of memory.cbReleased - the number of bytes releasednFileId - the journal file id that was released frompublic int getReservedFileId()
public int getEvacuatedFileCount()
public int getExhaustiveCompactionCount()
public long getExhaustiveCompactionTime()
public int getAvgEvacuationMillis()
public int getMaxEvacuationMillis()
public void resetStatistics()
public AbstractJournalRM.JournalFile ensureReservedFile()
This method is only invoked in a 'depleted' state in which no more journal files can be created thus the reserved slot in the JournalFile[] must be used. This slot is reserved exclusively for the CollectorDaemon.
public void onStart()
protected void finalizeCollection()
protected long getWaitTime()
protected void actionable(AbstractJournalRM.JournalFile jrnlFile)
protected void evacuate(AbstractJournalRM.JournalFile jrnlFile)
AbstractJournalRM.JournalFile about
 to be evacuated.jrnlFile - a journal file about to be evacuatedprotected void reclaimJournalFile(AbstractJournalRM.JournalFile jrnlFile)
AbstractJournalRM.JournalFile has been dereferenced thus memory has
 been reclaimed.jrnlFile - the journal file that has transitionedprotected boolean isExhaustiveEvacuation()
public boolean hasReclaimedMemory()
protected double calculateCurrentLoadFactor()
protected void release()
AbstractJournalRM.JournalFile pool so that they are linked appropriately.
 Additionally expose the slots that were free'd allowing clients
 awoken to carry out store requests.
 
 Calls to release when in exhaustive evacuation mode must
 hold the lock f_lockClientGC prior to calling release.
protected boolean shouldExecuteFullGc()