Class BackingMapBinaryEntry
- All Implemented Interfaces:
- BinaryEntry,- InvocableMap.Entry,- MapTrigger.Entry,- QueryMap.Entry,- Map.Entry
- Direct Known Subclasses:
- ReadWriteBackingMap.Entry
MapTrigger.Entry, it represents a pending change to
 an Entry that is about to committed to the underlying Map. For example,
 the original binary value of null indicates pending insert (a non-existing
 entry), while the binary value of null represents a pending remove operation.
 It is currently only used by the ReadWriteBackingMap to communicate with the BinaryEntryStore.
This implementation is not thread safe.
- Author:
- gg 2009.11.22
- 
Nested Class SummaryNested classes/interfaces inherited from class com.tangosol.util.BaseBase.LoggingWriter
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected BinaryThe Binary key.protected BinaryThe Binary value.protected BinaryThe original Binary value.protected BackingMapManagerContextThe backing map context.protected booleanWhether this update is synthetic.protected longThe expiry timestamp for this entry; orCacheMap.EXPIRY_DEFAULTif the entry uses the default expiry setting; orCacheMap.EXPIRY_NEVERif the entry never expiresprotected ObjectLazily converted key in Object format.protected ObjectLazily converted value in Object format.protected ObjectLazily converted original value in Object format.
- 
Constructor SummaryConstructorsConstructorDescriptionBackingMapBinaryEntry(Binary binKey, Binary binValue, Binary binValueOrig, long cDelay, BackingMapManagerContext ctx) Construct a BackingMapBinaryEntry with the specified binary key, values and BackingMapManagerContext.BackingMapBinaryEntry(Binary binKey, Binary binValue, Binary binValueOrig, BackingMapManagerContext ctx) Construct a BackingMapBinaryEntry with the specified binary key, values and BackingMapManagerContext.
- 
Method SummaryModifier and TypeMethodDescriptionprotected static longcalculateExpiry(long cDelay) Calculate the expiry timestamp based on the expiry delay value.booleanCompares the specified object with this entry for equality.voidexpire(long cMillis) Update the entry with the specified expiry delay.extract(ValueExtractor extractor) Extract a value out of the Entry's key or value.Obtain a reference to the backing map that this Entry corresponds to.Obtain a reference to thebacking map contextfor the cache that this Entry corresponds to.Return a raw binary key for this entry.Return a raw binary value for this entry.Return the context this entry operates within.longReturn the number of milliseconds remaining before the specified entry is scheduled to expire.getKey()Return the key corresponding to this entry.Return a raw original binary value for this entry.Return an original value for this entry.Return aSerializerthat is used to serialize/deserialize this entry.getValue()Return the value corresponding to this entry.inthashCode()Returns the hash code value for this entry.booleanDetermine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger.booleanDetermine if this Entry exists in the Map.booleanCheck whether this BinaryEntry allows data modification operations.booleanDetermine if this Entry has been synthetically mutated.voidremove(boolean fSynthetic) Remove this Entry from the Map if it is present in the Map.Store the value corresponding to this entry.voidStore the value corresponding to this entry.toString()Render the entry as a String.voidupdate(ValueUpdater updater, Object oValue) Update the Entry's value.voidupdateBinaryValue(Binary binValue) Update the binary value for this entry.voidupdateBinaryValue(Binary binValue, boolean fSynthetic) Update the binary value for this entry.Methods inherited from class com.tangosol.util.Baseazzert, 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, waitMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.tangosol.util.BinaryEntrygetAssociatedEntry, getAssociatedEntry, getIndexMap, getKeyPartition, isValueChanged, isValueLoaded, isValueRemoved, isValueUpdatedMethods inherited from interface com.tangosol.util.InvocableMap.EntryasBinaryEntry, getValue, getValueMethods inherited from interface com.tangosol.util.QueryMap.EntryextractFromKey, extractFromValue
- 
Field Details- 
m_ctxThe backing map context.
- 
m_binKeyThe Binary key. This object reference will not change for the life of the Entry.
- 
m_binValueThe Binary value.
- 
m_binValueOrigThe original Binary value.
- 
m_ldtExpiryprotected long m_ldtExpiryThe expiry timestamp for this entry; orCacheMap.EXPIRY_DEFAULTif the entry uses the default expiry setting; orCacheMap.EXPIRY_NEVERif the entry never expires
- 
m_oKeyLazily converted key in Object format.
- 
m_oValueLazily converted value in Object format.
- 
m_oValueOrigLazily converted original value in Object format.
- 
m_fSyntheticprotected boolean m_fSyntheticWhether this update is synthetic.- Since:
- 12.2.1.4
 
 
- 
- 
Constructor Details- 
BackingMapBinaryEntrypublic BackingMapBinaryEntry(Binary binKey, Binary binValue, Binary binValueOrig, BackingMapManagerContext ctx) Construct a BackingMapBinaryEntry with the specified binary key, values and BackingMapManagerContext.- Parameters:
- binKey- the Binary key
- binValue- the Binary value; could be null representing a non-existing entry
- binValueOrig- an original Binary value; could be null representing an insert operation
- ctx- a BackingMapManagerContext
 
