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
protected class FlashJournalRM.PreparerDaemon extends Daemon
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.DaemonWorker
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Constructor Summary
Constructors Constructor Description PreparerDaemon()
Construct a PreparerDaemon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
changeState(int nState, Daemon.DaemonWorker worker)
Change the state of the daemon.protected Daemon.DaemonWorker
instantiateWorker()
Instantiate a DaemonWorker that will be used as a daemon.void
notifyItemQueued(FlashJournalRM.JournalFile jrnlfile, long lTicket)
Notify the PreparerDaemon that an item has been queued to be written to the specified JournalFile.void
notifyJournalFileFull(FlashJournalRM.JournalFile jrnlfile)
Notify the PreparerDaemon that the specified JournalFile has been cut off for new additions.void
run()
The daemon's implementation method.void
stop()
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, toString
-
Methods 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, 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
-
-
-
-
Method Detail
-
instantiateWorker
protected Daemon.DaemonWorker instantiateWorker()
Instantiate a DaemonWorker that will be used as a daemon.- Overrides:
instantiateWorker
in 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
protected void changeState(int nState, Daemon.DaemonWorker worker)
Change the state of the daemon.- Overrides:
changeState
in 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
public void notifyItemQueued(FlashJournalRM.JournalFile jrnlfile, long lTicket)
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
public void notifyJournalFileFull(FlashJournalRM.JournalFile jrnlfile)
Notify the PreparerDaemon that the specified JournalFile has been cut off for new additions.- Parameters:
jrnlfile
- the JournalFile that is now full
-
-