Package com.tangosol.io.journal
Class FlashJournalRM.PreparerDaemon
java.lang.Object
com.tangosol.util.Base
com.tangosol.util.Daemon
com.tangosol.io.journal.FlashJournalRM.PreparerDaemon
- Enclosing class:
FlashJournalRM
The PreparerDaemon takes the enqueued Binary values for the JournalFile
objects, and lays them out in Buffer objects from the BufferPool,
enqueuing them for the WriterDaemon to write.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tangosol.util.Daemon
Daemon.DaemonWorkerNested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangeState(int nState, Daemon.DaemonWorker worker) Change the state of the daemon.protected Daemon.DaemonWorkerInstantiate a DaemonWorker that will be used as a daemon.voidnotifyItemQueued(FlashJournalRM.JournalFile jrnlfile, long lTicket) Notify the PreparerDaemon that an item has been queued to be written to the specified JournalFile.voidNotify the PreparerDaemon that the specified JournalFile has been cut off for new additions.voidrun()The daemon's implementation method.voidstop()Request the daemon to stop.Methods inherited from class com.tangosol.util.Daemon
configureWorker, ensureThreadGroup, finishStarting, finishStopping, getConfiguredName, getConfiguredPriority, getContext, getDescription, getGuardRegisterAction, getMaxWaitMillis, getState, getThread, getThreadContextClassLoader, getWorker, guardIfNeeded, heartbeat, heartbeat, isGuarded, isOnWorkerThread, isRunning, isStopping, recover, setConfiguredName, setConfiguredPriority, setContext, setGuardPolicy, setGuardRegisterAction, setThreadContextClassLoader, shutdown, start, terminate, toStateString, toStringMethods inherited from class com.tangosol.util.Base
azzert, 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
-
PreparerDaemon
public PreparerDaemon()Construct a PreparerDaemon.
-
-
Method Details
-
instantiateWorker
Instantiate a DaemonWorker that will be used as a daemon.- Overrides:
instantiateWorkerin classDaemon- Returns:
- a new instance of DaemonWorker or a sub-class thereof
-
run
public 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(); } } -
changeState
Change the state of the daemon.- Overrides:
changeStatein classDaemon- Parameters:
nState- one of the STATE_enumsworker- the new worker, if starting, otherwise the current worker
-
stop
public 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(). -
notifyItemQueued
Notify the PreparerDaemon that an item has been queued to be written to the specified JournalFile.- Parameters:
jrnlfile- the JournalFile that is being appended tolTicket- the ticket for the item that was queued
-
notifyJournalFileFull
Notify the PreparerDaemon that the specified JournalFile has been cut off for new additions.- Parameters:
jrnlfile- the JournalFile that is now full
-