/** * Marks all locks as ready for local transaction. */ private void readyLocks() { // Ready all locks. if (log.isDebugEnabled()) log.debug("Marking all local candidates as ready: " + this); readyLocks(req.writes()); if (tx.serializable() && tx.optimistic()) readyLocks(req.reads()); locksReady = true; }
for (IgniteTxEntry e : F.concat(false, req.reads(), req.writes())) { GridCacheContext ctx = e.context();
userPrepare((serializable() && optimistic()) ? F.concat(false, req.writes(), req.reads()) : req.writes());
IgniteTxEntry firstRead = unmarshal(req.reads());
/** * Marks all locks as ready for local transaction. */ private void readyLocks() { // Ready all locks. if (log.isDebugEnabled()) log.debug("Marking all local candidates as ready: " + this); readyLocks(req.writes()); if (tx.serializable() && tx.optimistic()) readyLocks(req.reads()); locksReady = true; }
/** * @param expVer Expected topology version. * @param curVer Current topology version. * @param req Request. * @return {@code True} if cache affinity changed and request should be remapped. */ private boolean needRemap(AffinityTopologyVersion expVer, AffinityTopologyVersion curVer, GridNearTxPrepareRequest req) { if (expVer.equals(curVer)) return false; // TODO IGNITE-6754 check mvcc crd for mvcc enabled txs. for (IgniteTxEntry e : F.concat(false, req.reads(), req.writes())) { GridCacheContext ctx = e.context(); Collection<ClusterNode> cacheNodes0 = ctx.discovery().cacheGroupAffinityNodes(ctx.groupId(), expVer); Collection<ClusterNode> cacheNodes1 = ctx.discovery().cacheGroupAffinityNodes(ctx.groupId(), curVer); if (!cacheNodes0.equals(cacheNodes1) || ctx.affinity().affinityTopologyVersion().compareTo(curVer) < 0) return true; try { List<List<ClusterNode>> aff1 = ctx.affinity().assignments(expVer); List<List<ClusterNode>> aff2 = ctx.affinity().assignments(curVer); if (!aff1.equals(aff2)) return true; } catch (IllegalStateException ignored) { return true; } } return false; }
userPrepare((serializable() && optimistic()) ? F.concat(false, req.writes(), req.reads()) : req.writes());
IgniteTxEntry firstRead = unmarshal(req.reads());