Class ReadWriteBackingMap.Entry

    • Field Detail

      • f_spanParent

        protected final com.tangosol.internal.tracing.Span f_spanParent
        The parent tracing span.
    • 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 key
        binValue - the Binary value; could be null representing a non-existing or removed entry
        binValueOrig - an original Binary value; could be null representing a non-existing entry
        cExpiry - the expiry delay
        ctx - 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 interface InvocableMap.Entry
        Specified by:
        setValue in interface Map.Entry
        Overrides:
        setValue in class BackingMapBinaryEntry
        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 interface BinaryEntry
        Overrides:
        updateBinaryValue in class BackingMapBinaryEntry
        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 interface BinaryEntry
        Overrides:
        getBackingMap in class BackingMapBinaryEntry
        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 interface BinaryEntry
        Overrides:
        expire in class BackingMapBinaryEntry
        Parameters:
        cMillis - the number of milliseconds until the entry will expire; pass CacheMap.EXPIRY_DEFAULT to use the default expiry setting; pass CacheMap.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