- 
BackingMapBinaryEntrypublic BackingMapBinaryEntry(Binary binKey, Binary binValue, Binary binValueOrig, long cDelay, BackingMapManagerContext ctx) Construct a BackingMapBinaryEntry with the specified binary key, values and BackingMapManagerContext.- Parameters:
- binKey- the Binary key
- binValue- the Binary value; could be null representing a non-existing entry
- binValueOrig- an original Binary value; could be null representing an insert operation
- cDelay- the expiry delay
- ctx- a BackingMapManagerContext
 
 
- 
- 
Method Details- 
getBinaryKeyReturn a raw binary key for this entry.- Specified by:
- getBinaryKeyin interface- BinaryEntry
- Returns:
- a raw binary key for this entry
 
- 
getBinaryValueReturn a raw binary value for this entry.- Specified by:
- getBinaryValuein interface- BinaryEntry
- Returns:
- a raw binary value for this entry; null if the value does not exist
 
- 
getOriginalBinaryValueReturn a raw original binary value for this entry.- Specified by:
- getOriginalBinaryValuein interface- BinaryEntry
- Returns:
- a raw original binary value for this entry; null if the original value did not exist
 
- 
getKeyReturn the key corresponding to this entry. The resultant key does not necessarily exist within the containing Map, which is to say that InvocableMap.this.containsKey(getKey()) could return false. To test for the presence of this key within the Map, useInvocableMap.Entry.isPresent(), and to create the entry for the key, useInvocableMap.Entry.setValue(V).- Specified by:
- getKeyin interface- InvocableMap.Entry
- Specified by:
- getKeyin interface- Map.Entry
- Returns:
- the key corresponding to this entry; may be null if the underlying Map supports null keys
 
- 
getValueReturn the value corresponding to this entry. If the entry does not exist, then the value will be null. To differentiate between a null value and a non-existent entry, useInvocableMap.Entry.isPresent().Note: any modifications to the value retrieved using this method are not guaranteed to persist unless followed by a InvocableMap.Entry.setValue(V)orInvocableMap.Entry.update(com.tangosol.util.ValueUpdater<V, T>, T)call.- Specified by:
- getValuein interface- InvocableMap.Entry
- Specified by:
- getValuein interface- Map.Entry
- Returns:
- the value corresponding to this entry; may be null if the value is null or if the Entry does not exist in the Map
 
- 
getOriginalValueReturn an original value for this entry.- Specified by:
- getOriginalValuein interface- BinaryEntry
- Specified by:
- getOriginalValuein interface- MapTrigger.Entry
- Returns:
- an original value for this entry
 
- 
isOriginalPresentpublic boolean isOriginalPresent()Determine whether or not the Entry existed before the start of the mutating operation that is being evaluated by the trigger.- Specified by:
- isOriginalPresentin interface- MapTrigger.Entry
- Returns:
- true iff this Entry was existent in the containing Map
 
- 
setValueStore 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 interface- InvocableMap.Entry
- Specified by:
- setValuein interface- Map.Entry
- Parameters:
- oValue- the new value for this Entry
- Returns:
- the previous value of this Entry, or null if the Entry did not exist
 
- 
setValueStore 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).Unlike the other form of setValue, this form does not return the previous value, and as a result may be significantly less expensive (in terms of cost of execution) for certain Map implementations.As of Coherence 12.1.2, if fSynthetic is true and the BackingMapassociated with this entry is a ReadWriteBackingMap, this method will bypass theCacheStoreorBinaryEntryStore.- Specified by:
- setValuein interface- BinaryEntry
- Specified by:
- setValuein interface- InvocableMap.Entry
- Parameters:
- oValue- the new value for this Entry
- fSynthetic- pass true only if the insertion into or modification of the Map should be treated as a synthetic event
 
- 
updateBinaryValueUpdate 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 interface- BinaryEntry
- Parameters:
- binValue- new binary value to be stored in this entry or null
 
- 
updateBinaryValueUpdate 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); This method will bypass anyCacheStoreorBinaryEntryStoreimplementations, iff fSynthetic is true and the backing map associated with this entry is a ReadWriteBackingMap.- Specified by:
- updateBinaryValuein interface- BinaryEntry
- Parameters:
- binValue- new binary value to be stored in this entry or null
- fSynthetic- pass true only if the insertion into or modification of the Map should be treated as a synthetic event
 
- 
getSerializerReturn aSerializerthat is used to serialize/deserialize this entry.- Specified by:
- getSerializerin interface- BinaryEntry
- Returns:
- a Serializerthat is used to serialize/deserialize this entry
 
