/** * Method checks that current thread does not have active transactions. * * @throws IgniteException If transaction exist. */ public void checkEmptyTransactions() throws IgniteException { if (transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null) throw new IgniteException("Cannot start/stop cache within lock or transaction."); }
/** * Performs future mapping. */ public final void map() { AffinityTopologyVersion topVer = cctx.shared().lockedTopologyVersion(null); if (topVer == null) mapOnTopology(); else { topLocked = true; // Cannot remap. remapCnt = 1; map(topVer); } }
/** * Initializes future. * * @param topVer Topology version. */ public void init(@Nullable AffinityTopologyVersion topVer) { AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null); if (lockedTopVer != null) { canRemap = false; map(keys, Collections.emptyMap(), lockedTopVer); } else { AffinityTopologyVersion mapTopVer = topVer; if (mapTopVer == null) mapTopVer = tx == null ? cctx.affinity().affinityTopologyVersion() : tx.topologyVersion(); map(keys, Collections.emptyMap(), mapTopVer); } markInitialized(); }
AffinityTopologyVersion lockedVer = ctx.shared().lockedTopologyVersion(null);
/** * Change WAL mode. * * @param cacheNames Cache names. * @param enabled Enabled flag. * @return Future completed when operation finished. */ public IgniteInternalFuture<Boolean> changeWalMode(Collection<String> cacheNames, boolean enabled) { if (transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null) throw new IgniteException("Cache WAL mode cannot be changed within lock or transaction."); return sharedCtx.walState().init(cacheNames, enabled); }
assert mvccSnapshot == null || cctx.mvccEnabled(); AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null);
/** * Initializes future. * * @param topVer Topology version. */ public void init(AffinityTopologyVersion topVer) { AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null); // Can not remap if we in transaction and locked on some topology. if (lockedTopVer != null) { topVer = lockedTopVer; canRemap = false; } else { // Use affinity topology version if constructor version is not specify. topVer = topVer.topologyVersion() > 0 ? topVer : cctx.affinity().affinityTopologyVersion(); } initialMap(topVer); }
if (cacheProc.transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null) { return new GridFinishedFuture<>(new IgniteCheckedException("Failed to " + prettyStr(activate) + " cluster (must invoke the method outside of an active transaction)."));
if (h2.serverTopologyChanged(topVer) && ctx.cache().context().lockedTopologyVersion(null) != null) { throw new CacheException(new TransactionException("Server topology is changed during query " + "execution inside a transaction. It's recommended to rollback and retry transaction."));
/** * Method checks that current thread does not have active transactions. * * @throws IgniteException If transaction exist. */ public void checkEmptyTransactions() throws IgniteException { if (transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null) throw new IgniteException("Cannot start/stop cache within lock or transaction."); }
/** * Performs future mapping. */ public final void map() { AffinityTopologyVersion topVer = cctx.shared().lockedTopologyVersion(null); if (topVer == null) mapOnTopology(); else { topLocked = true; // Cannot remap. remapCnt = 1; map(topVer); } }
AffinityTopologyVersion lockedVer = ctx.shared().lockedTopologyVersion(null);
/** * Change WAL mode. * * @param cacheNames Cache names. * @param enabled Enabled flag. * @return Future completed when operation finished. */ public IgniteInternalFuture<Boolean> changeWalMode(Collection<String> cacheNames, boolean enabled) { if (transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null) throw new IgniteException("Cache WAL mode cannot be changed within lock or transaction."); return sharedCtx.walState().init(cacheNames, enabled); }
assert mvccSnapshot == null || cctx.mvccEnabled(); AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null);
/** * Initializes future. * * @param topVer Topology version. */ public void init(@Nullable AffinityTopologyVersion topVer) { AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null); if (lockedTopVer != null) { canRemap = false; map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), lockedTopVer); } else { AffinityTopologyVersion mapTopVer = topVer; if (mapTopVer == null) { mapTopVer = tx == null ? (canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion()) : tx.topologyVersion(); } map(keys, Collections.<ClusterNode, LinkedHashMap<KeyCacheObject, Boolean>>emptyMap(), mapTopVer); } markInitialized(); }
/** {@inheritDoc} */ @Override public MvccSnapshot tryRequestSnapshotLocal(@Nullable IgniteInternalTx tx) throws ClusterTopologyCheckedException { MvccCoordinator crd = currentCoordinator(); if (crd == null) throw noCoordinatorError(); if (tx != null) { AffinityTopologyVersion topVer = ctx.cache().context().lockedTopologyVersion(null); if (topVer != null && topVer.compareTo(crd.topologyVersion()) < 0) throw new ClusterTopologyCheckedException("Mvcc coordinator is outdated " + "for the locked topology version. [crd=" + crd + ", tx=" + tx + ']'); } if (!ctx.localNodeId().equals(crd.nodeId()) || !initFut.isDone()) return null; else if (tx != null) return assignTxSnapshot(0L, ctx.localNodeId(), false); else return activeQueries.assignQueryCounter(ctx.localNodeId(), 0L); }
AffinityTopologyVersion topVer = ctx.cache().context().lockedTopologyVersion(null);
/** * Initializes future. * * @param topVer Topology version. */ public void init(AffinityTopologyVersion topVer) { AffinityTopologyVersion lockedTopVer = cctx.shared().lockedTopologyVersion(null); if (lockedTopVer != null) { topVer = lockedTopVer; canRemap = false; } else { topVer = topVer.topologyVersion() > 0 ? topVer : canRemap ? cctx.affinity().affinityTopologyVersion() : cctx.shared().exchange().readyAffinityVersion(); } if (!cctx.mvccEnabled() || mvccSnapshot != null) initialMap(topVer); else { mvccTracker = new MvccQueryTrackerImpl(cctx, canRemap); trackable = true; cctx.mvcc().addFuture(this, futId); mvccTracker.requestSnapshot(topVer, this); } }
if (cacheProc.transactions().tx() != null || sharedCtx.lockedTopologyVersion(null) != null) { return new GridFinishedFuture<>(new IgniteCheckedException("Failed to " + prettyStr(activate) + " cluster (must invoke the method outside of an active transaction)."));
if (h2.serverTopologyChanged(topVer) && ctx.cache().context().lockedTopologyVersion(null) != null) { throw new CacheException(new TransactionException("Server topology is changed during query " + "execution inside a transaction. It's recommended to rollback and retry transaction."));