Class IgniteTxEntry

    • Field Detail

      • SER_READ_EMPTY_ENTRY_VER

        public static final GridCacheVersion SER_READ_EMPTY_ENTRY_VER
        Dummy version for non-existing entry read in SERIALIZABLE transaction.
      • SER_READ_NOT_EMPTY_VER

        public static final GridCacheVersion SER_READ_NOT_EMPTY_VER
        Dummy version for any existing entry read in SERIALIZABLE transaction.
      • GET_ENTRY_INVALID_VER_UPDATED

        public static final GridCacheVersion GET_ENTRY_INVALID_VER_UPDATED
      • GET_ENTRY_INVALID_VER_AFTER_GET

        public static final GridCacheVersion GET_ENTRY_INVALID_VER_AFTER_GET
    • Constructor Detail

      • IgniteTxEntry

        public IgniteTxEntry​(GridCacheContext<?,​?> ctx,
                             IgniteInternalTx tx,
                             GridCacheOperation op,
                             CacheObject val,
                             long ttl,
                             long conflictExpireTime,
                             GridCacheEntryEx entry,
                             @Nullable
                             @Nullable GridCacheVersion conflictVer,
                             boolean skipStore,
                             boolean keepBinary)
        This constructor is meant for remote transactions.
        Parameters:
        ctx - Cache registry.
        tx - Owning transaction.
        op - Operation.
        val - Value.
        ttl - Time to live.
        conflictExpireTime - DR expire time.
        entry - Cache entry.
        conflictVer - Data center replication version.
        skipStore - Skip store flag.
      • IgniteTxEntry

        public IgniteTxEntry​(GridCacheContext<?,​?> ctx,
                             IgniteInternalTx tx,
                             GridCacheOperation op,
                             CacheObject val,
                             javax.cache.processor.EntryProcessor<Object,​Object,​Object> entryProcessor,
                             Object[] invokeArgs,
                             long ttl,
                             GridCacheEntryEx entry,
                             CacheEntryPredicate[] filters,
                             GridCacheVersion conflictVer,
                             boolean skipStore,
                             boolean keepBinary,
                             boolean addReader)
        This constructor is meant for local transactions.
        Parameters:
        ctx - Cache registry.
        tx - Owning transaction.
        op - Operation.
        val - Value.
        entryProcessor - Entry processor.
        invokeArgs - Optional arguments for EntryProcessor.
        ttl - Time to live.
        entry - Cache entry.
        filters - Put filters.
        conflictVer - Data center replication version.
        skipStore - Skip store flag.
        addReader - Add reader flag.
    • Method Detail

      • context

        public GridCacheContext<?,​?> context()
        Returns:
        Cache context for this tx entry.
      • context

        public void context​(GridCacheContext<?,​?> ctx)
        Parameters:
        ctx - Cache context for this tx entry.
      • locallyMapped

        public boolean locallyMapped()
        Returns:
        Flag indicating if this entry is affinity mapped to the same node.
      • locallyMapped

        public void locallyMapped​(boolean locMapped)
        Parameters:
        locMapped - Flag indicating if this entry is affinity mapped to the same node.
      • nodeId

        public UUID nodeId()
        Returns:
        Node ID.
      • nodeId

        public void nodeId​(UUID nodeId)
        Parameters:
        nodeId - Node ID.
      • dhtVersion

        public void dhtVersion​(GridCacheVersion dhtVer)
        Parameters:
        dhtVer - DHT version.
      • locked

        public boolean locked()
        Returns:
        True if tx entry was marked as locked.
      • markLocked

        public void markLocked()
        Marks tx entry as locked.
      • updateCounter

        public void updateCounter​(long partCntr)
        Sets partition counter.
        Parameters:
        partCntr - Partition counter.
      • updateCounter

        public long updateCounter()
        Returns:
        Partition index.
      • setAndMarkValid

        public void setAndMarkValid​(CacheObject val)
        Parameters:
        val - Value to set.
      • markValid

        public void markValid()
        Marks this entry as value-has-bean-read. Effectively, makes values enlisted to transaction visible to further peek operations.
      • cacheId

        public int cacheId()
        Returns:
        Cache ID.
      • skipStore

        public void skipStore​(boolean skipStore)
        Sets skip store flag value.
        Parameters:
        skipStore - Skip store flag.
      • skipStore

        public boolean skipStore()
        Returns:
        Skip store flag.
      • oldValueOnPrimary

        public void oldValueOnPrimary​(boolean oldValOnPrimary)
        Parameters:
        oldValOnPrimary - True If old value for was non null on primary node.
      • keepBinary

        public void keepBinary​(boolean keepBinary)
        Sets keep binary flag value.
        Parameters:
        keepBinary - Keep binary flag value.
      • keepBinary

        public boolean keepBinary()
        Returns:
        Keep binary flag value.
      • addReader

        public void addReader​(boolean addReader)
        Parameters:
        addReader - Add reader flag.
      • addReader

        public boolean addReader()
        Returns:
        Add reader flag.
      • noop

        public void noop​(boolean noop)
        Parameters:
        noop - Add no-op flag.
      • noop

        public boolean noop()
        Returns:
        true if noop flag is set, false otherwise.
      • cached

        public void cached​(GridCacheEntryEx entry)
        Parameters:
        entry - Cache entry.
      • value

        @Nullable
        public @Nullable CacheObject value()
        Returns:
        Entry value.
      • oldValue

        @Nullable
        public @Nullable CacheObject oldValue()
        Returns:
        Old value.
      • oldValue

        public void oldValue​(CacheObject oldVal)
        Parameters:
        oldVal - Old value.
      • hasOldValue

        public boolean hasOldValue()
        Returns:
        True if old value present.
      • hasValue

        public boolean hasValue()
        Returns:
        True if has value explicitly set.
      • hasWriteValue

        public boolean hasWriteValue()
        Returns:
        True if has write value set.
      • hasReadValue

        public boolean hasReadValue()
        Returns:
        True if has read value set.
      • previousValue

        @Nullable
        public @Nullable CacheObject previousValue()
        Returns:
        Value visible for peek.
      • hasPreviousValue

        public boolean hasPreviousValue()
        Returns:
        True if has previous value explicitly set.
      • previousOperation

        @Nullable
        public @Nullable GridCacheOperation previousOperation()
        Returns:
        Previous operation to revert entry in case of filter failure.
      • ttl

        public long ttl()
        Returns:
        Time to live.
      • ttl

        public void ttl​(long ttl)
        Parameters:
        ttl - Time to live.
      • conflictExpireTime

        public long conflictExpireTime()
        Returns:
        Conflict expire time.
      • conflictExpireTime

        public void conflictExpireTime​(long conflictExpireTime)
        Parameters:
        conflictExpireTime - Conflict expire time.
      • value

        public void value​(@Nullable
                          @Nullable CacheObject val,
                          boolean writeVal,
                          boolean readVal)
        Parameters:
        val - Entry value.
        writeVal - Write value flag.
        readVal - Read value flag.
      • readValue

        public void readValue​(@Nullable
                              @Nullable CacheObject val)
        Sets read value if this tx entry does not have write value yet.
        Parameters:
        val - Read value to set.
      • addEntryProcessor

        public void addEntryProcessor​(javax.cache.processor.EntryProcessor<Object,​Object,​Object> entryProcessor,
                                      Object[] invokeArgs)
        Parameters:
        entryProcessor - Entry processor.
        invokeArgs - Optional arguments for EntryProcessor.
      • applyEntryProcessors

        public CacheObject applyEntryProcessors​(CacheObject cacheVal)
        Parameters:
        cacheVal - Value.
        Returns:
        New value.
      • entryProcessors

        public void entryProcessors​(@Nullable
                                    @Nullable Collection<T2<javax.cache.processor.EntryProcessor<Object,​Object,​Object>,​Object[]>> entryProcessorsCol)
        Parameters:
        entryProcessorsCol - Collection of entry processors.
      • isRead

        public boolean isRead()
        Returns:
        True if read entry.
      • explicitVersion

        public void explicitVersion​(GridCacheVersion explicitVer)
        Parameters:
        explicitVer - Explicit version.
      • explicitVersion

        public GridCacheVersion explicitVersion()
        Returns:
        Explicit version.
      • conflictVersion

        @Nullable
        public @Nullable GridCacheVersion conflictVersion()
        Returns:
        Conflict version.
      • conflictVersion

        public void conflictVersion​(@Nullable
                                    @Nullable GridCacheVersion conflictVer)
        Parameters:
        conflictVer - Conflict version.
      • filters

        public void filters​(CacheEntryPredicate[] filters)
        Parameters:
        filters - Put filters.
      • filtersPassed

        public boolean filtersPassed()
        Returns:
        True if filters passed for fast-commit transactions.
      • filtersPassed

        public void filtersPassed​(boolean filtersPassed)
        Parameters:
        filtersPassed - True if filters passed for fast-commit transactions.
      • filtersSet

        public boolean filtersSet()
        Returns:
        True if filters are set.
      • filtersSet

        public void filtersSet​(boolean filtersSet)
        Parameters:
        filtersSet - True if filters are set and should not be replaced.
      • prepareUnmarshal

        public void prepareUnmarshal​(GridCacheSharedContext<?,​?> ctx,
                                     AffinityTopologyVersion topVer,
                                     boolean near)
                              throws IgniteCheckedException
        Prepares this entry to unmarshall. In particular, this method initialize a cache context.
        Parameters:
        ctx - Cache context.
        topVer - Topology version that is used to validate a cache context. If this parameter is null then validation will be skipped.
        near - Near flag.
        Throws:
        IgniteCheckedException - If un-marshalling failed.
      • expiry

        public void expiry​(@Nullable
                           @Nullable javax.cache.expiry.ExpiryPolicy expiryPlc)
        Parameters:
        expiryPlc - Expiry policy.
      • expiry

        @Nullable
        public @Nullable javax.cache.expiry.ExpiryPolicy expiry()
        Returns:
        Expiry policy.
      • entryProcessorCalculatedValue

        public void entryProcessorCalculatedValue​(T2<GridCacheOperation,​CacheObject> entryProcessorCalcVal)
        Parameters:
        entryProcessorCalcVal - Entry processor calculated value.
      • entryReadVersion

        @Nullable
        public @Nullable GridCacheVersion entryReadVersion()
        Gets stored entry version. Version is stored for all entries in serializable transaction or when value is read using IgniteCache.getEntry(Object) method.
        Returns:
        Entry version.
      • entryReadVersion

        public void entryReadVersion​(GridCacheVersion ver)
        Parameters:
        ver - Entry version.
      • clearEntryReadVersion

        public void clearEntryReadVersion()
        Clears recorded read version, should be done before starting commit of not serializable/optimistic transaction.
      • onAckReceived

        public void onAckReceived()
        Method called when ack message received.
        Specified by:
        onAckReceived in interface Message
      • writeTo

        public boolean writeTo​(ByteBuffer buf,
                               MessageWriter writer)
        Writes this message to provided byte buffer.
        Specified by:
        writeTo in interface Message
        Parameters:
        buf - Byte buffer.
        writer - Writer.
        Returns:
        Whether message was fully written.
      • readFrom

        public boolean readFrom​(ByteBuffer buf,
                                MessageReader reader)
        Reads this message from provided byte buffer.
        Specified by:
        readFrom in interface Message
        Parameters:
        buf - Byte buffer.
        reader - Reader.
        Returns:
        Whether message was fully read.
      • directType

        public short directType()
        Gets message type.
        Specified by:
        directType in interface Message
        Returns:
        Message type.
      • fieldsCount

        public byte fieldsCount()
        Gets fields count.
        Specified by:
        fieldsCount in interface Message
        Returns:
        Fields count.
      • deployClass

        public Class<?> deployClass()
        Gets top level user class being deployed.
        Specified by:
        deployClass in interface GridPeerDeployAware
        Returns:
        Top level user deployed class.
      • cqNotifyClosure

        public void cqNotifyClosure​(GridAbsClosureX clo)
        Parameters:
        clo - Clo.
      • classLoader

        public ClassLoader classLoader()
        Gets class loader for the class. This class loader must be able to load the class returned from GridPeerDeployAware.deployClass() as well as all of its dependencies.

        Note that in most cases the class loader returned from this method and the class loader for the class returned from GridPeerDeployAware.deployClass() method will be the same. If they are not the same, it is required that the class loader returned from this method still has to be able to load the deploy class and all its dependencies.

        Specified by:
        classLoader in interface GridPeerDeployAware
        Returns:
        Class loader for the class.