Class GridCacheExplicitLockSpan

    • Method Detail

      • addCandidate

        public boolean addCandidate​(AffinityTopologyVersion topVer,
                                    GridCacheMvccCandidate cand)
        Adds candidate to a lock span.
        Parameters:
        topVer - Topology snapshot for which candidate is added.
        cand - Candidate to add.
        Returns:
        True if candidate was added, false if this span is empty and new span should be created.
      • removeCandidate

        public boolean removeCandidate​(GridCacheMvccCandidate cand)
        Removes candidate from this lock span.
        Parameters:
        cand - Candidate to remove.
        Returns:
        True if span is empty and should be removed, false otherwise.
      • removeCandidate

        public GridCacheMvccCandidate removeCandidate​(IgniteTxKey key,
                                                      @Nullable
                                                      @Nullable GridCacheVersion ver)
        Removes lock by key and optional version.
        Parameters:
        key - Key.
        ver - Version (or null if any candidate should be removed.)
        Returns:
        Removed candidate if matches given parameters.
      • isEmpty

        public boolean isEmpty()
        Returns:
        True if span is empty and candidates cannot be added anymore.
      • markOwned

        public void markOwned​(IgniteTxKey key)
        Marks all candidates added for given key as owned.
        Parameters:
        key - Key.
      • candidate

        @Nullable
        public @Nullable GridCacheMvccCandidate candidate​(IgniteTxKey key,
                                                          @Nullable
                                                          @Nullable GridCacheVersion ver)
        Gets explicit lock candidate for given key.
        Parameters:
        key - Key to lookup.
        ver - Version to lookup (if null - return any).
        Returns:
        Last added explicit lock candidate, if any, or null.
      • topologyVersion

        @Nullable
        public @Nullable AffinityTopologyVersion topologyVersion()
        Gets actual topology snapshot for thread lock span.
        Returns:
        Topology snapshot or null if candidate list is empty.
      • releaseFuture

        public IgniteInternalFuture<Object> releaseFuture()
        Gets span release future. Future is completed when last lock is released.
        Returns:
        Release future.