Class GridDhtTxLocalAdapter

    • Constructor Detail

      • GridDhtTxLocalAdapter

        protected GridDhtTxLocalAdapter​(GridCacheSharedContext cctx,
                                        GridCacheVersion xidVer,
                                        boolean implicit,
                                        boolean implicitSingle,
                                        boolean sys,
                                        boolean explicitLock,
                                        byte plc,
                                        TransactionConcurrency concurrency,
                                        TransactionIsolation isolation,
                                        long timeout,
                                        boolean invalidate,
                                        boolean storeEnabled,
                                        boolean onePhaseCommit,
                                        int txSize,
                                        @Nullable
                                        @Nullable UUID subjId,
                                        int taskNameHash)
        Parameters:
        xidVer - Transaction version.
        implicit - Implicit flag.
        implicitSingle - Implicit-with-single-key flag.
        cctx - Cache context.
        sys - System flag.
        concurrency - Concurrency.
        isolation - Isolation.
        timeout - Timeout.
        txSize - Expected transaction size.
    • Method Detail

      • nearOnOriginatingNode

        public void nearOnOriginatingNode​(boolean hasNear)
        Sets flag that indicates that originating node has a near cache that participates in this transaction.
        Parameters:
        hasNear - Has near cache flag.
      • explicitLock

        public boolean explicitLock()
        Returns:
        True if explicit lock transaction.
      • explicitLock

        public void explicitLock​(boolean explicitLock)
        Parameters:
        explicitLock - Explicit lock flag.
      • nearNodeId

        protected abstract UUID nearNodeId()
        Returns:
        Near node id.
      • nearFutureId

        protected abstract IgniteUuid nearFutureId()
        Returns:
        Near future ID.
      • sendFinishReply

        protected abstract void sendFinishReply​(@Nullable
                                                @Nullable Throwable err)
        Parameters:
        err - Error, if any.
      • pendingVersions

        public void pendingVersions​(Collection<GridCacheVersion> pendingVers)
        Parameters:
        pendingVers - Versions for all pending locks that were in queue before tx locsk were released.
      • mapExplicitLocks

        protected void mapExplicitLocks()
        Map explicit locks.
      • removeMapping

        public boolean removeMapping​(UUID nodeId)
        Parameters:
        nodeId - Node ID.
        Returns:
        True if mapping was removed.
      • localFinish

        public boolean localFinish​(boolean commit,
                                   boolean clearThreadMap)
                            throws IgniteCheckedException
        Finishes transaction (either commit or rollback).
        Parameters:
        commit - True if commit, false if rollback.
        clearThreadMap - If true removes GridNearTxLocal from thread map.
        Returns:
        True if state has been changed.
        Throws:
        IgniteCheckedException - If finish failed.
      • clearPrepareFuture

        protected abstract void clearPrepareFuture​(GridDhtTxPrepareFuture fut)
        Removes previously created prepare future from atomic reference.
        Parameters:
        fut - Expected future.
      • commitOnPrepare

        public final boolean commitOnPrepare()
        Returns:
        True if transaction is finished on prepare step.
      • updateLockFuture

        public boolean updateLockFuture​(IgniteInternalFuture<?> oldFut,
                                        IgniteInternalFuture<?> newFut)
        Atomically updates lock future.
        Parameters:
        oldFut - Old future.
        newFut - New future.
        Returns:
        true If future was changed.
      • clearLockFuture

        public void clearLockFuture​(@Nullable
                                    @Nullable IgniteInternalFuture cond)
        Clears lock future.
        Parameters:
        cond - Clear lock condition.
      • finishFuture

        public <T> GridFutureAdapter<T> finishFuture​(GridFutureAdapter<T> f,
                                                     Throwable err,
                                                     boolean clearLockFut)
        Parameters:
        f - Future to finish.
        err - Error.
        clearLockFut - True if need to clear lock future.
        Returns:
        Finished future.
      • tryRollbackAsync

        @Nullable
        public @Nullable IgniteInternalFuture<?> tryRollbackAsync()
        Prepare async rollback.
        Returns:
        Current lock future or null if it's safe to roll back.