Interface CacheTransaction

    • Method Detail

      • getGlobalTransaction

        GlobalTransaction getGlobalTransaction()
        Returns the transaction identifier.
      • getModifications

        List<WriteCommand> getModifications()
        Returns the modifications visible within the current transaction. Any modifications using Flag#CACHE_MODE_LOCAL are excluded. The returned list is never null.
      • getAllModifications

        List<WriteCommand> getAllModifications()
        Returns all the modifications visible within the current transaction, including those using Flag#CACHE_MODE_LOCAL. The returned list is never null.
      • hasModification

        boolean hasModification​(Class<?> modificationClass)
        Checks if a modification of the given class (or subclass) is present in this transaction. Any modifications using Flag#CACHE_MODE_LOCAL are ignored.
        Parameters:
        modificationClass - the modification type to look for
        Returns:
        true if found, false otherwise
      • removeLookedUpEntry

        void removeLookedUpEntry​(Object key)
      • clearLookedUpEntries

        void clearLookedUpEntries()
      • ownsLock

        boolean ownsLock​(Object key)
      • clearLockedKeys

        void clearLockedKeys()
      • getTopologyId

        int getTopologyId()
      • addBackupLockForKey

        void addBackupLockForKey​(Object key)
      • isMarkedForRollback

        boolean isMarkedForRollback()
      • markForRollback

        void markForRollback​(boolean markForRollback)
      • addVersionRead

        void addVersionRead​(Object key,
                            EntryVersion version)
        Sets the version read for this key. The version is only set at the first time, i.e. multiple invocation of this method will not change the state.

        Note: used in Repeatable Read + Write Skew + Clustering + Versioning.

      • getVersionsRead

        Map<Object,​IncrementableEntryVersion> getVersionsRead()
        Note: used in Repeatable Read + Write Skew + Clustering + Versioning.
        Returns:
        a non-null map between key and version. The map represents the version read for that key. If no version exists, the key has not been read.
      • getCreationTime

        long getCreationTime()
      • freezeModifications

        void freezeModifications()
        Prevent new modifications after prepare or commit started.
      • getReleaseFutureForKey

        CompletableFuture<Void> getReleaseFutureForKey​(Object key)
        It returns a CompletableFuture that completes when the lock for the key is released. If the key is not locked by this transaction, it returns null.
        Parameters:
        key - the key.
        Returns:
        the CompletableFuture or null if the key is not locked by this transaction.
      • cleanupBackupLocks

        void cleanupBackupLocks()
        It cleans up the backup locks for this transaction.
      • removeBackupLocks

        void removeBackupLocks​(Collection<?> keys)
        It cleans up the backup lock for the keys.
        Parameters:
        keys - The keys to clean up the backup lock.
      • removeBackupLock

        void removeBackupLock​(Object key)
        It cleans up the backup for key.
        Parameters:
        key - The key to clean up the backup lock.
      • forEachBackupLock

        void forEachBackupLock​(Consumer<Object> consumer)
        Invokes the Consumer with each backup lock.
        Parameters:
        consumer - The backup lock Consumer