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 6e31e9b57bccac18e5bfdd7bd0f36c2b20d482ad
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 5b2e3d76d0..d25ea1230e 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;

Reply via email to