geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [7/7] geode git commit: Change GemFireCacheImpl to InternalCache
Date Fri, 05 May 2017 17:32:34 GMT
Change GemFireCacheImpl to InternalCache


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/bccdb56e
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/bccdb56e
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/bccdb56e

Branch: refs/heads/feature/GEODE-2632-12
Commit: bccdb56e2752b644b6180ceee567deafcaf27fe2
Parents: 0c36d5f
Author: Kirk Lund <klund@apache.org>
Authored: Fri May 5 10:32:10 2017 -0700
Committer: Kirk Lund <klund@apache.org>
Committed: Fri May 5 10:32:10 2017 -0700

----------------------------------------------------------------------
 ...erConfigurationServiceEndToEndDUnitTest.java |   6 +-
 .../web/controllers/AddFreeItemToOrders.java    |  38 ++-
 .../RestAPIsAndInterOpsDUnitTest.java           |  10 +-
 .../controllers/RestAPIsWithSSLDUnitTest.java   |  13 +-
 .../geode/internal/cache/GemFireCacheImpl.java  |  12 +
 .../geode/internal/cache/InternalCache.java     |  28 +++
 .../geode/internal/cache/lru/HeapEvictor.java   |   8 +-
 .../cache/lru/HeapLRUCapacityController.java    |  20 +-
 .../internal/cache/lru/OffHeapEvictor.java      |   7 +-
 .../cache/partitioned/PartitionMessage.java     |  11 +-
 .../PartitionedRegionRebalanceOp.java           |  35 ++-
 .../rebalance/PartitionedRegionLoadModel.java   |  19 --
 .../cache/persistence/BackupManager.java        |  42 ++--
 .../snapshot/CacheSnapshotServiceImpl.java      |   7 +-
 .../internal/cache/snapshot/GFSnapshot.java     |  10 +-
 .../internal/cache/tier/CachedRegionHelper.java |   1 -
 .../cache/tier/InternalClientMembership.java    |   4 +-
 .../cache/tier/sockets/AcceptorImpl.java        |  26 +-
 .../cache/tier/sockets/BaseCommand.java         |  60 +++--
 .../cache/tier/sockets/CacheClientNotifier.java |  30 +--
 .../cache/tier/sockets/CacheClientProxy.java    |  24 +-
 .../cache/tier/sockets/CacheClientUpdater.java  | 137 +++++------
 .../cache/tier/sockets/ClientHealthMonitor.java |  94 ++-----
 .../cache/tier/sockets/ServerConnection.java    |   7 +-
 .../cache/tier/sockets/command/AddPdxEnum.java  |   8 +-
 .../cache/tier/sockets/command/AddPdxType.java  |   9 +-
 .../tier/sockets/command/ExecuteFunction.java   |   5 +-
 .../tier/sockets/command/ExecuteFunction65.java |   5 +-
 .../tier/sockets/command/ExecuteFunction66.java |   7 +-
 .../sockets/command/GatewayReceiverCommand.java |  18 +-
 .../tier/sockets/command/GetPDXEnumById.java    |   8 +-
 .../tier/sockets/command/GetPDXIdForEnum.java   |   8 +-
 .../tier/sockets/command/GetPDXIdForType.java   |   8 +-
 .../tier/sockets/command/GetPDXTypeById.java    |   8 +-
 .../tier/sockets/command/GetPdxEnums70.java     |   4 +-
 .../tier/sockets/command/GetPdxTypes70.java     |   4 +-
 .../cache/tier/sockets/command/Query.java       |   7 +-
 .../cache/tier/sockets/command/Query651.java    |  28 +--
 .../tier/sockets/command/RequestEventValue.java |   2 -
 .../tier/sockets/command/TXFailoverCommand.java |  13 +-
 .../internal/cache/tx/ClientTXStateStub.java    |  39 ++-
 .../internal/cache/tx/DistTxEntryEvent.java     |   7 +-
 .../cache/wan/AbstractGatewaySender.java        |  30 +--
 .../AbstractGatewaySenderEventProcessor.java    |  56 +++--
 .../cache/wan/GatewaySenderAdvisor.java         |  35 +--
 ...rentParallelGatewaySenderEventProcessor.java |  46 +---
 .../ParallelGatewaySenderEventProcessor.java    |  39 +--
 .../parallel/ParallelGatewaySenderQueue.java    | 130 ++--------
 .../parallel/ParallelQueueRemovalMessage.java   |   4 +-
 .../wan/serial/SerialGatewaySenderQueue.java    |  21 +-
 .../internal/cache/xmlcache/CacheCreation.java  |  30 +++
 .../cache/xmlcache/CacheXmlGenerator.java       | 130 ++--------
 .../internal/cache/xmlcache/CacheXmlParser.java |   5 +-
 .../xmlcache/RegionAttributesCreation.java      |  44 ++--
 .../internal/cache/xmlcache/RegionCreation.java |  40 ---
 .../apache/geode/internal/offheap/DataType.java |   7 +-
 .../internal/offheap/MemoryAllocatorImpl.java   |  23 +-
 .../management/internal/JmxManagerAdvisee.java  |  13 +-
 .../management/internal/JmxManagerAdvisor.java  |  21 +-
 .../management/internal/ManagementAgent.java    |  78 +++---
 .../management/internal/ManagementFunction.java |  12 +-
 .../geode/management/internal/Manager.java      |  28 +--
 .../geode/management/internal/RestAgent.java    |  14 +-
 .../internal/SystemManagementService.java       |  48 +---
 .../internal/beans/CacheServerBridge.java       |  35 +--
 .../internal/beans/DistributedSystemBridge.java | 105 +-------
 .../internal/beans/LocatorMBeanBridge.java      |  19 +-
 .../internal/beans/ManagementAdapter.java       | 128 +++-------
 .../internal/beans/ManagementListener.java      |  17 +-
 .../internal/beans/MemberMBeanBridge.java       | 195 ++++++---------
 .../internal/beans/RegionMBeanBridge.java       |  33 +--
 .../geode/management/internal/cli/CliUtil.java  | 114 +++++----
 .../cli/commands/AbstractCommandsSupport.java   |  29 ++-
 .../CreateAlterDestroyRegionCommands.java       | 103 ++++----
 .../internal/cli/commands/DataCommands.java     | 124 ++++------
 .../cli/commands/DiskStoreCommands.java         |  85 +++----
 ...xportImportClusterConfigurationCommands.java |  42 ++--
 .../cli/commands/ExportLogsCommand.java         |  48 ++--
 .../internal/cli/commands/FunctionCommands.java |  59 ++---
 .../internal/cli/commands/IndexCommands.java    |   3 +-
 .../cli/commands/MiscellaneousCommands.java     | 242 +++++++------------
 .../internal/cli/commands/StatusCommands.java   |  12 +-
 .../functions/AlterRuntimeConfigFunction.java   |  24 +-
 .../cli/functions/ContunuousQueryFunction.java  |  25 +-
 .../CreateAsyncEventQueueFunction.java          |  24 +-
 .../cli/functions/CreateDiskStoreFunction.java  |  10 +-
 .../internal/cli/functions/DeployFunction.java  |  18 +-
 .../cli/functions/DestroyDiskStoreFunction.java |   9 +-
 .../cli/functions/ExportLogsFunction.java       |  45 ++--
 .../FetchSharedConfigurationStatusFunction.java |   3 +-
 .../cli/functions/ListDeployedFunction.java     |   9 +-
 .../ShowMissingDiskStoresFunction.java          |   5 +-
 .../cli/functions/SizeExportLogsFunction.java   |  22 +-
 .../cli/functions/UndeployFunction.java         |   9 +-
 .../functions/GetRegionNamesFunction.java       |   3 +-
 .../functions/RecreateCacheFunction.java        |   4 +-
 .../internal/messages/CompactRequest.java       |  12 +-
 .../controllers/AbstractCommandsController.java |  38 +--
 .../pdx/internal/CheckTypeRegistryState.java    |   4 +-
 .../geode/pdx/internal/PdxInstanceImpl.java     |  49 +---
 .../geode/pdx/internal/PdxReaderImpl.java       |  19 +-
 .../geode/pdx/internal/PdxUnreadData.java       |  11 +-
 .../geode/pdx/internal/PdxWriterImpl.java       |  32 ++-
 .../pdx/internal/PeerTypeRegistration.java      |  19 +-
 .../pdx/internal/WritablePdxInstanceImpl.java   |   5 +-
 .../pdx/internal/json/PdxInstanceHelper.java    |  14 +-
 .../internal/json/PdxInstanceSortedHelper.java  | 127 +---------
 .../geode/pdx/internal/json/PdxListHelper.java  |  10 +-
 .../apache/geode/redis/GeodeRedisServer.java    |  66 ++---
 .../geode/redis/internal/RegionProvider.java    |   2 -
 .../internal/executor/list/ListExecutor.java    |   9 +-
 .../apache/geode/security/AuthInitialize.java   |  11 +-
 .../cache/partitioned/PartitionMessageTest.java |   4 +-
 .../commands/DiskStoreCommandsJUnitTest.java    |   5 +-
 .../cli/commands/IndexCommandsJUnitTest.java    |   3 +-
 .../cache/query/internal/cq/ServerCQImpl.java   |   7 +-
 .../internal/DestroyLuceneIndexMessage.java     |  31 ++-
 .../cli/LuceneIndexCommandsJUnitTest.java       |   4 +-
 .../apache/geode/cache/util/AutoBalancer.java   |   4 +-
 .../cache/wan/GatewayReceiverFactoryImpl.java   |  13 +-
 .../internal/cache/wan/GatewayReceiverImpl.java |  22 +-
 .../wan/GatewaySenderEventRemoteDispatcher.java |  23 +-
 .../cache/wan/GatewaySenderFactoryImpl.java     |  21 +-
 .../wan/parallel/ParallelGatewaySenderImpl.java |  14 +-
 .../wan/serial/SerialGatewaySenderImpl.java     |  13 +-
 125 files changed, 1481 insertions(+), 2405 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
