class GridNearTxFastFinishFuture extends GridFutureAdapter<IgniteInternalTx> implements NearTxFinishFuture {
    /** */
    private final GridNearTxLocal tx;

    /** */
    private final boolean commit;

    /**
     * @param tx Transaction.
     * @param commit Commit flag.
     */
    GridNearTxFastFinishFuture(GridNearTxLocal tx, boolean commit) {
        this.tx = tx;
        this.commit = commit;
    }

    /** {@inheritDoc} */
    @Override public boolean commit() {
        return commit;
    }

    /** {@inheritDoc} */
    @Override public GridNearTxLocal tx() {
        return tx;
    }

    /**
     * @param clearThreadMap {@code True} if need remove tx from thread map.
     */
    @Override public void finish(boolean commit, boolean clearThreadMap, boolean onTimeout) {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public void onNodeStop(IgniteCheckedException e) {
        onDone(tx, e);
    }
}

        try {
            if (commit) {
                tx.state(PREPARING);
                tx.state(PREPARED);
                tx.state(COMMITTING);

                tx.context().tm().fastFinishTx(tx, true, true);

                tx.state(COMMITTED);
            }
            else {
                tx.state(PREPARING);
                tx.state(PREPARED);
                tx.state(ROLLING_BACK);

                tx.context().tm().fastFinishTx(tx, false, clearThreadMap);

                tx.state(ROLLED_BACK);
            }
        }
        finally {
            onDone(tx);
        }
    
<methods>public non-sealed void <init>() ,public boolean cancel() throws org.apache.ignite.IgniteCheckedException,public IgniteInternalFuture<T> chain(IgniteClosure<? super IgniteInternalFuture<org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx>,T>) ,public IgniteInternalFuture<T> chain(IgniteOutClosure<T>) ,public IgniteInternalFuture<T> chain(IgniteClosure<? super IgniteInternalFuture<org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx>,T>, java.util.concurrent.Executor) ,public IgniteInternalFuture<T> chain(IgniteOutClosure<T>, java.util.concurrent.Executor) ,public IgniteInternalFuture<T> chainCompose(IgniteClosure<? super IgniteInternalFuture<org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx>,IgniteInternalFuture<T>>) ,public IgniteInternalFuture<T> chainCompose(IgniteClosure<? super IgniteInternalFuture<org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx>,IgniteInternalFuture<T>>, java.util.concurrent.Executor) ,public java.lang.Throwable error() ,public org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx get() throws org.apache.ignite.IgniteCheckedException,public org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx get(long) throws org.apache.ignite.IgniteCheckedException,public org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx get(long, java.util.concurrent.TimeUnit) throws org.apache.ignite.IgniteCheckedException,public org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx getUninterruptibly() throws org.apache.ignite.IgniteCheckedException,public void ignoreInterrupts() ,public boolean isCancelled() ,public boolean isDone() ,public boolean isFailed() ,public void listen(IgniteInClosure<? super IgniteInternalFuture<org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx>>) ,public void listen(org.apache.ignite.lang.IgniteRunnable) ,public org.apache.ignite.IgniteLogger logger() ,public boolean onCancelled() ,public final boolean onDone() ,public final boolean onDone(org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx) ,public final boolean onDone(java.lang.Throwable) ,public boolean onDone(org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx, java.lang.Throwable) ,public void reset() ,public org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx result() ,public java.lang.String toString() <variables>private static final java.lang.Object CANCELLED,private static final java.lang.String DONE,private static final org.apache.ignite.internal.util.future.GridFutureAdapter.Node INIT,private volatile boolean ignoreInterrupts,private volatile java.lang.Object state,private static final AtomicReferenceFieldUpdater<GridFutureAdapter#RAW,java.lang.Object> stateUpdater