Package com.tangosol.net.cache
Class ReadWriteBackingMap.Entry
- java.lang.Object
-
- com.tangosol.util.Base
-
- com.tangosol.net.cache.BackingMapBinaryEntry
-
- com.tangosol.net.cache.ReadWriteBackingMap.Entry
-
- All Implemented Interfaces:
BinaryEntry
,InvocableMap.Entry
,MapTrigger.Entry
,QueryMap.Entry
,Map.Entry
- Enclosing class:
- ReadWriteBackingMap
public class ReadWriteBackingMap.Entry extends BackingMapBinaryEntry
A queue entry that is scheduled to come out of the front of the queue no earlier than some specific point in time.- Since:
- Coherence 3.6
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.tangosol.util.Base
Base.LoggingWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected com.tangosol.internal.tracing.Span
f_spanParent
The parent tracing span.-
Fields inherited from class com.tangosol.net.cache.BackingMapBinaryEntry
m_binKey, m_binValue, m_binValueOrig, m_ctx, m_fSynthetic, m_ldtExpiry, m_oKey, m_oValue, m_oValueOrig
-
-
Constructor Summary
Constructors Constructor Description Entry(Binary binKey, Binary binValue, Binary binValueOrig, long cExpiry, BackingMapManagerContext ctx)
Construct an Entry with just a key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
expire(long cMillis)
Update the entry with the specified expiry delay.ObservableMap
getBackingMap()
Obtain a reference to the backing map that this Entry corresponds to.Binary
getChangedBinaryValue()
Return the Binary value changed by the BinaryEntryStore.protected com.tangosol.internal.tracing.Span
getParentSpan()
Return the associated parent Span if any.long
getRipeMillis()
Determine when the entry becomes ripe to be persisted.boolean
isChanged()
Specifies whether or not the underlying value has been changed during BinaryEntryStore operations.protected void
setRipeMillis(long ldtMillis)
Specify the times when the entry has to be persisted.Object
setValue(Object oValue)
Store the value corresponding to this entry.protected void
startTracking()
Start tracking changes by the BinaryEntryStore.protected void
stopTracking()
Stop tracking changes by the BinaryEntryStore.void
updateBinaryValue(Binary binValue)
Update the binary value for this entry.-
Methods inherited from class com.tangosol.net.cache.BackingMapBinaryEntry
calculateExpiry, equals, extract, getBackingMapContext, getBinaryKey, getBinaryValue, getContext, getExpiry, getKey, getOriginalBinaryValue, getOriginalValue, getSerializer, getValue, hashCode, isOriginalPresent, isPresent, isReadOnly, isSynthetic, remove, setValue, toString, update, updateBinaryValue
-
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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.util.BinaryEntry
getAssociatedEntry, getAssociatedEntry, getIndexMap, getKeyPartition, isValueChanged, isValueLoaded, isValueRemoved, isValueUpdated
-
Methods inherited from interface com.tangosol.util.InvocableMap.Entry
asBinaryEntry, getValue, getValue
-
Methods inherited from interface com.tangosol.util.QueryMap.Entry
extractFromKey, extractFromValue
-
-
-
-
Constructor Detail
-
Entry
public Entry(Binary binKey, Binary binValue, Binary binValueOrig, long cExpiry, BackingMapManagerContext ctx)
Construct an Entry with just a key.- Parameters:
binKey
- the Binary keybinValue
- the Binary value; could be null representing a non-existing or removed entrybinValueOrig
- an original Binary value; could be null representing a non-existing entrycExpiry
- the expiry delayctx
- the BackingMapManagerContext
-
-
Method Detail
-
setValue
public Object setValue(Object oValue)
Store the value corresponding to this entry. If the entry does not exist, then the entry will be created by invoking this method, even with a null value (assuming the Map supports null values).- Specified by:
setValue
in interfaceInvocableMap.Entry
- Specified by:
setValue
in interfaceMap.Entry
- Overrides:
setValue
in classBackingMapBinaryEntry
- Parameters:
oValue
- the new value for this Entry- Returns:
- the previous value of this Entry, or null if the Entry did not exist
-
updateBinaryValue
public void updateBinaryValue(Binary binValue)
Update the binary value for this entry.Passing a non-null binary is functionally equivalent to:
setValue(getContext().getValueFromInternalConverter().convert(binValue));
Passing null value is functionally equivalent to removing the entry.remove(false);
- Specified by:
updateBinaryValue
in interfaceBinaryEntry
- Overrides:
updateBinaryValue
in classBackingMapBinaryEntry
- Parameters:
binValue
- new binary value to be stored in this entry or null
-
getBackingMap
public ObservableMap getBackingMap()
Obtain a reference to the backing map that this Entry corresponds to. The returned Map should be used in a read-only manner.Note: This method is a shortcut for the
getBackingMapContext().getBackingMap()
call. As of Coherence 3.7, the returned type has been narrowed to ObservableMap.- Specified by:
getBackingMap
in interfaceBinaryEntry
- Overrides:
getBackingMap
in classBackingMapBinaryEntry
- Returns:
- the backing map reference; null if the entry does not have any backing map association
-
expire
public void expire(long cMillis)
Update the entry with the specified expiry delay.Note: this method only has an effect only if the associated backing map implements the
CacheMap
interface- Specified by:
expire
in interfaceBinaryEntry
- Overrides:
expire
in classBackingMapBinaryEntry
- Parameters:
cMillis
- the number of milliseconds until the entry will expire; passCacheMap.EXPIRY_DEFAULT
to use the default expiry setting; passCacheMap.EXPIRY_NEVER
to indicate that the entry should never expire
-
getRipeMillis
public long getRipeMillis()
Determine when the entry becomes ripe to be persisted.- Returns:
- the time at which the entry becomes ripe
-
setRipeMillis
protected void setRipeMillis(long ldtMillis)
Specify the times when the entry has to be persisted. This property is immutable once set.- Parameters:
ldtMillis
- the time when the entry becomes ripe
-
isChanged
public boolean isChanged()
Specifies whether or not the underlying value has been changed during BinaryEntryStore operations.- Returns:
- true iff during the BinaryEntryStore operations any of the value mutating methods were called (including remove)
-
getChangedBinaryValue
public Binary getChangedBinaryValue()
Return the Binary value changed by the BinaryEntryStore.- Returns:
- the changed Binary value, or null if the entry was removed
-
startTracking
protected void startTracking()
Start tracking changes by the BinaryEntryStore.
-
stopTracking
protected void stopTracking()
Stop tracking changes by the BinaryEntryStore.
-
getParentSpan
protected com.tangosol.internal.tracing.Span getParentSpan()
Return the associated parent Span if any.- Returns:
- the parent span or null
-
-