You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2017/04/07 00:27:37 UTC
[2/2] geode git commit: added resumeProxy
added resumeProxy
Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/b665db44
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/b665db44
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/b665db44
Branch: refs/heads/feature/GEODE-2485
Commit: b665db44c28994ce42e82004943c8ee57a146192
Parents: e727633
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Thu Apr 6 17:26:56 2017 -0700
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Thu Apr 6 17:26:56 2017 -0700
----------------------------------------------------------------------
.../geode/internal/cache/TXManagerImpl.java | 26 +++++++++++---------
1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/geode/blob/b665db44/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
index 9b38efb..7ac616a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/TXManagerImpl.java
@@ -683,18 +683,8 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
LocalizedStrings.TXManagerImpl_TRANSACTION_0_ALREADY_IN_PROGRESS
.toLocalizedString(tid));
}
- if (tx instanceof TXState) {
- throw new java.lang.IllegalStateException("Found instance of TXState: " + tx);
- }
setTXState(tx);
tx.resume();
- SystemTimerTask task = this.expiryTasks.remove(tx.getTransactionId());
- if (task != null) {
- if (task.cancel()) {
- GemFireCacheImpl cache = (GemFireCacheImpl) this.cache;
- cache.purgeCCPTimer();
- }
- }
}
}
@@ -1268,7 +1258,7 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
throw new IllegalStateException(
LocalizedStrings.TXManagerImpl_UNKNOWN_TRANSACTION_OR_RESUMED.toLocalizedString());
}
- internalResume(txProxy);
+ resumeProxy(txProxy);
}
public boolean isSuspended(TransactionId transactionId) {
@@ -1281,11 +1271,23 @@ public class TXManagerImpl implements CacheTransactionManager, MembershipListene
}
TXStateProxy txProxy = this.suspendedTXs.remove(transactionId);
if (txProxy != null) {
- internalResume(txProxy);
+ resumeProxy(txProxy);
return true;
}
return false;
}
+
+ private void resumeProxy(TXStateProxy txProxy) {
+ assert txProxy != null;
+ internalResume(txProxy);
+ SystemTimerTask task = this.expiryTasks.remove(txProxy.getTransactionId());
+ if (task != null) {
+ if (task.cancel()) {
+ GemFireCacheImpl cache = (GemFireCacheImpl) this.cache;
+ cache.purgeCCPTimer();
+ }
+ }
+ }
/**
* this map keeps track of all the threads that are waiting in