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/11/09 19:05:32 UTC

[geode] branch develop updated: GEODE-3595: remove getInstance calls (#1030)

This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new cd81d55  GEODE-3595: remove getInstance calls (#1030)
cd81d55 is described below

commit cd81d55724c903790808d03afba20bc0728d03b1
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Thu Nov 9 11:05:30 2017 -0800

    GEODE-3595: remove getInstance calls (#1030)
    
    GEODE-3595: remove getInstance calls
    
    DM.getExistingCache is now used instead.
---
 .../java/org/apache/geode/internal/cache/StateFlushOperation.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/StateFlushOperation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/StateFlushOperation.java
index 6509dea..fc3f075 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/StateFlushOperation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/StateFlushOperation.java
@@ -311,11 +311,9 @@ public class StateFlushOperation {
       if (region != null) {
         return region;
       }
-      // set the init level requirement so that we don't hang in CacheFactory.getInstance() (bug
-      // 36175)
       int oldLevel = LocalRegion.setThreadInitLevelRequirement(LocalRegion.BEFORE_INITIAL_IMAGE);
       try {
-        InternalCache gfc = (InternalCache) CacheFactory.getInstance(dm.getSystem());
+        InternalCache gfc = dm.getExistingCache();
         Region r = gfc.getRegionByPathForProcessing(this.regionPath);
         if (r instanceof DistributedRegion) {
           region = (DistributedRegion) r;
@@ -328,11 +326,9 @@ public class StateFlushOperation {
 
     /** returns a set of all DistributedRegions for allRegions processing */
     private Set<DistributedRegion> getAllRegions(DistributionManager dm) {
-      // set the init level requirement so that we don't hang in CacheFactory.getInstance() (bug
-      // 36175)
       int oldLevel = LocalRegion.setThreadInitLevelRequirement(LocalRegion.BEFORE_INITIAL_IMAGE);
       try {
-        InternalCache cache = (InternalCache) CacheFactory.getInstance(dm.getSystem());
+        InternalCache cache = dm.getExistingCache();
         Set<DistributedRegion> result = new HashSet();
         for (LocalRegion r : cache.getAllRegions()) {
           // it's important not to check if the cache is closing, so access

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].