- 
getContextReturn the context this entry operates within.Note: This method is a shortcut for the getBackingMapContext.getManagerContext()call.- Specified by:
- getContextin interface- BinaryEntry
- Returns:
- the BackingMapManagerContext for this entry
 
- 
getBackingMapObtain 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 interface- BinaryEntry
- Returns:
- the backing map reference; null if the entry does not have any backing map association
 
- 
getBackingMapContextObtain a reference to thebacking map contextfor the cache that this Entry corresponds to.- Specified by:
- getBackingMapContextin interface- BinaryEntry
- Returns:
- the corresponding BackingMapContext; null if the entry does not have any backing map association
 
- 
expirepublic 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 interface- BinaryEntry
- Parameters:
- cMillis- the number of milliseconds until the entry will expire; pass- CacheMap.EXPIRY_DEFAULTto use the default expiry setting; pass- CacheMap.EXPIRY_NEVERto indicate that the entry should never expire
 
- 
getExpirypublic long getExpiry()Return the number of milliseconds remaining before the specified entry is scheduled to expire. If theBinaryEntry.expire(long)method has been called, the returned value will reflect the requested expiry delay. Otherwise if the entryexists, the returned value will represent the time remaining until the entry expires (orCacheMap.EXPIRY_NEVERif the entry will never expire). If the entry does not exist,CacheMap.EXPIRY_DEFAULTwill be returned.This method will make a "best effort" attempt to determine the expiry time remaining. In some cases, it may not be possible to determine the expiry (e.g. the backing-map does not implement the CacheMapinterface), in which caseCacheMap.EXPIRY_DEFAULTwill be returned.- Specified by:
- getExpiryin interface- BinaryEntry
- Returns:
- the number of milliseconds remaining before the specified entry expires
 
- 
isReadOnlypublic boolean isReadOnly()Check whether this BinaryEntry allows data modification operations.- Specified by:
- isReadOnlyin interface- BinaryEntry
- Returns:
- true iff the entry is "read-only"
 
- 
updateUpdate the Entry's value. Calling this method is semantically equivalent to:V target = entry.getValue(); updater.update(target, value); entry.setValue(target, false); The benefit of using this method is that it may allow the Entry implementation to significantly optimize the operation, such as for purposes of delta updates and backup maintenance.- Specified by:
- updatein interface- InvocableMap.Entry
- Parameters:
- updater- a ValueUpdater used to modify the Entry's value
- oValue- the new value for this Entry
 
- 
isPresentpublic boolean isPresent()Determine if this Entry exists in the Map. If the Entry is not present, it can be created by callingInvocableMap.Entry.setValue(Object)orInvocableMap.Entry.setValue(Object, boolean). If the Entry is present, it can be destroyed by callingInvocableMap.Entry.remove(boolean).- Specified by:
- isPresentin interface- InvocableMap.Entry
- Returns:
- true iff this Entry is existent in the containing Map
 
- 
isSyntheticpublic boolean isSynthetic()Determine if this Entry has been synthetically mutated. This method returnsfalseif either a non-synthetic update was made or the entry has not been modified.- Specified by:
- isSyntheticin interface- InvocableMap.Entry
- Returns:
- true if the Entry has been synthetically mutated
 
- 
removepublic void remove(boolean fSynthetic) Remove this Entry from the Map if it is present in the Map.This method supports both the operation corresponding to Map.remove(java.lang.Object)as well as synthetic operations such as eviction. If the containing Map does not differentiate between the two, then this method will always be identical to InvocableMap.this.remove(getKey()).As of Coherence 12.1.2, if fSynthetic is true and the BackingMapassociated with this entry is a ReadWriteBackingMap, this method will bypass theCacheStoreorBinaryEntryStore.- Specified by:
- removein interface- BinaryEntry
- Specified by:
- removein interface- InvocableMap.Entry
- Parameters:
- fSynthetic- pass true only if the removal from the Map should be treated as a synthetic event
 
- 
extractExtract a value out of the Entry's key or value. Calling this method is semantically equivalent to extractor.extract(entry.getValue()), but this method may be significantly less expensive. For example, the resultant value may be obtained from a forward index, avoiding a potential object de-serialization.- Specified by:
- extractin interface- QueryMap.Entry
- Parameters:
- extractor- a ValueExtractor to apply to the Entry's key or value
- Returns:
- the extracted value
 
- 
equalsCompares the specified object with this entry for equality.
- 
hashCodepublic int hashCode()Returns the hash code value for this entry.
- 
toStringRender the entry as a String.
- 
calculateExpiryprotected static long calculateExpiry(long cDelay) Calculate the expiry timestamp based on the expiry delay value.- Parameters:
- cDelay- the expiry delay
- Returns:
- the expiry timestamp
 
 
-