index 1a97cb6..791f2ce 100644
--- a/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationServiceEndToEndDUnitTest.java
@@ -47,7 +47,7 @@ import org.apache.geode.distributed.Locator;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.internal.ClassBuilder;
 import org.apache.geode.internal.admin.remote.ShutdownAllRequest;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.cli.Result.Status;
 import org.apache.geode.management.internal.cli.HeadlessGfsh;
 import org.apache.geode.management.internal.cli.commands.CliCommandTestBase;
@@ -402,7 +402,7 @@ public class ClusterConfigurationServiceEndToEndDUnitTest extends CliCommandTest
         localProps.setProperty(LOCATORS, "localhost[" + locator1Port + "]");
         localProps.setProperty(NAME, "DataMember");
         getSystem(localProps);
-        Cache cache = getCache();
+        InternalCache cache = getCache();
         assertNotNull(cache);
         return getAllNormalMembers(cache);
       }
@@ -415,7 +415,7 @@ public class ClusterConfigurationServiceEndToEndDUnitTest extends CliCommandTest
     locatorAndMgr.invoke(new SerializableCallable() {
       @Override
       public Object call() throws Exception {
-        GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+        InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
         ShutdownAllRequest.send(cache.getInternalDistributedSystem().getDistributionManager(), -1);
         return null;
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java
index 67714ec..35d52c0 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/AddFreeItemToOrders.java
@@ -20,7 +20,6 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Vector;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.Region;
@@ -32,20 +31,17 @@ import org.apache.geode.cache.query.Query;
 import org.apache.geode.cache.query.QueryInvocationTargetException;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.TypeMismatchException;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.pdx.PdxInstance;
 
 /**
  * Gemfire function to add free items in the existing order if the total price for that order is
  * greater then the argument
  */
-
 public class AddFreeItemToOrders implements Function {
 
   public void execute(FunctionContext context) {
-
-    Cache c = null;
-    Region r = null;
+    Region region = null;
     List<Object> vals = new ArrayList<Object>();
     List<Object> keys = new ArrayList<Object>();
     List<Object> argsList = new ArrayList<Object>();
@@ -64,10 +60,11 @@ public class AddFreeItemToOrders implements Function {
       System.out.println("AddFreeItemToOrders : Invalid Arguments");
     }
 
+    InternalCache cache = null;
     try {
-      c = CacheFactory.getAnyInstance();
-      ((GemFireCacheImpl) c).getCacheConfig().setPdxReadSerialized(true);
-      r = c.getRegion("orders");
+      cache = (InternalCache) CacheFactory.getAnyInstance();
+      cache.getCacheConfig().setPdxReadSerialized(true);
+      region = cache.getRegion("orders");
     } catch (CacheClosedException ex) {
       vals.add("NoCacheFoundResult");
       context.getResultSender().lastResult(vals);
@@ -78,7 +75,7 @@ public class AddFreeItemToOrders implements Function {
     Object queryArgs[] = new Object[1];
     queryArgs[0] = argsList.get(0);
 
-    final Query query = c.getQueryService().newQuery(oql);
+    final Query query = cache.getQueryService().newQuery(oql);
 
     SelectResults result = null;
     try {
@@ -90,24 +87,24 @@ public class AddFreeItemToOrders implements Function {
           keys.add(item);
         }
     } catch (FunctionDomainException e) {
-      if (c != null)
-        c.getLogger()
+      if (cache != null)
+        cache.getLogger()
             .info("Caught FunctionDomainException while executing function AddFreeItemToOrders: "
                 + e.getMessage());
 
     } catch (TypeMismatchException e) {
-      if (c != null)
-        c.getLogger()
+      if (cache != null)
+        cache.getLogger()
             .info("Caught TypeMismatchException while executing function AddFreeItemToOrders: "
                 + e.getMessage());
     } catch (NameResolutionException e) {
-      if (c != null)
-        c.getLogger()
+      if (cache != null)
+        cache.getLogger()
             .info("Caught NameResolutionException while executing function AddFreeItemToOrders: "
                 + e.getMessage());
     } catch (QueryInvocationTargetException e) {
-      if (c != null)
-        c.getLogger().info(
+      if (cache != null)
+        cache.getLogger().info(
             "Caught QueryInvocationTargetException while executing function AddFreeItemToOrders"
                 + e.getMessage());
     }
@@ -116,13 +113,13 @@ public class AddFreeItemToOrders implements Function {
     try {
       Item it = (Item) (argsList.get(1));
       for (Object key : keys) {
-        Object obj = r.get(key);
+        Object obj = region.get(key);
         if (obj instanceof PdxInstance) {
           PdxInstance pi = (PdxInstance) obj;
           Order receivedOrder = (Order) pi.getObject();
           receivedOrder.addItem(it);
 
-          r.put(key, receivedOrder);
+          region.put(key, receivedOrder);
         }
       }
 
@@ -134,7 +131,6 @@ public class AddFreeItemToOrders implements Function {
     } catch (Exception e) {
       context.getResultSender().lastResult("failure");
     }
-
   }
 
   public String getId() {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
index 1802140..45e7a61 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsAndInterOpsDUnitTest.java
@@ -65,6 +65,7 @@ import org.apache.geode.distributed.DistributedSystem;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.pdx.PdxInstance;
 import org.apache.geode.test.dunit.Host;
 import org.apache.geode.test.dunit.NetworkUtils;
@@ -176,8 +177,8 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
     props.setProperty(HTTP_SERVICE_PORT, String.valueOf(restServicerPort));
 
     DistributedSystem ds = getSystem(props);
-    Cache cache = CacheFactory.create(ds);
-    ((GemFireCacheImpl) cache).setReadSerialized(true);
+    InternalCache cache = (InternalCache) CacheFactory.create(ds);
+    cache.setReadSerialized(true);
     AttributesFactory factory = new AttributesFactory();
 
     factory.setEnableBridgeConflation(true);
@@ -475,7 +476,7 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
      * ResponseEntity<String> result = RestTestUtils.getRestTemplate().exchange( restEndpoint +
      * "/People/1?op=cas", HttpMethod.PUT, entity, String.class); } } catch
      * (HttpClientErrorException e) {
-     * 
+     *
      * fail("Caught HttpClientErrorException while doing put with op=cas"); }catch
      * (HttpServerErrorException se) {
      * fail("Caught HttpServerErrorException while doing put with op=cas"); }
@@ -747,10 +748,7 @@ public class RestAPIsAndInterOpsDUnitTest extends LocatorTestBase {
 
   /**
    * InterOps Test between REST-client, Peer Cache Client and Client Cache
-   *
-   * @throws Exception
    */
-
   @Test
   public void testInterOpsWithReplicatedRegion() throws Exception {
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
index bb13966..6df3663 100644
--- a/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
+++ b/geode-assembly/src/test/java/org/apache/geode/rest/internal/web/controllers/RestAPIsWithSSLDUnitTest.java
@@ -67,6 +67,7 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.AvailablePort;
 import org.apache.geode.internal.AvailablePortHelper;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.management.ManagementException;
 import org.apache.geode.test.dunit.Host;
@@ -152,8 +153,8 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
     props = configureSSL(props, sslProperties, clusterLevel);
 
     DistributedSystem ds = getSystem(props);
-    Cache cache = CacheFactory.create(ds);
-    ((GemFireCacheImpl) cache).setReadSerialized(true);
+    InternalCache cache = (InternalCache) CacheFactory.create(ds);
+    cache.setReadSerialized(true);
 
     AttributesFactory factory = new AttributesFactory();
     factory.setEnableBridgeConflation(true);
@@ -276,7 +277,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
   }
 
   private void closeCache() {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    InternalCache cache = GemFireCacheImpl.getInstance();
     if (cache != null && !cache.isClosed()) {
       cache.close();
       cache.getDistributedSystem().disconnect();
@@ -293,9 +294,9 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
   }
 
   /**
-   * @Deprecated once the legacy SSL properties have been removed we need to remove this logic.
+   * @deprecated once the legacy SSL properties have been removed we need to remove this logic.
    */
-  @Deprecated()
+  @Deprecated
   private Properties configureSSL(Properties props, Properties sslProperties,
       boolean clusterLevel) {
 
@@ -368,7 +369,7 @@ public class RestAPIsWithSSLDUnitTest extends LocatorTestBase {
         if ((ex.getCause() instanceof BindException)
             || (ex.getCause() != null && ex.getCause().getCause() instanceof BindException)) {
           // close cache and disconnect
-          GemFireCacheImpl existingInstance = GemFireCacheImpl.getInstance();
+          InternalCache existingInstance = GemFireCacheImpl.getInstance();
           if (existingInstance != null) {
             existingInstance.close();
           }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
index e93def5..fbfd2b7 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java
@@ -932,6 +932,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     return this.isRESTServiceRunning;
   }
 
+  @Override
   public void setRESTServiceRunning(boolean isRESTServiceRunning) {
     this.isRESTServiceRunning = isRESTServiceRunning;
   }
@@ -941,6 +942,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
    * 
    * @return RestAgent
    */
+  @Override
   public RestAgent getRestAgent() {
     return this.restAgent;
   }
@@ -1925,6 +1927,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     close(false);
   }
 
+  @Override
   public void close(String reason, boolean keepAlive, boolean keepDS) {
     close(reason, null, keepAlive, keepDS);
   }
@@ -1972,6 +1975,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
    * 
    * @return the GatewaySender distributed lock service
    */
+  @Override
   public DistributedLockService getGatewaySenderLockService() {
     if (this.gatewayLockService == null) {
       synchronized (this.gatewayLockServiceLock) {
@@ -2751,10 +2755,12 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     return this.system.getSecurityInternalLogWriter();
   }
 
+  @Override
   public InternalLogWriter getInternalLogWriter() {
     return this.system.getInternalLogWriter();
   }
 
+  @Override
   public InternalLogWriter getSecurityInternalLogWriter() {
     return this.system.getSecurityInternalLogWriter();
   }
@@ -2804,6 +2810,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
    * @param declarable The declarable
    * @return Properties found for the given declarable
    */
+  @Override
   public Properties getDeclarableProperties(final Declarable declarable) {
     return this.declarablePropertiesMap.get(declarable);
   }
@@ -3204,6 +3211,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     return result;
   }
 
+  @Override
   public Set<LocalRegion> getApplicationRegions() {
     Set<LocalRegion> result = new HashSet<>();
     synchronized (this.rootRegions) {
@@ -3770,6 +3778,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     return addCacheServer(false);
   }
 
+  @Override
   public CacheServer addCacheServer(boolean isGatewayReceiver) {
     if (isClient()) {
       throw new UnsupportedOperationException("operation is not supported on a client cache");
@@ -3832,6 +3841,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     }
   }
 
+  @Override
   public void removeGatewaySender(GatewaySender sender) {
     if (isClient()) {
       throw new UnsupportedOperationException("operation is not supported on a client cache");
@@ -3852,6 +3862,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
     }
   }
 
+  @Override
   public void addGatewayReceiver(GatewayReceiver receiver) {
     if (isClient()) {
       throw new UnsupportedOperationException("operation is not supported on a client cache");
@@ -5084,6 +5095,7 @@ public class GemFireCacheImpl implements InternalCache, InternalClientCache, Has
   }
 
   // test hook
+  @Override
   public void setReadSerialized(boolean value) {
     this.cacheConfig.setPdxReadSerialized(value);
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
index 7313f71..c7ee361 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/InternalCache.java
@@ -41,6 +41,8 @@ import org.apache.geode.cache.client.internal.ClientMetadataService;
 import org.apache.geode.cache.query.QueryService;
 import org.apache.geode.cache.query.internal.QueryMonitor;
 import org.apache.geode.cache.query.internal.cq.CqService;
+import org.apache.geode.cache.server.CacheServer;
+import org.apache.geode.cache.wan.GatewayReceiver;
 import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.distributed.DistributedLockService;
 import org.apache.geode.distributed.internal.CacheTime;
@@ -56,8 +58,10 @@ import org.apache.geode.internal.cache.persistence.BackupManager;
 import org.apache.geode.internal.cache.persistence.PersistentMemberManager;
 import org.apache.geode.internal.cache.tier.sockets.CacheClientNotifier;
 import org.apache.geode.internal.cache.tier.sockets.ClientProxyMembershipID;
+import org.apache.geode.internal.logging.InternalLogWriter;
 import org.apache.geode.internal.offheap.MemoryAllocator;
 import org.apache.geode.management.internal.JmxManagerAdvisor;
+import org.apache.geode.management.internal.RestAgent;
 import org.apache.geode.pdx.internal.TypeRegistry;
 
 /**
@@ -274,4 +278,28 @@ public interface InternalCache extends Cache, Extensible<Cache>, CacheTime {
   boolean isQueryMonitorDisabledForLowMemory();
 
   boolean isRESTServiceRunning();
+
+  InternalLogWriter getInternalLogWriter();
+
+  InternalLogWriter getSecurityInternalLogWriter();
+
+  Set<LocalRegion> getApplicationRegions();
+
+  void removeGatewaySender(GatewaySender sender);
+
+  DistributedLockService getGatewaySenderLockService();
+
+  RestAgent getRestAgent();
+
+  Properties getDeclarableProperties(final Declarable declarable);
+
+  void setRESTServiceRunning(boolean isRESTServiceRunning);
+
+  void close(String reason, boolean keepAlive, boolean keepDS);
+
+  void addGatewayReceiver(GatewayReceiver receiver);
+
+  CacheServer addCacheServer(boolean isGatewayReceiver);
+
+  void setReadSerialized(boolean value);
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
index 707b408..2ff6ed6 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapEvictor.java
@@ -87,7 +87,7 @@ public class HeapEvictor implements ResourceListener<MemoryEvent> {
 
   private AtomicBoolean mustEvict = new AtomicBoolean(false);
 
-  protected final Cache cache;
+  protected final InternalCache cache;
 
   private final ArrayList<Integer> testTaskSetSizes = new ArrayList<>();
   public volatile int testAbortAfterLoopCount = Integer.MAX_VALUE;
@@ -96,7 +96,7 @@ public class HeapEvictor implements ResourceListener<MemoryEvent> {
 
   private final AtomicBoolean isRunning = new AtomicBoolean(true);
 
-  public HeapEvictor(Cache gemFireCache) {
+  public HeapEvictor(InternalCache gemFireCache) {
     this.cache = gemFireCache;
     initializeEvictorThreadPool();
   }
@@ -169,8 +169,8 @@ public class HeapEvictor implements ResourceListener<MemoryEvent> {
     return allRegionList;
   }
 
-  public GemFireCacheImpl getGemFireCache() {
-    return (GemFireCacheImpl) this.cache;
+  public InternalCache getGemFireCache() {
+    return (InternalCache) this.cache;
   }
 
   private void initializeEvictorThreadPool() {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapLRUCapacityController.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapLRUCapacityController.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapLRUCapacityController.java
index 2fd42f5..fdf694b 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapLRUCapacityController.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/HeapLRUCapacityController.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.internal.cache.lru;
 
+import java.util.Properties;
+
 import org.apache.geode.StatisticDescriptor;
 import org.apache.geode.StatisticsFactory;
 import org.apache.geode.StatisticsType;
@@ -23,21 +25,20 @@ import org.apache.geode.cache.EvictionAlgorithm;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.util.ObjectSizer;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.statistics.StatisticsTypeFactoryImpl;
-import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.cache.BucketRegion;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.Token;
 import org.apache.geode.internal.cache.control.InternalResourceManager;
 import org.apache.geode.internal.cache.persistence.DiskRegionView;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-
-import java.util.Properties;
+import org.apache.geode.internal.statistics.StatisticsTypeFactoryImpl;
 
 /**
  * A <code>HeapLRUCapacityController</code> controls the contents of {@link Region} based on the
  * percentage of memory that is currently being used. If the percentage of memory in use exceeds the
  * given percentage, then the least recently used entry of the region is evicted.
- * 
- * <P>
- * 
+ * <p>
  * For heap regions: GemStone has found that the <code>HeapLRUCapacityController</code> has the most
  * effect on a VM that is lauched with both the <code>-Xmx</code> and <code>-Xms</code> switches
  * used. Many virtual machine implementations have additional VM switches to control the behavior of
@@ -46,8 +47,7 @@ import java.util.Properties;
  * <A href="http://java.sun.com/docs/hotspot/gc/index.html">HotSpot</a> VM, the
  * <code>-XX:+UseConcMarkSweepGC</code> and <code>-XX:+UseParNewGC</code> options improve the
  * behavior of the <code>HeapLRUCapacityController</code>.
- * 
- * 
+ *
  * @since GemFire 3.2
  */
 @SuppressWarnings("synthetic-access")
@@ -268,7 +268,7 @@ public class HeapLRUCapacityController extends LRUAlgorithm {
        * greater than the overflow threshold, then we evict the LRU entry.
        */
       public boolean mustEvict(LRUStatistics stats, Region region, int delta) {
-        final GemFireCacheImpl cache = (GemFireCacheImpl) region.getRegionService();
+        final InternalCache cache = (InternalCache) region.getRegionService();
         InternalResourceManager resourceManager = cache.getInternalResourceManager();
         boolean offheap = region.getAttributes().getOffHeap();
         final boolean monitorStateIsEviction =

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/lru/OffHeapEvictor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/OffHeapEvictor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/OffHeapEvictor.java
index 2d2e7cc..058673f 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/lru/OffHeapEvictor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/lru/OffHeapEvictor.java
@@ -14,9 +14,8 @@
  */
 package org.apache.geode.internal.cache.lru;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.control.InternalResourceManager.ResourceType;
@@ -36,7 +35,7 @@ public class OffHeapEvictor extends HeapEvictor {
 
   private long bytesToEvictWithEachBurst;
 
-  public OffHeapEvictor(Cache gemFireCache) {
+  public OffHeapEvictor(InternalCache gemFireCache) {
     super(gemFireCache);
     calculateEvictionBurst();
   }
@@ -46,7 +45,7 @@ public class OffHeapEvictor extends HeapEvictor {
         DistributionConfig.GEMFIRE_PREFIX + "HeapLRUCapacityController.evictionBurstPercentage",
         "0.4"));
 
-    MemoryAllocator allocator = ((GemFireCacheImpl) this.cache).getOffHeapStore();
+    MemoryAllocator allocator = this.cache.getOffHeapStore();
 
     /*
      * Bail if there is no off-heap memory to evict.

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
index 2314674..5129044 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionMessage.java
@@ -53,6 +53,7 @@ import org.apache.geode.internal.cache.EntryEventImpl;
 import org.apache.geode.internal.cache.FilterRoutingInfo;
 import org.apache.geode.internal.cache.ForceReattemptException;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.PartitionedRegionException;
 import org.apache.geode.internal.cache.PrimaryBucketException;
@@ -259,7 +260,7 @@ public abstract class PartitionMessage extends DistributionMessage
    * check to see if the cache is closing
    */
   public boolean checkCacheClosing(DistributionManager dm) {
-    GemFireCacheImpl cache = getGemFireCacheImpl();
+    InternalCache cache = getInternalCache();
     // return (cache != null && cache.isClosed());
     return cache == null || cache.isClosed();
   }
@@ -278,11 +279,11 @@ public abstract class PartitionMessage extends DistributionMessage
     return PartitionedRegion.getPRFromId(this.regionId);
   }
 
-  GemFireCacheImpl getGemFireCacheImpl() {
+  InternalCache getInternalCache() {
     return GemFireCacheImpl.getInstance();
   }
 
-  TXManagerImpl getTXManagerImpl(GemFireCacheImpl cache) {
+  TXManagerImpl getTXManagerImpl(InternalCache cache) {
     return cache.getTxManager();
   }
 
@@ -327,7 +328,7 @@ public abstract class PartitionMessage extends DistributionMessage
       }
       thr = UNHANDLED_EXCEPTION;
 
-      GemFireCacheImpl cache = getGemFireCacheImpl();
+      InternalCache cache = getInternalCache();
       if (cache == null) {
         throw new ForceReattemptException(
             LocalizedStrings.PartitionMessage_REMOTE_CACHE_IS_CLOSED_0.toLocalizedString());
@@ -862,7 +863,7 @@ public abstract class PartitionMessage extends DistributionMessage
    * For Distributed Tx
    */
   private void setIfTransactionDistributed() {
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+    InternalCache cache = GemFireCacheImpl.getInstance();
     if (cache != null) {
       if (cache.getTxManager() != null) {
         this.isTransactionDistributed = cache.getTxManager().isDistributed();

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionRebalanceOp.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionRebalanceOp.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionRebalanceOp.java
index 38f9b45..e91bd15 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionRebalanceOp.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/PartitionedRegionRebalanceOp.java
@@ -14,6 +14,18 @@
  */
 package org.apache.geode.internal.cache.partitioned;
 
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.CancelException;
 import org.apache.geode.cache.partition.PartitionMemberInfo;
 import org.apache.geode.cache.partition.PartitionRebalanceInfo;
@@ -24,7 +36,7 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMembe
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.cache.BucketAdvisor;
 import org.apache.geode.internal.cache.ColocationHelper;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.PartitionedRegion.RecoveryLock;
 import org.apache.geode.internal.cache.control.InternalResourceManager;
@@ -33,15 +45,17 @@ import org.apache.geode.internal.cache.control.ResourceManagerStats;
 import org.apache.geode.internal.cache.partitioned.BecomePrimaryBucketMessage.BecomePrimaryBucketResponse;
 import org.apache.geode.internal.cache.partitioned.MoveBucketMessage.MoveBucketResponse;
 import org.apache.geode.internal.cache.partitioned.RemoveBucketMessage.RemoveBucketResponse;
-import org.apache.geode.internal.cache.partitioned.rebalance.*;
+import org.apache.geode.internal.cache.partitioned.rebalance.BucketOperator;
+import org.apache.geode.internal.cache.partitioned.rebalance.BucketOperatorImpl;
+import org.apache.geode.internal.cache.partitioned.rebalance.BucketOperatorWrapper;
+import org.apache.geode.internal.cache.partitioned.rebalance.ParallelBucketOperator;
+import org.apache.geode.internal.cache.partitioned.rebalance.PartitionedRegionLoadModel;
 import org.apache.geode.internal.cache.partitioned.rebalance.PartitionedRegionLoadModel.AddressComparor;
+import org.apache.geode.internal.cache.partitioned.rebalance.RebalanceDirector;
+import org.apache.geode.internal.cache.partitioned.rebalance.SimulatedBucketOperator;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.logging.log4j.Logger;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * This class performs a rebalance on a single partitioned region.
@@ -62,8 +76,6 @@ import java.util.concurrent.atomic.AtomicBoolean;
  * 
  * There is also a FPRDirector that creates buckets and moves primaries for fixed partititioned
  * regions.
- * 
- *
  */
 @SuppressWarnings("synthetic-access")
 public class PartitionedRegionRebalanceOp {
@@ -179,8 +191,7 @@ public class PartitionedRegionRebalanceOp {
       leaderRegion.getRegionAdvisor().addMembershipListener(listener);
       PartitionedRegionLoadModel model = null;
 
-
-      GemFireCacheImpl cache = (GemFireCacheImpl) leaderRegion.getCache();
+      InternalCache cache = leaderRegion.getCache();
       Map<PartitionedRegion, InternalPRInfo> detailsMap = fetchDetails(cache);
       BucketOperatorWrapper serialOperator = getBucketOperator(detailsMap);
       ParallelBucketOperator parallelOperator = new ParallelBucketOperator(MAX_PARALLEL_OPERATIONS,
@@ -324,7 +335,7 @@ public class PartitionedRegionRebalanceOp {
     }
 
     long start = System.nanoTime();
-    GemFireCacheImpl cache = (GemFireCacheImpl) leaderRegion.getCache();
+    InternalCache cache = leaderRegion.getCache();
     InternalResourceManager resourceManager =
         InternalResourceManager.getInternalResourceManager(cache);
     InternalResourceManager.getResourceObserver().recoveryStarted(targetRegion);
@@ -387,7 +398,7 @@ public class PartitionedRegionRebalanceOp {
     }
   }
 
-  private Map<PartitionedRegion, InternalPRInfo> fetchDetails(GemFireCacheImpl cache) {
+  private Map<PartitionedRegion, InternalPRInfo> fetchDetails(InternalCache cache) {
     LoadProbe probe = cache.getInternalResourceManager().getLoadProbe();
     Map<PartitionedRegion, InternalPRInfo> detailsMap =
         new LinkedHashMap<PartitionedRegion, InternalPRInfo>(colocatedRegions.size());

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModel.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModel.java b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModel.java
index ebf8fbe..46c55a0 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModel.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/PartitionedRegionLoadModel.java
@@ -32,7 +32,6 @@ import org.apache.geode.cache.partition.PartitionMemberInfo;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.cache.FixedPartitionAttributesImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.partitioned.InternalPartitionDetails;
 import org.apache.geode.internal.cache.partitioned.OfflineMemberDetails;
@@ -65,7 +64,6 @@ import org.apache.geode.internal.logging.log4j.LocalizedMessage;
  * This model is not threadsafe.
  * 
  * @since GemFire 6.0
- * 
  */
 @SuppressWarnings("synthetic-access")
 public class PartitionedRegionLoadModel {
@@ -147,7 +145,6 @@ public class PartitionedRegionLoadModel {
 
   private final PartitionedRegion partitionedRegion;
 
-
   /**
    * Create a new model
    * 
@@ -408,10 +405,7 @@ public class PartitionedRegionLoadModel {
         });
   }
 
-
-
   protected void remoteOverRedundancyBucket(BucketRollup bucket, Member targetMember) {
-
     Move bestMove = new Move(null, targetMember, bucket);
     Map<String, Long> colocatedRegionSizes = getColocatedRegionSizes(bucket);
 
@@ -1037,13 +1031,10 @@ public class PartitionedRegionLoadModel {
     Map<String, Member> getColocatedMembers() {
       return this.colocatedMembers;
     }
-
-
   }
 
   /**
    * Represents the sum of all of colocated buckets with a given bucket id.
-   *
    */
   protected class BucketRollup extends Bucket {
     private final Map<String, Bucket> colocatedBuckets = new HashMap<String, Bucket>();
@@ -1073,7 +1064,6 @@ public class PartitionedRegionLoadModel {
             primaryLoad = b.getPrimaryLoad();
           }
           rollup.updateLoad(b.getLoad(), primaryLoad, b.getBytes());
-
         }
         return true;
       }
@@ -1466,8 +1456,6 @@ public class PartitionedRegionLoadModel {
   /**
    * Represents a move from one node to another. Used to keep track of moves that we have already
    * attempted that have failed.
-   * 
-   *
    */
   protected static class Move {
     private final Member source;
@@ -1481,7 +1469,6 @@ public class PartitionedRegionLoadModel {
       this.bucket = bucket;
     }
 
-
     /**
      * @return the source
      */
@@ -1489,7 +1476,6 @@ public class PartitionedRegionLoadModel {
       return this.source;
     }
 
-
     /**
      * @return the target
      */
@@ -1497,7 +1483,6 @@ public class PartitionedRegionLoadModel {
       return this.target;
     }
 
-
     /**
      * @return the bucket
      */
@@ -1505,7 +1490,6 @@ public class PartitionedRegionLoadModel {
       return this.bucket;
     }
 
-
     @Override
     public int hashCode() {
       final int prime = 31;
@@ -1542,9 +1526,6 @@ public class PartitionedRegionLoadModel {
         return false;
       return true;
     }
-
-
-
   }
 
   public static interface AddressComparor {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/BackupManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/BackupManager.java b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/BackupManager.java
index 8e39e18..f464e0d 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/BackupManager.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/persistence/BackupManager.java
@@ -14,22 +14,6 @@
  */
 package org.apache.geode.internal.cache.persistence;
 
-import org.apache.commons.io.FileUtils;
-import org.apache.geode.InternalGemFireError;
-import org.apache.geode.cache.DiskStore;
-import org.apache.geode.cache.persistence.PersistentID;
-import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.DM;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.MembershipListener;
-import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.ClassPathLoader;
-import org.apache.geode.internal.DeployedJar;
-import org.apache.geode.internal.JarDeployer;
-import org.apache.geode.internal.cache.DiskStoreImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.i18n.LocalizedStrings;
-
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.FilenameFilter;
@@ -45,10 +29,25 @@ import java.util.concurrent.CountDownLatch;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.commons.io.FileUtils;
+
+import org.apache.geode.InternalGemFireError;
+import org.apache.geode.cache.DiskStore;
+import org.apache.geode.cache.persistence.PersistentID;
+import org.apache.geode.distributed.DistributedSystem;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.MembershipListener;
+import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.ClassPathLoader;
+import org.apache.geode.internal.DeployedJar;
+import org.apache.geode.internal.JarDeployer;
+import org.apache.geode.internal.cache.DiskStoreImpl;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.i18n.LocalizedStrings;
+
 /**
  * This class manages the state an logic to backup a single cache.
- * 
- *
  */
 public class BackupManager implements MembershipListener {
 
@@ -59,11 +58,11 @@ public class BackupManager implements MembershipListener {
   public static final String USER_FILES = "user";
   public static final String CONFIG = "config";
   private InternalDistributedMember sender;
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
   private CountDownLatch allowDestroys = new CountDownLatch(1);
   private volatile boolean isCancelled = false;
 
-  public BackupManager(InternalDistributedMember sender, GemFireCacheImpl gemFireCache) {
+  public BackupManager(InternalDistributedMember sender, InternalCache gemFireCache) {
     this.sender = sender;
     this.cache = gemFireCache;
   }
@@ -230,7 +229,6 @@ public class BackupManager implements MembershipListener {
         }
       }
 
-
       return persistentIds;
 
     } finally {
@@ -259,7 +257,7 @@ public class BackupManager implements MembershipListener {
       FileUtils.copyFile(new File(DistributedSystem.getPropertiesFile()), propertyBackup);
     }
 
-    // TODO sbawaska: should the gfsecurity.properties file be backed up?
+    // TODO: should the gfsecurity.properties file be backed up?
   }
 
   private void backupUserFiles(RestoreScript restoreScript, File backupDir) throws IOException {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
index 5a3c002..c9aeaed 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/CacheSnapshotServiceImpl.java
@@ -26,20 +26,19 @@ import org.apache.geode.cache.snapshot.CacheSnapshotService;
 import org.apache.geode.cache.snapshot.RegionSnapshotService;
 import org.apache.geode.cache.snapshot.SnapshotOptions;
 import org.apache.geode.cache.snapshot.SnapshotOptions.SnapshotFormat;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.snapshot.GFSnapshot.GFSnapshotImporter;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 
 /**
  * Provides an implementation for cache snapshots. Most of the implementation delegates to
  * {@link RegionSnapshotService}.
- * 
  */
 public class CacheSnapshotServiceImpl implements CacheSnapshotService {
   /** the cache */
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
 
-  public CacheSnapshotServiceImpl(GemFireCacheImpl cache) {
+  public CacheSnapshotServiceImpl(InternalCache cache) {
     this.cache = cache;
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
index 34ddd63..5ba8800 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java
@@ -24,28 +24,24 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.channels.FileChannel;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.NoSuchElementException;
-import java.util.TreeMap;
 
 import org.apache.geode.DataSerializer;
-import org.apache.geode.InternalGemFireError;
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.snapshot.SnapshotIterator;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.snapshot.SnapshotPacket.SnapshotRecord;
 import org.apache.geode.internal.i18n.LocalizedStrings;
-import org.apache.geode.pdx.PdxSerializationException;
 import org.apache.geode.pdx.internal.EnumInfo;
 import org.apache.geode.pdx.internal.PdxType;
 import org.apache.geode.pdx.internal.TypeRegistry;
 
 /**
  * Provides support for reading and writing snapshot files.
- * 
  */
 public class GFSnapshot {
   /**
@@ -260,7 +256,7 @@ public class GFSnapshot {
 
       // write pdx types
       try {
-        GemFireCacheImpl cache = GemFireCacheImpl
+        InternalCache cache = GemFireCacheImpl
             .getForPdx("PDX registry is unavailable because the Cache has been closed.");
         new ExportedRegistry(cache.getPdxRegistry()).toData(dos);
       } catch (CacheClosedException e) {
@@ -400,7 +396,7 @@ public class GFSnapshot {
     }
 
     private TypeRegistry getRegistry() {
-      GemFireCacheImpl gfc = GemFireCacheImpl.getInstance();
+      InternalCache gfc = GemFireCacheImpl.getInstance();
       if (gfc != null) {
         return gfc.getPdxRegistry();
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
index 0a182e6..a82a804 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/CachedRegionHelper.java
@@ -16,7 +16,6 @@ package org.apache.geode.internal.cache.tier;
 
 import org.apache.geode.CancelException;
 import org.apache.geode.SystemFailure;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.internal.cache.InternalCache;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
index aeabc86..7b291da 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/InternalClientMembership.java
@@ -28,6 +28,7 @@ import java.util.concurrent.ThreadPoolExecutor;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.logging.log4j.Logger;
 
@@ -41,7 +42,6 @@ import org.apache.geode.distributed.DistributedSystemDisconnectedException;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.internal.cache.CacheServerImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.tier.sockets.AcceptorImpl;
 import org.apache.geode.internal.cache.tier.sockets.ClientHealthMonitor;
 import org.apache.geode.internal.i18n.LocalizedStrings;
@@ -291,7 +291,7 @@ public final class InternalClientMembership {
 
   public static Map getClientQueueSizes() {
     Map clientQueueSizes = new HashMap();
-    GemFireCacheImpl c = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+    InternalCache c = (InternalCache) CacheFactory.getAnyInstance();
     if (c == null) // Add a NULL Check
       return clientQueueSizes;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java
index ed29472..9114367 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/AcceptorImpl.java
@@ -67,12 +67,15 @@ import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
-import org.apache.geode.distributed.internal.*;
-import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.distributed.internal.DM;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.distributed.internal.LonerDistributionManager;
+import org.apache.geode.distributed.internal.PooledExecutorWithDMStats;
+import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.internal.SystemTimer;
 import org.apache.geode.internal.cache.BucketAdvisor;
 import org.apache.geode.internal.cache.BucketAdvisor.BucketProfile;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.partitioned.AllBucketProfilesUpdateMessage;
@@ -83,10 +86,11 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LoggingThreadGroup;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.net.SocketCreatorFactory;
 import org.apache.geode.internal.security.IntegratedSecurityService;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.internal.net.SocketCreatorFactory;
 import org.apache.geode.internal.tcp.ConnectionTable;
 import org.apache.geode.internal.util.ArrayUtils;
 
@@ -375,9 +379,9 @@ public class AcceptorImpl extends Acceptor implements Runnable {
             .getSocketCreatorForComponent(SecurableCommunicationChannel.GATEWAY);
       }
 
-      final GemFireCacheImpl gc;
+      final InternalCache gc;
       if (getCachedRegionHelper() != null) {
-        gc = (GemFireCacheImpl) getCachedRegionHelper().getCache();
+        gc = getCachedRegionHelper().getCache();
       } else {
         gc = null;
       }
@@ -655,8 +659,7 @@ public class AcceptorImpl extends Acceptor implements Runnable {
               + this.localPort + " local port: " + this.serverSock.getLocalPort());
       this.selectorThread.start();
     }
-    GemFireCacheImpl myCache = (GemFireCacheImpl) cache;
-    Set<PartitionedRegion> prs = myCache.getPartitionedRegions();
+    Set<PartitionedRegion> prs = this.cache.getPartitionedRegions();
     for (PartitionedRegion pr : prs) {
       Map<Integer, BucketAdvisor.BucketProfile> profiles =
           new HashMap<Integer, BucketAdvisor.BucketProfile>();
@@ -957,7 +960,7 @@ public class AcceptorImpl extends Acceptor implements Runnable {
         {
           SystemFailure.checkFailure();
           // this.cache.getDistributedSystem().getCancelCriterion().checkCancelInProgress(null);
-          if (((GemFireCacheImpl) this.cache).isClosed()) { // bug 38834
+          if (this.cache.isClosed()) { // bug 38834
             break; // TODO should just ask cache's CancelCriterion
           }
           if (this.cache.getCancelCriterion().isCancelInProgress()) {
@@ -1559,9 +1562,8 @@ public class AcceptorImpl extends Acceptor implements Runnable {
   }
 
   private void notifyCacheMembersOfClose() {
-    GemFireCacheImpl myCache = (GemFireCacheImpl) cache;
-    if (!myCache.forcedDisconnect()) {
-      for (PartitionedRegion pr : myCache.getPartitionedRegions()) {
+    if (!this.cache.forcedDisconnect()) {
+      for (PartitionedRegion pr : this.cache.getPartitionedRegions()) {
         Map<Integer, BucketAdvisor.BucketProfile> profiles = new HashMap<>();
         // get all local real bucket advisors
         Map<Integer, BucketAdvisor> advisors = pr.getRegionAdvisor().getAllBucketAdvisors();

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
index d217672..58ba4b3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/BaseCommand.java
@@ -12,13 +12,39 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-/**
- *
- */
 package org.apache.geode.internal.cache.tier.sockets;
 
-import org.apache.geode.*;
-import org.apache.geode.cache.*;
+import java.io.EOFException;
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Semaphore;
+import java.util.regex.Pattern;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.CopyException;
+import org.apache.geode.InternalGemFireError;
+import org.apache.geode.SerializationException;
+import org.apache.geode.SystemFailure;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.CacheLoaderException;
+import org.apache.geode.cache.CacheWriterException;
+import org.apache.geode.cache.InterestResultPolicy;
+import org.apache.geode.cache.Operation;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.RegionDestroyedException;
+import org.apache.geode.cache.TransactionException;
 import org.apache.geode.cache.persistence.PartitionOfflineException;
 import org.apache.geode.cache.query.types.CollectionType;
 import org.apache.geode.distributed.DistributedSystemDisconnectedException;
@@ -27,8 +53,21 @@ import org.apache.geode.distributed.internal.DistributionStats;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.Version;
-import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.cache.CachedDeserializable;
+import org.apache.geode.internal.cache.DistributedRegion;
+import org.apache.geode.internal.cache.EntryEventImpl;
+import org.apache.geode.internal.cache.EntrySnapshot;
+import org.apache.geode.internal.cache.EventID;
+import org.apache.geode.internal.cache.FindVersionTagOperation;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.LocalRegion.NonTXEntry;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.PartitionedRegionHelper;
+import org.apache.geode.internal.cache.TXManagerImpl;
+import org.apache.geode.internal.cache.TXStateProxy;
+import org.apache.geode.internal.cache.Token;
+import org.apache.geode.internal.cache.VersionTagHolder;
 import org.apache.geode.internal.cache.tier.CachedRegionHelper;
 import org.apache.geode.internal.cache.tier.Command;
 import org.apache.geode.internal.cache.tier.InterestType;
@@ -44,13 +83,6 @@ import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.internal.sequencelog.EntryLogger;
 import org.apache.geode.security.GemFireSecurityException;
 
-import org.apache.logging.log4j.Logger;
-
-import java.io.*;
-import java.util.*;
-import java.util.concurrent.Semaphore;
-import java.util.regex.Pattern;
-
 public abstract class BaseCommand implements Command {
   protected static final Logger logger = LogService.getLogger();
 
@@ -125,7 +157,7 @@ public abstract class BaseCommand implements Command {
     boolean shouldMasquerade = shouldMasqueradeForTx(msg, servConn);
     try {
       if (shouldMasquerade) {
-        GemFireCacheImpl cache = (GemFireCacheImpl) servConn.getCache();
+        InternalCache cache = servConn.getCache();
         InternalDistributedMember member =
             (InternalDistributedMember) servConn.getProxyID().getDistributedMember();
         TXManagerImpl txMgr = cache.getTxManager();

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
index 28d6ae2..8a79fb6 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientNotifier.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.internal.cache.tier.sockets;
 
 import static org.apache.geode.distributed.ConfigurationProperties.*;
@@ -79,6 +78,7 @@ import org.apache.geode.distributed.internal.MessageWithReply;
 import org.apache.geode.distributed.internal.ReplyMessage;
 import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.internal.ClassLoadUtil;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.statistics.DummyStatisticsFactory;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.InternalInstantiator;
@@ -116,7 +116,6 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.InternalLogWriter;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
-import org.apache.geode.internal.net.SocketCloser;
 import org.apache.geode.security.AccessControl;
 import org.apache.geode.security.AuthenticationFailedException;
 import org.apache.geode.security.AuthenticationRequiredException;
@@ -125,7 +124,6 @@ import org.apache.geode.security.AuthenticationRequiredException;
  * Class <code>CacheClientNotifier</code> works on the server and manages client socket connections
  * to clients requesting notification of updates and notifies them when updates occur.
  *
- *
  * @since GemFire 3.2
  */
 @SuppressWarnings({"synthetic-access", "deprecation"})
@@ -1840,7 +1838,7 @@ public class CacheClientNotifier {
     ClientProxyMembershipID client = proxy.getProxyID();
     this._clientProxies.remove(client);
     this._connectionListener.queueRemoved();
-    ((GemFireCacheImpl) this.getCache()).cleanupForClient(this, client);
+    this.getCache().cleanupForClient(this, client);
     if (!(proxy.clientConflation == HandShake.CONFLATION_ON)) {
       ClientHealthMonitor chm = ClientHealthMonitor.getInstance();
       if (chm != null) {
@@ -2035,9 +2033,9 @@ public class CacheClientNotifier {
    * 
    * @return this <code>CacheClientNotifier</code>'s <code>Cache</code>
    */
-  protected Cache getCache() { // TODO:SYNC: looks wrong
+  protected InternalCache getCache() { // TODO:SYNC: looks wrong
     if (this._cache != null && this._cache.isClosed()) {
-      GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+      InternalCache cache = GemFireCacheImpl.getInstance();
       if (cache != null) {
         this._cache = cache;
         this.logWriter = cache.getInternalLogWriter();
@@ -2073,7 +2071,7 @@ public class CacheClientNotifier {
 
   /**
    * Constructor.
-   *
+   * 
    * @param cache The GemFire <code>Cache</code>
    * @param acceptorStats
    * @param maximumMessageCount
@@ -2082,11 +2080,11 @@ public class CacheClientNotifier {
    *        removed.
    * @param overflowAttributesList
    */
-  private CacheClientNotifier(Cache cache, CacheServerStats acceptorStats, int maximumMessageCount,
-      int messageTimeToLive, ConnectionListener listener, List overflowAttributesList,
-      boolean isGatewayReceiver) {
+  private CacheClientNotifier(InternalCache cache, CacheServerStats acceptorStats,
+      int maximumMessageCount, int messageTimeToLive, ConnectionListener listener,
+      List overflowAttributesList, boolean isGatewayReceiver) {
     // Set the Cache
-    this.setCache((GemFireCacheImpl) cache);
+    setCache(cache);
     this.acceptorStats = acceptorStats;
     this.socketCloser = new SocketCloser(1, 50); // we only need one thread per client and wait 50ms
                                                  // for close
@@ -2512,7 +2510,7 @@ public class CacheClientNotifier {
    * direct reference to _cache in CacheClientNotifier code. Instead, you should always use
    * <code>getCache()</code>
    */
-  private GemFireCacheImpl _cache;
+  private InternalCache _cache;
 
   private InternalLogWriter logWriter;
 
@@ -2631,9 +2629,8 @@ public class CacheClientNotifier {
     // lazily initialize haContainer in case this CCN instance was created by a gateway receiver
     if (overflowAttributesList != null
         && !HARegionQueue.HA_EVICTION_POLICY_NONE.equals(overflowAttributesList.get(0))) {
-      haContainer = new HAContainerRegion(_cache.getRegion(
-          Region.SEPARATOR + CacheServerImpl.clientMessagesRegion((GemFireCacheImpl) _cache,
-              (String) overflowAttributesList.get(0),
+      haContainer = new HAContainerRegion(_cache.getRegion(Region.SEPARATOR
+          + CacheServerImpl.clientMessagesRegion(_cache, (String) overflowAttributesList.get(0),
               ((Integer) overflowAttributesList.get(1)).intValue(),
               ((Integer) overflowAttributesList.get(2)).intValue(),
               (String) overflowAttributesList.get(3), (Boolean) overflowAttributesList.get(4))));
@@ -2664,11 +2661,10 @@ public class CacheClientNotifier {
   /**
    * @param _cache the _cache to set
    */
-  private void setCache(GemFireCacheImpl _cache) {
+  private void setCache(InternalCache _cache) {
     this._cache = _cache;
   }
 
-
   private class ExpireBlackListTask extends PoolTask {
     private ClientProxyMembershipID proxyID;
 

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
index 18f13f8..bc3765a 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientProxy.java
@@ -12,7 +12,6 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.internal.cache.tier.sockets;
 
 import java.io.ByteArrayInputStream;
@@ -39,11 +38,14 @@ import java.util.concurrent.locks.ReadWriteLock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.regex.Pattern;
 
+import org.apache.logging.log4j.Logger;
+import org.apache.shiro.subject.Subject;
+import org.apache.shiro.util.ThreadState;
+
 import org.apache.geode.CancelException;
 import org.apache.geode.DataSerializer;
 import org.apache.geode.StatisticsFactory;
 import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.CacheException;
 import org.apache.geode.cache.ClientSession;
 import org.apache.geode.cache.DynamicRegionFactory;
@@ -80,8 +82,8 @@ import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EnumListenerEvent;
 import org.apache.geode.internal.cache.EventID;
 import org.apache.geode.internal.cache.FilterProfile;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InterestRegistrationEventImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.StateFlushOperation;
@@ -102,16 +104,12 @@ import org.apache.geode.internal.logging.log4j.LogMarker;
 import org.apache.geode.internal.security.AuthorizeRequestPP;
 import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.security.AccessControl;
-import org.apache.logging.log4j.Logger;
-import org.apache.shiro.subject.Subject;
-import org.apache.shiro.util.ThreadState;
 
 /**
  * Class <code>CacheClientProxy</code> represents the server side of the {@link CacheClientUpdater}.
  * It queues messages to be sent from the server to the client. It then reads those messages from
  * the queue and sends them to the client.
  *
- *
  * @since GemFire 4.2
  */
 @SuppressWarnings("synthetic-access")
@@ -153,7 +151,7 @@ public class CacheClientProxy implements ClientSession {
   /**
    * The GemFire cache
    */
-  protected final GemFireCacheImpl _cache;
+  protected final InternalCache _cache;
 
   /**
    * The list of keys that the client represented by this proxy is interested in (stored by region)
@@ -345,7 +343,7 @@ public class CacheClientProxy implements ClientSession {
       Version clientVersion, long acceptorId, boolean notifyBySubscription) throws CacheException {
     initializeTransientFields(socket, proxyID, isPrimary, clientConflation, clientVersion);
     this._cacheClientNotifier = ccn;
-    this._cache = (GemFireCacheImpl) ccn.getCache();
+    this._cache = ccn.getCache();
     this._maximumMessageCount = ccn.getMaximumMessageCount();
     this._messageTimeToLive = ccn.getMessageTimeToLive();
     this._acceptorId = acceptorId;
@@ -620,7 +618,7 @@ public class CacheClientProxy implements ClientSession {
    *
    * @return the GemFire cache
    */
-  public GemFireCacheImpl getCache() {
+  public InternalCache getCache() {
     return this._cache;
   }
 
@@ -2344,7 +2342,7 @@ public class CacheClientProxy implements ClientSession {
       return this._proxy;
     }
 
-    private GemFireCacheImpl getCache() {
+    private InternalCache getCache() {
       return getProxy().getCache();
     }
 
@@ -2410,10 +2408,6 @@ public class CacheClientProxy implements ClientSession {
             Thread.sleep(500);
           } catch (InterruptedException e) {
             interrupted = true;
-            /*
-             * GemFireCache c = (GemFireCache)_cache;
-             * c.getDistributedSystem().getCancelCriterion().checkCancelInProgress(e);
-             */
           } catch (CancelException e) {
             break;
           } catch (CacheException e) {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
index f85ecb4..ca25b6e 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java
@@ -12,24 +12,68 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.internal.cache.tier.sockets;
 
-import org.apache.geode.*;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InterruptedIOException;
+import java.io.OutputStream;
+import java.net.ConnectException;
+import java.net.Socket;
+import java.net.SocketException;
+import java.nio.ByteBuffer;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import javax.net.ssl.SSLException;
+
+import org.apache.logging.log4j.Logger;
+
+import org.apache.geode.CancelException;
+import org.apache.geode.DataSerializer;
+import org.apache.geode.InvalidDeltaException;
+import org.apache.geode.StatisticDescriptor;
+import org.apache.geode.Statistics;
+import org.apache.geode.StatisticsType;
+import org.apache.geode.StatisticsTypeFactory;
+import org.apache.geode.SystemFailure;
 import org.apache.geode.cache.EntryNotFoundException;
 import org.apache.geode.cache.InterestResultPolicy;
 import org.apache.geode.cache.Operation;
 import org.apache.geode.cache.RegionDestroyedException;
 import org.apache.geode.cache.client.ServerRefusedConnectionException;
-import org.apache.geode.cache.client.internal.*;
+import org.apache.geode.cache.client.internal.ClientUpdater;
+import org.apache.geode.cache.client.internal.Endpoint;
+import org.apache.geode.cache.client.internal.EndpointManager;
+import org.apache.geode.cache.client.internal.GetEventValueOp;
+import org.apache.geode.cache.client.internal.PoolImpl;
+import org.apache.geode.cache.client.internal.QueueManager;
 import org.apache.geode.cache.query.internal.cq.CqService;
 import org.apache.geode.distributed.DistributedSystem;
-import org.apache.geode.distributed.internal.*;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.distributed.internal.DistributionStats;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.InternalDistributedSystem.DisconnectListener;
+import org.apache.geode.distributed.internal.ServerLocation;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
 import org.apache.geode.distributed.internal.membership.MemberAttributes;
-import org.apache.geode.internal.*;
-import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.Assert;
+import org.apache.geode.internal.InternalDataSerializer;
+import org.apache.geode.internal.InternalInstantiator;
+import org.apache.geode.internal.Version;
+import org.apache.geode.internal.cache.ClientServerObserver;
+import org.apache.geode.internal.cache.ClientServerObserverHolder;
+import org.apache.geode.internal.cache.EntryEventImpl;
+import org.apache.geode.internal.cache.EventID;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.tier.CachedRegionHelper;
 import org.apache.geode.internal.cache.tier.MessageType;
 import org.apache.geode.internal.cache.versions.ConcurrentCacheModificationException;
@@ -48,19 +92,6 @@ import org.apache.geode.internal.statistics.StatisticsTypeFactoryImpl;
 import org.apache.geode.security.AuthenticationFailedException;
 import org.apache.geode.security.AuthenticationRequiredException;
 import org.apache.geode.security.GemFireSecurityException;
-import org.apache.logging.log4j.Logger;
-
-import javax.net.ssl.SSLException;
-import java.io.*;
-import java.net.ConnectException;
-import java.net.Socket;
-import java.net.SocketException;
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * <code>CacheClientUpdater</code> is a thread that processes update messages from a cache server
@@ -114,10 +145,9 @@ public class CacheClientUpdater extends Thread implements ClientUpdater, Disconn
   /**
    * Cache for which we provide service
    */
-  private /* final */ GemFireCacheImpl cache;
+  private /* final */ InternalCache cache;
   private /* final */ CachedRegionHelper cacheHelper;
 
-
   /**
    * Principle flag to signal thread's run loop to terminate
    */
@@ -144,7 +174,8 @@ public class CacheClientUpdater extends Thread implements ClientUpdater, Disconn
   private boolean isOpCompleted;
 
   public final static String CLIENT_UPDATER_THREAD_NAME = "Cache Client Updater Thread ";
-  /*
+
+  /**
    * to enable test flag
    */
   public static boolean isUsedByTest;
@@ -155,20 +186,6 @@ public class CacheClientUpdater extends Thread implements ClientUpdater, Disconn
    */
   public static boolean fullValueRequested = false;
 
-  // /**
-  // * True if this thread been initialized. Indicates that the run thread is
-  // * initialized and ready to process messages
-  // * <p>
-  // * TODO is this still needed?
-  // * <p>
-  // * Accesses synchronized via <code>this</code>
-  // *
-  // * @see #notifyInitializationComplete()
-  // * @see #waitForInitialization()
-  // */
-  // private boolean initialized = false;
-
-
   private final ServerLocation location;
 
   // TODO - remove these fields
@@ -185,7 +202,7 @@ public class CacheClientUpdater extends Thread implements ClientUpdater, Disconn
    * @return true if cache appears
    */
   private boolean waitForCache() {
-    GemFireCacheImpl c;
+    InternalCache c;
     long tilt = System.currentTimeMillis() + MAX_CACHE_WAIT * 1000;
     for (;;) {
       if (quitting()) {
@@ -464,52 +481,6 @@ public class CacheClientUpdater extends Thread implements ClientUpdater, Disconn
     }
   }
 
-  // /**
-  // * Waits for this thread to be initialized
-  // *
-  // * @return true if initialized; false if stopped before init
-  // */
-  // public boolean waitForInitialization() {
-  // boolean result = false;
-  // // Yogesh : waiting on this thread object is a bad idea
-  // // as when thread exits it notifies to the waiting threads.
-  // synchronized (this) {
-  // for (;;) {
-  // if (quitting()) {
-  // break;
-  // }
-  // boolean interrupted = Thread.interrupted();
-  // try {
-  // this.wait(100); // spurious wakeup ok // timed wait, should fix lost notification problem
-  // rahul.
-  // }
-  // catch (InterruptedException e) {
-  // interrupted = true;
-  // }
-  // finally {
-  // if (interrupted) {
-  // Thread.currentThread().interrupt();
-  // }
-  // }
-  // } // while
-  // // Even if we succeed, there is a risk that we were shut down
-  // // Can't check for cache; it isn't set yet :-(
-  // this.system.getCancelCriterion().checkCancelInProgress(null);
-  // result = this.continueProcessing;
-  // } // synchronized
-  // return result;
-  // }
-
-  // /**
-  // * @see #waitForInitialization()
-  // */
-  // private void notifyInitializationComplete() {
-  // synchronized (this) {
-  // this.initialized = true;
-  // this.notifyAll();
-  // }
-  // }
-
   /**
    * Notifies this thread to stop processing
    */


Mime
View raw message