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.Spanf_spanParentThe 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 voidexpire(long cMillis)Update the entry with the specified expiry delay.ObservableMapgetBackingMap()Obtain a reference to the backing map that this Entry corresponds to.BinarygetChangedBinaryValue()Return the Binary value changed by the BinaryEntryStore.protected com.tangosol.internal.tracing.SpangetParentSpan()Return the associated parent Span if any.longgetRipeMillis()Determine when the entry becomes ripe to be persisted.booleanisChanged()Specifies whether or not the underlying value has been changed during BinaryEntryStore operations.protected voidsetRipeMillis(long ldtMillis)Specify the times when the entry has to be persisted.ObjectsetValue(Object oValue)Store the value corresponding to this entry.protected voidstartTracking()Start tracking changes by the BinaryEntryStore.protected voidstopTracking()Stop tracking changes by the BinaryEntryStore.voidupdateBinaryValue(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, 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
-
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:
setValuein interfaceInvocableMap.Entry- Specified by:
setValuein interfaceMap.Entry- Overrides:
setValuein 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:
updateBinaryValuein interfaceBinaryEntry- Overrides:
updateBinaryValuein 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:
getBackingMapin interfaceBinaryEntry- Overrides:
getBackingMapin 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
CacheMapinterface- Specified by:
expirein interfaceBinaryEntry- Overrides:
expirein classBackingMapBinaryEntry- Parameters:
cMillis- the number of milliseconds until the entry will expire; passCacheMap.EXPIRY_DEFAULTto use the default expiry setting; passCacheMap.EXPIRY_NEVERto 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
-
-