You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2022/03/19 00:00:21 UTC
[geode] 21/21: Rebase missed code changes in DistributedClearOperation
This is an automated email from the ASF dual-hosted git repository.
jinmeiliao pushed a commit to branch feature/GEODE-7665
in repository https://gitbox.apache.org/repos/asf/geode.git
commit e2411ffe4d9f17e9514957f2d22b65faf4f5a76e
Author: zhouxh <gz...@pivotal.io>
AuthorDate: Mon Mar 7 22:58:44 2022 -0800
Rebase missed code changes in DistributedClearOperation
---
.../apache/geode/internal/cache/DistributedClearOperation.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedClearOperation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedClearOperation.java
index 5b2e3d7..d25ea12 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedClearOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/DistributedClearOperation.java
@@ -215,7 +215,7 @@ public class DistributedClearOperation extends DistributedCacheOperation {
protected boolean operateOnRegion(CacheEvent event, ClusterDistributionManager dm)
throws EntryNotFoundException {
- DistributedRegion region = (DistributedRegion) event.getRegion();
+ LocalRegion region = (LocalRegion) event.getRegion();
switch (clearOp) {
case OP_CLEAR:
region.clearRegionLocally((RegionEventImpl) event, false, rvv);
@@ -223,9 +223,11 @@ public class DistributedClearOperation extends DistributedCacheOperation {
appliedOperation = true;
break;
case OP_LOCK_FOR_CLEAR:
- if (region.getDataPolicy().withStorage()) {
- DistributedClearOperation.regionLocked(getSender(), region.getFullPath(), region);
- region.lockLocallyForClear(dm, getSender(), event);
+ if (region.getDataPolicy().withStorage() && region instanceof DistributedRegion) {
+ DistributedRegion distributedRegion = (DistributedRegion) region;
+ DistributedClearOperation.regionLocked(getSender(), region.getFullPath(),
+ distributedRegion);
+ distributedRegion.lockLocallyForClear(dm, getSender(), event);
}
appliedOperation = true;
break;