Package com.tangosol.io.journal
Class AbstractJournalRM.CollectorDaemon
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.Daemon
com.tangosol.io.journal.AbstractJournalRM.CollectorDaemon
- Enclosing class:
- AbstractJournalRM
The CollectorDaemon evaluates the JournalFile objects to see which ones
 should be evacuated, it evacuates those that should be, and it deletes
 those that have been successfully evacuated.
 
This daemon is not intended to be guarded.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classA CollectionCoordinator is responsible for shaping an evacuation as well as managing any reserved files created to ensure the journal continues to operate.protected classAAbstractJournalRM.JournalFileimplementation returned when the journal has consumed all known capacity.Nested classes/interfaces inherited from class com.tangosol.util.DaemonDaemon.DaemonWorkerNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field Summary
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voiddedupe()Give the in-memory radix key stores a chance to de-dupe their byte[] values, similar to the concept behind String's intern() method.protected StringFormat the Daemon attributes into a String for inclusion in the String returned from theDaemon.toString()method.protected intReturn the currently reserved file id.protected Daemon.DaemonWorkerInstantiate a DaemonWorker that will be used as a daemon.voidnotifyReleased(int cbReleased, int nFileId) Notifies the collector that aAbstractJournalRM.JournalFilehas had some memory released.voidrun()The daemon's implementation method.protected voidsetGuardPolicy(Guardian guardian, long cTimeoutMillis, float flPctRecover) Set the Guardian and policy to guard this Daemon with.protected Iterator<AbstractJournalRM.JournalFile> Returns a sortedIteratorbased on the amount of released memory in eachAbstractJournalRM.JournalFile.voidstop()Request the daemon to stop.Methods inherited from class com.tangosol.util.DaemonchangeState, configureWorker, ensureThreadGroup, finishStarting, finishStopping, getConfiguredName, getConfiguredPriority, getContext, getGuardRegisterAction, getMaxWaitMillis, getState, getThread, getThreadContextClassLoader, getWorker, guardIfNeeded, heartbeat, heartbeat, isGuarded, isOnWorkerThread, isRunning, isStopping, recover, setConfiguredName, setConfiguredPriority, setContext, setGuardRegisterAction, setThreadContextClassLoader, shutdown, start, terminate, toStateString, toStringMethods inherited from class com.tangosol.util.Baseazzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mergeArray, mergeBooleanArray, mergeByteArray, mergeCharArray, mergeDoubleArray, mergeFloatArray, mergeIntArray, mergeLongArray, mod, mod, newHashMap, newHashMap, newHashSet, newHashSet, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
- 
Constructor Details- 
CollectorDaemonpublic CollectorDaemon()Construct a CollectorDaemon.
 
- 
- 
Method Details- 
instantiateWorkerInstantiate a DaemonWorker that will be used as a daemon.- Overrides:
- instantiateWorkerin class- Daemon
- Returns:
- a new instance of DaemonWorker or a sub-class thereof
 
- 
stoppublic void stop()Request the daemon to stop. This method will only have an effect if the daemon sub-class respects the value returned fromDaemon.isStopping().
- 
runpublic void run()The daemon's implementation method. Override this method to implement a daemon.An example implementation is: while (!isStopping()) { // do some processing // ... synchronized (this) { // wait for notification of more work wait(); } }
- 
setGuardPolicySet the Guardian and policy to guard this Daemon with. The Daemon is registered with the specified Guardian each time the Daemon is started, and is released each time the Daemon is stopped.- Overrides:
- setGuardPolicyin class- Daemon
- Parameters:
- guardian- the Guardian that will be guarding this Daemon
- cTimeoutMillis- the timeout in ms for this Daemon, or 0 for the service guardian timeout
- flPctRecover- the recovery percentage for this Daemon
 
- 
sortedIteratorReturns a sortedIteratorbased on the amount of released memory in eachAbstractJournalRM.JournalFile.- Returns:
- a sorted iterator ascending based on released memory
 
- 
getDescriptionFormat the Daemon attributes into a String for inclusion in the String returned from theDaemon.toString()method.- Overrides:
- getDescriptionin class- Daemon
- Returns:
- a String listing the attributes of the Daemon
 
- 
dedupeprotected void dedupe()Give the in-memory radix key stores a chance to de-dupe their byte[] values, similar to the concept behind String's intern() method.
- 
notifyReleasedpublic void notifyReleased(int cbReleased, int nFileId) Notifies the collector that aAbstractJournalRM.JournalFilehas had some memory released.- Parameters:
- cbReleased- the number of bytes released
- nFileId- the- AbstractJournalRM.JournalFile's file id
 
- 
getReservedFileIdprotected int getReservedFileId()Return the currently reserved file id.- Returns:
- the currently reserved file id
 
- 
getCoordinator- Returns:
- a CollectionCoordinator
 
 
-