/** * Collects versions of pending candidates versions less than base. * * @param entries Tx entries to process. * @param baseVer Base version. * @return Collection of pending candidates versions. */ private Collection<GridCacheVersion> localDhtPendingVersions(Iterable<IgniteTxEntry> entries, GridCacheVersion baseVer) { Collection<GridCacheVersion> lessPending = new GridLeanSet<>(5); for (IgniteTxEntry entry : entries) { try { for (GridCacheMvccCandidate cand : entry.cached().localCandidates()) { if (cand.version().isLess(baseVer)) lessPending.add(cand.version()); } } catch (GridCacheEntryRemovedException ignored) { // No-op, no candidates. } } return lessPending; }
locs = cached.localCandidates();
/** * @param topVer Topology version. * @param entries Entries. */ FinishLockFuture(Iterable<GridDistributedCacheEntry> entries, AffinityTopologyVersion topVer) { assert topVer.compareTo(AffinityTopologyVersion.ZERO) > 0; this.topVer = topVer; for (GridCacheEntryEx entry : entries) { // Either local or near local candidates. try { Collection<GridCacheMvccCandidate> locs = entry.localCandidates(); if (!F.isEmpty(locs)) { Collection<GridCacheMvccCandidate> cands = new ConcurrentLinkedQueue<>(); cands.addAll(F.view(locs, versionFilter())); if (!F.isEmpty(cands)) pendingLocks.put(entry.txKey(), cands); } } catch (GridCacheEntryRemovedException ignored) { if (exchLog.isDebugEnabled()) exchLog.debug("Got removed entry when adding it to finish lock future (will ignore): " + entry); } } if (exchLog.isDebugEnabled()) exchLog.debug("Pending lock set [topVer=" + topVer + ", locks=" + pendingLocks + ']'); }
/** * Collects versions of pending candidates versions less then base. * * @param entries Tx entries to process. * @param baseVer Base version. * @return Collection of pending candidates versions. */ private Collection<GridCacheVersion> localDhtPendingVersions(Iterable<GridCacheEntryEx> entries, GridCacheVersion baseVer) { Collection<GridCacheVersion> lessPending = new GridLeanSet<>(5); for (GridCacheEntryEx entry : entries) { // Since entries were collected before locks are added, some of them may become obsolete. while (true) { try { for (GridCacheMvccCandidate cand : entry.localCandidates()) { if (cand.version().isLess(baseVer)) lessPending.add(cand.version()); } break; // While. } catch (GridCacheEntryRemovedException ignored) { if (log.isDebugEnabled()) log.debug("Got removed entry is localDhtPendingVersions (will retry): " + entry); entry = entryExx(entry.key()); } } } return lessPending; }
for (GridCacheMvccCandidate cand : cached.localCandidates()) { if (!cand.owner() && cand.version().compareTo(baseVer) < 0) { if (log.isDebugEnabled())
Collection<GridCacheMvccCandidate> locCands = entry.localCandidates(); Collection<GridCacheMvccCandidate> rmtCands = entry.remoteMvccSnapshot();
assertTrue(entry.localCandidates().isEmpty()); assertTrue(entry.remoteMvccSnapshot().isEmpty());
assertTrue(entry.localCandidates().isEmpty()); assertTrue(entry.remoteMvccSnapshot().isEmpty());
/** * Collects versions of pending candidates versions less than base. * * @param entries Tx entries to process. * @param baseVer Base version. * @return Collection of pending candidates versions. */ private Collection<GridCacheVersion> localDhtPendingVersions(Iterable<IgniteTxEntry> entries, GridCacheVersion baseVer) { Collection<GridCacheVersion> lessPending = new GridLeanSet<>(5); for (IgniteTxEntry entry : entries) { try { for (GridCacheMvccCandidate cand : entry.cached().localCandidates()) { if (cand.version().isLess(baseVer)) lessPending.add(cand.version()); } } catch (GridCacheEntryRemovedException ignored) { // No-op, no candidates. } } return lessPending; }
locs = cached.localCandidates();
/** * @param topVer Topology version. * @param entries Entries. */ FinishLockFuture(Iterable<GridDistributedCacheEntry> entries, AffinityTopologyVersion topVer) { assert topVer.compareTo(AffinityTopologyVersion.ZERO) > 0; this.topVer = topVer; for (GridCacheEntryEx entry : entries) { // Either local or near local candidates. try { Collection<GridCacheMvccCandidate> locs = entry.localCandidates(); if (!F.isEmpty(locs)) { Collection<GridCacheMvccCandidate> cands = new ConcurrentLinkedQueue<>(); cands.addAll(F.view(locs, versionFilter())); if (!F.isEmpty(cands)) pendingLocks.put(entry.txKey(), cands); } } catch (GridCacheEntryRemovedException ignored) { if (exchLog.isDebugEnabled()) exchLog.debug("Got removed entry when adding it to finish lock future (will ignore): " + entry); } } if (exchLog.isDebugEnabled()) exchLog.debug("Pending lock set [topVer=" + topVer + ", locks=" + pendingLocks + ']'); }
/** * Collects versions of pending candidates versions less then base. * * @param entries Tx entries to process. * @param baseVer Base version. * @return Collection of pending candidates versions. */ private Collection<GridCacheVersion> localDhtPendingVersions(Iterable<GridCacheEntryEx> entries, GridCacheVersion baseVer) { Collection<GridCacheVersion> lessPending = new GridLeanSet<>(5); for (GridCacheEntryEx entry : entries) { // Since entries were collected before locks are added, some of them may become obsolete. while (true) { try { for (GridCacheMvccCandidate cand : entry.localCandidates()) { if (cand.version().isLess(baseVer)) lessPending.add(cand.version()); } break; // While. } catch (GridCacheEntryRemovedException ignored) { if (log.isDebugEnabled()) log.debug("Got removed entry is localDhtPendingVersions (will retry): " + entry); entry = entryExx(entry.key()); } } } return lessPending; }
for (GridCacheMvccCandidate cand : cached.localCandidates()) { if (!cand.owner() && cand.version().compareTo(baseVer) < 0) { if (log.isDebugEnabled())