public class ReadWriteBackingMap.WriteQueue
extends com.tangosol.license.CoherenceCommunityEdition
com.tangosol.license.LicensedObject.LicenseData
Base.LoggingWriter, Base.StackFrame
Modifier | Constructor and Description |
---|---|
protected |
WriteQueue()
Construct a WriteQueue that holds write-behind entries.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accelerateEntryRipe(Binary binKey)
Move the ripe time for the queued entry up to accelerate the store
operation.
|
protected ReadWriteBackingMap.Entry |
add(ReadWriteBackingMap.Entry entryNew,
long cDelay)
Add an entry to the queue.
|
Object |
checkPending(Object binKey)
Check for an item known to the WriteBehind queue.
|
void |
clearPending()
Clear the map of pending entries.
|
boolean |
containsKey(Object binKey) |
void |
flush()
Asynchronous flush, i.e. effectively mark all currently queue'd entries as ripe.
|
long |
getDelayMillis() |
int |
getDelaySeconds() |
protected Map |
getEntryMap()
Return a map of items queued to be written.
|
protected Map |
getPendingMap()
Obtain a map of entries removed from the queue, but not yet persisted
to the underlying datastore.
|
protected LongArray |
getRipeArray()
Return a
LongArray indexed by ripe time (when entries become
eligible to be written), and associated to a list of binary keys. |
boolean |
isEmpty() |
boolean |
isFlushed()
Return true iff all contents have been persisted to the underlying store.
|
protected boolean |
isWaitingOnPending()
Check whether any threads are waiting for the store operation
to complete.
|
ReadWriteBackingMap.Entry |
remove()
Wait for item in the queue to ripen (to be ready to be removed), and
when there is one and it is ripe, then remove and return it.
|
ReadWriteBackingMap.Entry |
remove(long cMillis)
Wait for the next item in the queue to ripen (to be ready to be
removed), and remove and return it, or return null if the specified
wait time has passed.
|
protected ReadWriteBackingMap.Entry |
remove(Object binKey)
Remove a key from the queue if the key is in the queue.
|
protected ReadWriteBackingMap.Entry |
removeImmediate()
Remove the first key from the queue immediately.
|
ReadWriteBackingMap.Entry |
removeNoWait()
Check for a ripe or soft-ripe item in the queue, and if there is
one, return it; otherwise, return null.
|
void |
setDelayMillis(long cMillis)
Specify the number of milliseconds that an entry added to the queue
will sit in the queue before being removable ("ripe").
|
void |
setDelaySeconds(int cSeconds)
Specify the number of seconds that an entry added to the queue will
sit in the queue before being removable ("ripe").
|
protected void |
setWaitingOnPending(boolean fPending)
Set the flag indicating whether any threads are waiting for the
pending store operation to complete.
|
int |
size() |
containsEdition, ensureEdition, getClassLicenseData, getClassLicenseData, getLicenseData, getLicenseFailure, isExpired, main, printLicense, retain, retain, setLicenseData
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, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, 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
protected WriteQueue()
public int getDelaySeconds()
public void setDelaySeconds(int cSeconds)
cSeconds
- the number of seconds to wait before allowing an
entry to be removed from the queuepublic long getDelayMillis()
public void setDelayMillis(long cMillis)
cMillis
- the number of milliseconds to wait before allowing an
entry to be removed from the queueprotected ReadWriteBackingMap.Entry add(ReadWriteBackingMap.Entry entryNew, long cDelay)
entryNew
- the entry to insertcDelay
- the number of milliseconds until the entry is
considered ripeprotected ReadWriteBackingMap.Entry remove(Object binKey)
binKey
- the key objectprotected ReadWriteBackingMap.Entry removeImmediate()
public ReadWriteBackingMap.Entry remove()
public ReadWriteBackingMap.Entry remove(long cMillis)
cMillis
- the number of ms to wait for an entry to ripen; pass
-1 to wait indefinitely or 0 for no waitpublic ReadWriteBackingMap.Entry removeNoWait()
Unlike the remove(java.lang.Object)
method, this method will also remove
soft-ripe items as calculated using the write-batch factor. A
soft-ripe item is an item that has been in the write-behind queue
for at least the following duration:
D' = (1.0 - F)*Dwhere:
D = write-behind delay F = write-batch factor
public int size()
public boolean isEmpty()
public boolean isFlushed()
public void flush()
public boolean containsKey(Object binKey)
binKey
- the key to look forpublic Object checkPending(Object binKey)
binKey
- the key object to look forpublic void clearPending()
public boolean accelerateEntryRipe(Binary binKey)
binKey
- the binary keyprotected Map getEntryMap()
protected LongArray getRipeArray()
LongArray
indexed by ripe time (when entries become
eligible to be written), and associated to a list of binary keys.protected Map getPendingMap()
protected boolean isWaitingOnPending()
protected void setWaitingOnPending(boolean fPending)
fPending
- the boolean value to set