geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [33/51] [abbrv] geode git commit: GEODE-2632: refactor code to use interfaces instead of impls
Date Fri, 21 Apr 2017 23:42:29 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
index 3ce1721..fd5d6a4 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ExportLogsFunction.java
@@ -13,7 +13,6 @@
  * the License.
  *
  */
-
 package org.apache.geode.management.internal.cli.functions;
 
 import org.apache.commons.lang.StringUtils;
@@ -56,17 +55,18 @@ import java.util.Arrays;
  * The function only extracts .log and .gfs files under server's working directory
  */
 public class ExportLogsFunction implements Function, InternalEntity {
+
   public static final String EXPORT_LOGS_REGION = "__exportLogsRegion";
+
   private static final Logger LOGGER = LogService.getLogger();
   private static final long serialVersionUID = 1L;
   private static final int BUFFER_SIZE = 1024;
 
-
   @Override
   public void execute(final FunctionContext context) {
     try {
       GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-      DistributionConfig config = cache.getDistributedSystem().getConfig();
+      DistributionConfig config = cache.getInternalDistributedSystem().getConfig();
 
       String memberId = cache.getDistributedSystem().getMemberId();
       LOGGER.info("ExportLogsFunction started for member {}", memberId);

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
index 1718898..06af662 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/SizeExportLogsFunction.java
@@ -44,7 +44,7 @@ public class SizeExportLogsFunction extends ExportLogsFunction implements Functi
   public void execute(final FunctionContext context) {
     try {
       GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-      DistributionConfig config = cache.getDistributedSystem().getConfig();
+      DistributionConfig config = cache.getInternalDistributedSystem().getConfig();
       Args args = (Args) context.getArguments();
       long diskAvailable = config.getLogFile().getUsableSpace();
       long diskSize = config.getLogFile().getTotalSpace();

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
index b98f759..5b82611 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/LonerTypeRegistration.java
@@ -108,7 +108,7 @@ public class LonerTypeRegistration implements TypeRegistration {
    * @return true if this member is a loner and we can't determine what type of registry they want.
    */
   public static boolean isIndeterminateLoner(GemFireCacheImpl cache) {
-    boolean isLoner = cache.getDistributedSystem().isLoner();
+    boolean isLoner = cache.getInternalDistributedSystem().isLoner();
     boolean pdxConfigured = cache.getPdxPersistent();
     return isLoner && !pdxConfigured/* && !hasGateways */;
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
index ed94c0c..b4fa33e 100644
--- a/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
+++ b/geode-core/src/main/java/org/apache/geode/pdx/internal/PeerTypeRegistration.java
@@ -116,7 +116,7 @@ public class PeerTypeRegistration implements TypeRegistration {
 
 
     int distributedSystemId =
-        cache.getDistributedSystem().getDistributionManager().getDistributedSystemId();
+        cache.getInternalDistributedSystem().getDistributionManager().getDistributedSystemId();
     if (distributedSystemId == -1) {
       distributedSystemId = 0;
     }
@@ -226,9 +226,9 @@ public class PeerTypeRegistration implements TypeRegistration {
     synchronized (this.dlsLock) {
       if (this.dls == null) {
         try {
-          this.dls = DLockService.create(LOCK_SERVICE_NAME, this.cache.getDistributedSystem(),
-              true /* distributed */, true /* destroyOnDisconnect */,
-              true /* automateFreeResources */);
+          this.dls = DLockService.create(LOCK_SERVICE_NAME,
+              this.cache.getInternalDistributedSystem(), true /* distributed */,
+              true /* destroyOnDisconnect */, true /* automateFreeResources */);
         } catch (IllegalArgumentException e) {
           this.dls = DistributedLockService.getServiceNamed(LOCK_SERVICE_NAME);
           if (this.dls == null) {
@@ -334,7 +334,7 @@ public class PeerTypeRegistration implements TypeRegistration {
    */
   private boolean useUDPMessagingIfNecessary() {
     boolean result = false;
-    InternalDistributedSystem sys = cache.getDistributedSystem();
+    InternalDistributedSystem sys = cache.getInternalDistributedSystem();
     if (sys != null && !sys.threadOwnsResources()) {
       sys.getDistributionManager().forceUDPMessagingForCurrentThread();
       result = true;
@@ -344,7 +344,7 @@ public class PeerTypeRegistration implements TypeRegistration {
 
   private void releaseUDPMessaging(boolean release) {
     if (release) {
-      InternalDistributedSystem sys = cache.getDistributedSystem();
+      InternalDistributedSystem sys = cache.getInternalDistributedSystem();
       if (sys != null) {
         sys.getDistributionManager().releaseUDPMessagingForCurrentThread();
       }
@@ -551,7 +551,7 @@ public class PeerTypeRegistration implements TypeRegistration {
           "The PDX metadata must be persistent in a member that has persistent data. See CacheFactory.setPdxPersistent.");
     }
     int distributedSystemId =
-        cache.getDistributedSystem().getDistributionManager().getDistributedSystemId();
+        cache.getInternalDistributedSystem().getDistributionManager().getDistributedSystemId();
     if (hasGatewaySender && distributedSystemId == -1) {
       throw new PdxInitializationException(
           "When using PDX with a WAN gateway sender, you must set the distributed-system-id gemfire property for your distributed system. See the javadocs for DistributedSystem.");

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplJUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplJUnitTest.java
index 6e9c2d3..1c203bb 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/asyncqueue/internal/SerialAsyncEventQueueImplJUnitTest.java
@@ -16,6 +16,7 @@ package org.apache.geode.cache.asyncqueue.internal;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.wan.GatewaySenderAttributes;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.junit.After;
@@ -29,12 +30,12 @@ import static org.junit.Assert.assertEquals;
 @Category(IntegrationTest.class)
 public class SerialAsyncEventQueueImplJUnitTest {
 
-  private Cache cache;
+  private InternalCache cache;
 
   @Before
   public void setUp() {
     CacheFactory cf = new CacheFactory().set(MCAST_PORT, "0");
-    cache = cf.create();
+    cache = (InternalCache) cf.create();
   }
 
   @After

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
index 68ef7f0..b3f39ee 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/ReconnectDUnitTest.java
@@ -1113,7 +1113,8 @@ public class ReconnectDUnitTest extends JUnit4CacheTestCase {
     final GemFireCacheImpl cache = ReconnectDUnitTest.savedCache;
     Wait.waitForCriterion(new WaitCriterion() {
       public boolean done() {
-        return cache.isReconnecting() || cache.getDistributedSystem().isReconnectCancelled();
+        return cache.isReconnecting()
+            || cache.getInternalDistributedSystem().isReconnectCancelled();
       }
 
       public String description() {
@@ -1125,7 +1126,7 @@ public class ReconnectDUnitTest extends JUnit4CacheTestCase {
     } catch (InterruptedException e) {
       fail("interrupted");
     }
-    assertTrue(cache.getDistributedSystem().isReconnectCancelled());
+    assertTrue(cache.getInternalDistributedSystem().isReconnectCancelled());
     assertNull(cache.getReconnectedCache());
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/cache30/ReconnectedCacheServerDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/ReconnectedCacheServerDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/ReconnectedCacheServerDUnitTest.java
index 2a2fe73..6ba098f 100755
--- a/geode-core/src/test/java/org/apache/geode/cache30/ReconnectedCacheServerDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/ReconnectedCacheServerDUnitTest.java
@@ -14,16 +14,10 @@
  */
 package org.apache.geode.cache30;
 
-import org.apache.geode.test.junit.categories.ClientServerTest;
-import org.apache.geode.test.junit.categories.MembershipTest;
-import org.junit.experimental.categories.Category;
-import org.junit.Test;
-
 import static org.junit.Assert.*;
 
-import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
-import org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;
-import org.apache.geode.test.junit.categories.DistributedTest;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.server.CacheServer;
@@ -32,15 +26,15 @@ import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.membership.gms.MembershipManagerHelper;
 import org.apache.geode.distributed.internal.membership.gms.mgr.GMSMembershipManager;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
-
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;
+import org.apache.geode.test.junit.categories.ClientServerTest;
+import org.apache.geode.test.junit.categories.DistributedTest;
+import org.apache.geode.test.junit.categories.MembershipTest;
 
 @Category({DistributedTest.class, MembershipTest.class, ClientServerTest.class})
 public class ReconnectedCacheServerDUnitTest extends JUnit4CacheTestCase {
 
-  public ReconnectedCacheServerDUnitTest() {
-    super();
-  }
-
   private static final long serialVersionUID = 1L;
 
   private boolean addedCacheServer = false;
@@ -72,7 +66,7 @@ public class ReconnectedCacheServerDUnitTest extends JUnit4CacheTestCase {
     assertFalse(
         Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "autoReconnect-useCacheXMLFile"));
 
-    GemFireCacheImpl gc = (GemFireCacheImpl) this.cache;
+    InternalCache gc = (InternalCache) this.cache;
 
     // fool the system into thinking cluster-config is being used
     GMSMembershipManager mgr = (GMSMembershipManager) MembershipManagerHelper
@@ -104,7 +98,7 @@ public class ReconnectedCacheServerDUnitTest extends JUnit4CacheTestCase {
 
     assertNotNull(gc.getCacheConfig().getCacheServerCreation());
 
-    InternalDistributedSystem system = gc.getDistributedSystem();
+    InternalDistributedSystem system = gc.getInternalDistributedSystem();
     system.createAndStartCacheServers(gc.getCacheConfig().getCacheServerCreation(), gc);
 
     assertEquals("found these cache servers:" + gc.getCacheServers(), numServers,

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/cache30/TXDistributedDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/cache30/TXDistributedDUnitTest.java b/geode-core/src/test/java/org/apache/geode/cache30/TXDistributedDUnitTest.java
index e268c22..c8a629c 100644
--- a/geode-core/src/test/java/org/apache/geode/cache30/TXDistributedDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache30/TXDistributedDUnitTest.java
@@ -1387,7 +1387,7 @@ public class TXDistributedDUnitTest extends JUnit4CacheTestCase {
                 af.setDiskStoreName(diskStoreName);
                 gfc.createVMRegion(rgnName1, af.create(), ira);
                 gfc.createVMRegion(rgnName2, af.create(), ira);
-                gfc.getDistributedSystem().addResourceListener(new ShutdownListener());
+                gfc.getInternalDistributedSystem().addResourceListener(new ShutdownListener());
               } catch (IOException ioe) {
                 fail(ioe.toString());
               } catch (TimeoutException e) {
@@ -1462,7 +1462,7 @@ public class TXDistributedDUnitTest extends JUnit4CacheTestCase {
         public Object call() throws Exception {
           GemFireCacheImpl cache = (GemFireCacheImpl) getCache();
           List<ResourceEventsListener> listeners =
-              cache.getDistributedSystem().getResourceListeners();
+              cache.getInternalDistributedSystem().getResourceListeners();
           for (ResourceEventsListener l : listeners) {
             if (l instanceof ShutdownListener) {
               ShutdownListener shutListener = (ShutdownListener) l;

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
index 6d04773..5d81724 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/BackupJUnitTest.java
@@ -201,7 +201,8 @@ public class BackupJUnitTest {
       assertNull(region.get(i));
     }
 
-    BackupManager backup = cache.startBackup(cache.getDistributedSystem().getDistributedMember());
+    BackupManager backup =
+        cache.startBackup(cache.getInternalDistributedSystem().getDistributedMember());
     backup.prepareBackup();
     backup.finishBackup(backupDir, null, false);
 
@@ -249,7 +250,8 @@ public class BackupJUnitTest {
   public void testBackupEmptyDiskStore() throws IOException, InterruptedException {
     DiskStoreImpl ds = createDiskStore();
 
-    BackupManager backup = cache.startBackup(cache.getDistributedSystem().getDistributedMember());
+    BackupManager backup =
+        cache.startBackup(cache.getInternalDistributedSystem().getDistributedMember());
     backup.prepareBackup();
     backup.finishBackup(backupDir, null, false);
     assertEquals("No backup files should have been created", Collections.emptyList(),
@@ -264,7 +266,8 @@ public class BackupJUnitTest {
     // from a backup that doesn't contain this key
     region.put("A", "A");
 
-    BackupManager backup = cache.startBackup(cache.getDistributedSystem().getDistributedMember());
+    BackupManager backup =
+        cache.startBackup(cache.getInternalDistributedSystem().getDistributedMember());
     backup.prepareBackup();
     backup.finishBackup(backupDir, null, false);
 
@@ -303,7 +306,8 @@ public class BackupJUnitTest {
     // from a backup that doesn't contain this key
     region.put("A", "A");
 
-    ds.finishBackup(new BackupManager(cache.getDistributedSystem().getDistributedMember(), cache));
+    ds.finishBackup(
+        new BackupManager(cache.getInternalDistributedSystem().getDistributedMember(), cache));
     script.generate(backupDir);
 
     cache.close();
@@ -322,7 +326,8 @@ public class BackupJUnitTest {
     DiskStoreImpl ds = createDiskStore();
     createRegion();
 
-    BackupManager backup = cache.startBackup(cache.getDistributedSystem().getDistributedMember());
+    BackupManager backup =
+        cache.startBackup(cache.getInternalDistributedSystem().getDistributedMember());
     backup.prepareBackup();
     backup.finishBackup(backupDir, null, false);
     Collection<File> fileCollection = FileUtils.listFiles(backupDir,

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
index 26412b2..f293c21 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/NetSearchMessagingDUnitTest.java
@@ -370,7 +370,7 @@ public class NetSearchMessagingDUnitTest extends JUnit4CacheTestCase {
 
       public Object call() {
         GemFireCacheImpl cache = (GemFireCacheImpl) getCache();
-        return cache.getDistributedSystem().getDMStats().getReceivedMessages();
+        return cache.getInternalDistributedSystem().getDMStats().getReceivedMessages();
       }
     })).intValue();
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/internal/cache/SearchLoadAndWriteProcessorTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/SearchLoadAndWriteProcessorTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/SearchLoadAndWriteProcessorTest.java
index 91ac16b..f38f2ad 100644
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/SearchLoadAndWriteProcessorTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/SearchLoadAndWriteProcessorTest.java
@@ -104,6 +104,7 @@ public class SearchLoadAndWriteProcessorTest {
     when(lr.getScope()).thenReturn(Scope.DISTRIBUTED_ACK);
     when(lr.getCancelCriterion()).thenReturn(mock(CancelCriterion.class));
     when(cache.getDistributedSystem()).thenReturn(ds);
+    when(cache.getInternalDistributedSystem()).thenReturn(ds);
     when(cache.getSearchTimeout()).thenReturn(30);
     when(attrs.getScope()).thenReturn(Scope.DISTRIBUTED_ACK);
     when(attrs.getDataPolicy()).thenReturn(DataPolicy.EMPTY);

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessageJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessageJUnitTest.java b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessageJUnitTest.java
index 66b1994..7f207d0 100755
--- a/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessageJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/internal/cache/partitioned/FetchEntriesMessageJUnitTest.java
@@ -72,7 +72,7 @@ public class FetchEntriesMessageJUnitTest {
   public void testProcessChunk() throws Exception {
     cache = Fakes.cache();
     PartitionedRegion pr = mock(PartitionedRegion.class);
-    InternalDistributedSystem system = cache.getDistributedSystem();
+    InternalDistributedSystem system = cache.getInternalDistributedSystem();
 
     FetchEntriesResponse response = new FetchEntriesResponse(system, pr, null, 0);
     HeapDataOutputStream chunkStream = createDummyChunk();

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
----------------------------------------------------------------------
diff --git a/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java b/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
index 2ab64dd..6a1e26f 100644
--- a/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
+++ b/geode-core/src/test/java/org/apache/geode/test/fake/Fakes.java
@@ -14,6 +14,12 @@
  */
 package org.apache.geode.test.fake;
 
+import static org.mockito.Mockito.*;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.LogWriter;
 import org.apache.geode.Statistics;
@@ -29,13 +35,6 @@ import org.apache.geode.distributed.internal.membership.InternalDistributedMembe
 import org.apache.geode.internal.cache.CachePerfStats;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 
-import java.io.File;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.mockito.Mockito.*;
-
 /**
  * Factory methods for fake objects for use in test.
  * 
@@ -74,6 +73,7 @@ public class Fakes {
     when(config.getDeployWorkingDir()).thenReturn(new File("."));
 
     when(cache.getDistributedSystem()).thenReturn(system);
+    when(cache.getInternalDistributedSystem()).thenReturn(system);
     when(cache.getSystem()).thenReturn(system);
     when(cache.getMyId()).thenReturn(member);
     when(cache.getDistributionManager()).thenReturn(distributionManager);
@@ -102,7 +102,7 @@ public class Fakes {
    * A fake distributed system, which contains a fake distribution manager.
    */
   public static InternalDistributedSystem distributedSystem() {
-    return cache().getDistributedSystem();
+    return cache().getInternalDistributedSystem();
   }
 
   /**
@@ -134,5 +134,4 @@ public class Fakes {
   }
 
   private Fakes() {}
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
index fe85efe..fea4845 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegion.java
@@ -15,9 +15,10 @@
 
 package org.apache.geode.cache.lucene.internal;
 
+import java.util.Set;
+
 import org.apache.geode.CancelException;
 import org.apache.geode.cache.AttributesFactory;
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.FixedPartitionResolver;
 import org.apache.geode.cache.PartitionAttributes;
 import org.apache.geode.cache.PartitionAttributesFactory;
@@ -25,11 +26,9 @@ import org.apache.geode.cache.PartitionResolver;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueImpl;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.lucene.internal.directory.DumpDirectoryFiles;
-import org.apache.geode.cache.lucene.internal.filesystem.File;
 import org.apache.geode.cache.lucene.internal.filesystem.FileSystemStats;
 import org.apache.geode.cache.lucene.internal.partition.BucketTargetingFixedResolver;
 import org.apache.geode.cache.lucene.internal.partition.BucketTargetingResolver;
@@ -40,11 +39,9 @@ import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.ReplyException;
 import org.apache.geode.distributed.internal.ReplyProcessor21;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionedRegion;
 
-import java.util.Set;
-
 /* wrapper of IndexWriter */
 public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
   protected Region fileAndChunkRegion;
@@ -52,7 +49,7 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
 
   public static final String FILES_REGION_SUFFIX = ".files";
 
-  public LuceneIndexForPartitionedRegion(String indexName, String regionPath, Cache cache) {
+  public LuceneIndexForPartitionedRegion(String indexName, String regionPath, InternalCache cache) {
     super(indexName, regionPath, cache);
 
     final String statsName = indexName + "-" + regionPath;
@@ -89,7 +86,7 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
     HeterogeneousLuceneSerializer mapper = new HeterogeneousLuceneSerializer(getFieldNames());
     PartitionedRepositoryManager partitionedRepositoryManager =
         new PartitionedRepositoryManager(this, mapper);
-    DM dm = ((GemFireCacheImpl) getCache()).getDistributedSystem().getDistributionManager();
+    DM dm = this.cache.getInternalDistributedSystem().getDistributionManager();
     LuceneBucketListener lucenePrimaryBucketListener =
         new LuceneBucketListener(partitionedRepositoryManager, dm);
 
@@ -169,10 +166,7 @@ public class LuceneIndexForPartitionedRegion extends LuceneIndexImpl {
     return createRegion(regionName, attributes);
   }
 
-  public void close() {
-    // TODO Auto-generated method stub
-
-  }
+  public void close() {}
 
   @Override
   public void dumpFiles(final String directory) {

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImpl.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImpl.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImpl.java
index d58f856..36f6720 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImpl.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImpl.java
@@ -12,13 +12,11 @@
  * or implied. See the License for the specific language governing permissions and limitations under
  * the License.
  */
-
 package org.apache.geode.cache.lucene.internal;
 
 import java.util.Collections;
 import java.util.Map;
 
-import org.apache.geode.internal.cache.extension.Extension;
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -33,10 +31,11 @@ import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueFactoryImpl;
 import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueImpl;
 import org.apache.geode.cache.lucene.internal.repository.RepositoryManager;
 import org.apache.geode.cache.lucene.internal.xml.LuceneIndexCreation;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.extension.Extension;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 
@@ -45,7 +44,7 @@ public abstract class LuceneIndexImpl implements InternalLuceneIndex {
 
   protected final String indexName;
   protected final String regionPath;
-  protected final Cache cache;
+  protected final InternalCache cache;
   protected final LuceneIndexStats indexStats;
 
   protected boolean hasInitialized = false;
@@ -55,7 +54,7 @@ public abstract class LuceneIndexImpl implements InternalLuceneIndex {
   protected Analyzer analyzer;
   protected LocalRegion dataRegion;
 
-  protected LuceneIndexImpl(String indexName, String regionPath, Cache cache) {
+  protected LuceneIndexImpl(String indexName, String regionPath, InternalCache cache) {
     this.indexName = indexName;
     this.regionPath = regionPath;
     this.cache = cache;
@@ -229,7 +228,7 @@ public abstract class LuceneIndexImpl implements InternalLuceneIndex {
 
     // Create the region
     try {
-      return ((GemFireCacheImpl) this.cache).createVMRegion(regionName, attributes, ira);
+      return this.cache.createVMRegion(regionName, attributes, ira);
     } catch (Exception e) {
       InternalGemFireError ige = new InternalGemFireError(
           LocalizedStrings.GemFireCache_UNEXPECTED_EXCEPTION.toLocalizedString());

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplFactory.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplFactory.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplFactory.java
index 5da2732..e99f3d9 100755
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplFactory.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplFactory.java
@@ -14,12 +14,13 @@
  */
 package org.apache.geode.cache.lucene.internal;
 
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 
 public class LuceneIndexImplFactory {
+
   public LuceneIndexImplFactory() {}
 
-  public LuceneIndexImpl create(String indexName, String regionPath, GemFireCacheImpl cache) {
+  public LuceneIndexImpl create(String indexName, String regionPath, InternalCache cache) {
     return new LuceneIndexForPartitionedRegion(indexName, regionPath, cache);
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndex.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndex.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndex.java
index f4518aa..75ab5ca 100755
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndex.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndex.java
@@ -14,14 +14,13 @@
  */
 package org.apache.geode.cache.lucene.internal;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.lucene.internal.repository.RepositoryManager;
 import org.apache.geode.cache.lucene.internal.repository.serializer.HeterogeneousLuceneSerializer;
-import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.InternalCache;
 
 public class LuceneRawIndex extends LuceneIndexImpl {
 
-  protected LuceneRawIndex(String indexName, String regionPath, Cache cache) {
+  protected LuceneRawIndex(String indexName, String regionPath, InternalCache cache) {
     super(indexName, regionPath, cache);
   }
 

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndexFactory.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndexFactory.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndexFactory.java
index cf445c0..d29f00a 100755
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndexFactory.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRawIndexFactory.java
@@ -14,10 +14,11 @@
  */
 package org.apache.geode.cache.lucene.internal;
 
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 
 public class LuceneRawIndexFactory extends LuceneIndexImplFactory {
-  public LuceneIndexImpl create(String indexName, String regionPath, GemFireCacheImpl cache) {
+  @Override
+  public LuceneIndexImpl create(String indexName, String regionPath, InternalCache cache) {
     return new LuceneRawIndex(indexName, regionPath, cache);
   }
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRegionListener.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRegionListener.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRegionListener.java
index 326c85c..f4e2a79 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRegionListener.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneRegionListener.java
@@ -14,23 +14,24 @@
  */
 package org.apache.geode.cache.lucene.internal;
 
+import java.util.Map;
+
+import org.apache.lucene.analysis.Analyzer;
+
 import org.apache.geode.cache.AttributesFactory;
 import org.apache.geode.cache.EvictionAlgorithm;
 import org.apache.geode.cache.EvictionAttributes;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.cache.RegionListener;
-import org.apache.lucene.analysis.Analyzer;
-
-import java.util.Map;
 
 public class LuceneRegionListener implements RegionListener {
 
   private final LuceneServiceImpl service;
 
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
 
   private final String indexName;
 
@@ -42,7 +43,7 @@ public class LuceneRegionListener implements RegionListener {
 
   private final String[] fields;
 
-  public LuceneRegionListener(LuceneServiceImpl service, GemFireCacheImpl cache, String indexName,
+  public LuceneRegionListener(LuceneServiceImpl service, InternalCache cache, String indexName,
       String regionPath, String[] fields, Analyzer analyzer, Map<String, Analyzer> fieldAnalyzers) {
     this.service = service;
     this.cache = cache;

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
index dbe24ff..30952bf 100644
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/LuceneServiceImpl.java
@@ -23,6 +23,7 @@ import org.apache.geode.cache.lucene.internal.management.LuceneServiceMBean;
 import org.apache.geode.cache.lucene.internal.management.ManagementIndexListener;
 import org.apache.geode.cache.lucene.internal.results.LuceneGetPageFunction;
 import org.apache.geode.cache.lucene.internal.results.PageResults;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.internal.beans.CacheServiceMBeanBase;
 import org.apache.logging.log4j.Logger;
 import org.apache.lucene.analysis.Analyzer;
@@ -55,7 +56,6 @@ import org.apache.geode.internal.DSFIDFactory;
 import org.apache.geode.internal.DataSerializableFixedID;
 import org.apache.geode.internal.cache.extension.Extensible;
 import org.apache.geode.internal.cache.CacheService;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.cache.RegionListener;
 import org.apache.geode.internal.cache.xmlcache.XmlGenerator;
@@ -72,14 +72,12 @@ public class LuceneServiceImpl implements InternalLuceneService {
   public static LuceneIndexImplFactory luceneIndexFactory = new LuceneIndexImplFactory();
   private static final Logger logger = LogService.getLogger();
 
-  private GemFireCacheImpl cache;
+  private InternalCache cache;
   private final HashMap<String, LuceneIndex> indexMap = new HashMap<String, LuceneIndex>();
   private final HashMap<String, LuceneIndexCreationProfile> definedIndexMap = new HashMap<>();
   private IndexListener managementListener;
 
-  public LuceneServiceImpl() {
-
-  }
+  public LuceneServiceImpl() {}
 
   @Override
   public org.apache.geode.cache.lucene.LuceneIndexFactory createIndexFactory() {
@@ -95,10 +93,9 @@ public class LuceneServiceImpl implements InternalLuceneService {
     if (cache == null) {
       throw new IllegalStateException(LocalizedStrings.CqService_CACHE_IS_NULL.toLocalizedString());
     }
-    GemFireCacheImpl gfc = (GemFireCacheImpl) cache;
-    gfc.getCancelCriterion().checkCancelInProgress(null);
+    cache.getCancelCriterion().checkCancelInProgress(null);
 
-    this.cache = gfc;
+    this.cache = (InternalCache) cache;
 
     FunctionService.registerFunction(new LuceneQueryFunction());
     FunctionService.registerFunction(new LuceneGetPageFunction());

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
index 5a86ccb..261b742 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/LuceneIndexCreationIntegrationTest.java
@@ -16,6 +16,7 @@
 package org.apache.geode.cache.lucene;
 
 import static org.apache.geode.cache.lucene.test.LuceneTestUtilities.*;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.*;
 
 import java.io.IOException;
@@ -164,7 +165,7 @@ public class LuceneIndexCreationIntegrationTest extends LuceneIntegrationTest {
       luceneService.createIndexFactory().setFields(analyzers).create(INDEX_NAME, REGION_NAME);
       Region region = createRegion();
       final LuceneIndex index = luceneService.getIndex(INDEX_NAME, REGION_NAME);
-      assertTrue(index instanceof LuceneRawIndex);
+      assertThat(index).isInstanceOf(LuceneRawIndex.class);
       region.put("key1", new TestObject());
       verifyIndexFinishFlushing(cache, INDEX_NAME, REGION_NAME);
       assertEquals(analyzers, index.getFieldAnalyzers());

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexFactorySpy.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexFactorySpy.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexFactorySpy.java
index b3db8ec..8b379a5 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexFactorySpy.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexFactorySpy.java
@@ -15,16 +15,16 @@
 package org.apache.geode.cache.lucene.internal;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.*;
+
+import java.util.function.Consumer;
 
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.lucene.internal.repository.RepositoryManager;
-import org.apache.geode.internal.cache.BucketNotFoundException;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.mockito.Mockito;
 import org.mockito.stubbing.Answer;
 
-import java.util.function.Consumer;
+import org.apache.geode.cache.lucene.internal.repository.RepositoryManager;
+import org.apache.geode.internal.cache.BucketNotFoundException;
+import org.apache.geode.internal.cache.InternalCache;
 
 public class LuceneIndexFactorySpy extends LuceneIndexImplFactory {
 
@@ -38,12 +38,11 @@ public class LuceneIndexFactorySpy extends LuceneIndexImplFactory {
     LuceneServiceImpl.luceneIndexFactory = new LuceneIndexImplFactory();
   }
 
-
   private Consumer<Object> getRepositoryConsumer = key -> {
   };
 
   @Override
-  public LuceneIndexImpl create(String indexName, String regionPath, GemFireCacheImpl cache) {
+  public LuceneIndexImpl create(String indexName, String regionPath, InternalCache cache) {
     LuceneIndexForPartitionedRegion index =
         Mockito.spy(new ExtendedLuceneIndexForPartitionedRegion(indexName, regionPath, cache));
     return index;
@@ -54,10 +53,9 @@ public class LuceneIndexFactorySpy extends LuceneIndexImplFactory {
     this.getRepositoryConsumer = getRepositoryConsumer;
   }
 
-
   private class ExtendedLuceneIndexForPartitionedRegion extends LuceneIndexForPartitionedRegion {
     public ExtendedLuceneIndexForPartitionedRegion(final String indexName, final String regionPath,
-        final Cache cache) {
+        final InternalCache cache) {
       super(indexName, regionPath, cache);
     }
 
@@ -77,4 +75,3 @@ public class LuceneIndexFactorySpy extends LuceneIndexImplFactory {
     }
   }
 }
-

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
index f2bfdd4..8e4c179 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexForPartitionedRegionTest.java
@@ -33,13 +33,13 @@ import org.apache.geode.cache.PartitionAttributesFactory;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.RegionShortcut;
-import org.apache.geode.cache.Scope;
 import org.apache.geode.cache.asyncqueue.AsyncEventQueue;
 import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueFactoryImpl;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.lucene.internal.directory.DumpDirectoryFiles;
 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.extension.ExtensionPoint;
 import org.apache.geode.test.fake.Fakes;
@@ -55,7 +55,7 @@ public class LuceneIndexForPartitionedRegionTest {
   public void getIndexNameReturnsCorrectName() {
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     LuceneIndexForPartitionedRegion index =
         new LuceneIndexForPartitionedRegion(name, regionPath, cache);
     assertEquals(name, index.getName());
@@ -65,7 +65,7 @@ public class LuceneIndexForPartitionedRegionTest {
   public void getRegionPathReturnsPath() {
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     LuceneIndexForPartitionedRegion index =
         new LuceneIndexForPartitionedRegion(name, regionPath, cache);
     assertEquals(regionPath, index.getRegionPath());
@@ -75,7 +75,7 @@ public class LuceneIndexForPartitionedRegionTest {
   public void fileRegionExistsWhenFileRegionExistsShouldReturnTrue() {
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     PartitionedRegion region = mock(PartitionedRegion.class);
     LuceneIndexForPartitionedRegion index =
         new LuceneIndexForPartitionedRegion(name, regionPath, cache);
@@ -89,7 +89,7 @@ public class LuceneIndexForPartitionedRegionTest {
   public void fileRegionExistsWhenFileRegionDoesNotExistShouldReturnFalse() {
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     LuceneIndexForPartitionedRegion index =
         new LuceneIndexForPartitionedRegion(name, regionPath, cache);
     String fileRegionName = index.createFileRegionName();
@@ -102,7 +102,7 @@ public class LuceneIndexForPartitionedRegionTest {
   public void createAEQWithPersistenceCallsCreateOnAEQFactory() {
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     final Region region = Fakes.region(regionPath, cache);
     RegionAttributes attributes = region.getAttributes();
     when(attributes.getDataPolicy()).thenReturn(DataPolicy.PERSISTENT_PARTITION);
@@ -121,7 +121,7 @@ public class LuceneIndexForPartitionedRegionTest {
   public void createAEQCallsCreateOnAEQFactory() {
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     final Region region = Fakes.region(regionPath, cache);
     AsyncEventQueueFactoryImpl aeqFactory = mock(AsyncEventQueueFactoryImpl.class);
     when(cache.createAsyncEventQueueFactory()).thenReturn(aeqFactory);
@@ -190,7 +190,7 @@ public class LuceneIndexForPartitionedRegionTest {
     boolean withPersistence = false;
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     Region region = initializeScenario(withPersistence, regionPath, cache, 0);
     LuceneIndexForPartitionedRegion index =
         new LuceneIndexForPartitionedRegion(name, regionPath, cache);
@@ -203,7 +203,7 @@ public class LuceneIndexForPartitionedRegionTest {
     boolean withPersistence = false;
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     Region region = initializeScenario(withPersistence, regionPath, cache);
 
     LuceneIndexForPartitionedRegion index =
@@ -228,7 +228,7 @@ public class LuceneIndexForPartitionedRegionTest {
     boolean withPersistence = false;
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     Region region = initializeScenario(withPersistence, regionPath, cache);
 
     LuceneIndexForPartitionedRegion index =
@@ -264,7 +264,7 @@ public class LuceneIndexForPartitionedRegionTest {
     boolean withPersistence = true;
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     initializeScenario(withPersistence, regionPath, cache);
 
     LuceneIndexForPartitionedRegion index =
@@ -284,7 +284,7 @@ public class LuceneIndexForPartitionedRegionTest {
     boolean withPersistence = true;
     String name = "indexName";
     String regionPath = "regionName";
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     initializeScenario(withPersistence, regionPath, cache);
 
     LuceneIndexForPartitionedRegion index =
@@ -306,7 +306,7 @@ public class LuceneIndexForPartitionedRegionTest {
     String name = "indexName";
     String regionPath = "regionName";
     String[] fields = new String[] {"field1", "field2"};
-    Cache cache = Fakes.cache();
+    InternalCache cache = Fakes.cache();
     initializeScenario(withPersistence, regionPath, cache);
 
     AsyncEventQueue aeq = mock(AsyncEventQueue.class);

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplJUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplJUnitTest.java
index 1042661..250b933 100755
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/LuceneIndexImplJUnitTest.java
@@ -19,18 +19,20 @@ import org.junit.Rule;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.lucene.LuceneIndex;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.test.fake.Fakes;
 import org.apache.geode.test.junit.categories.UnitTest;
 
 @Category(UnitTest.class)
 public class LuceneIndexImplJUnitTest {
+
   public static final String REGION = "region";
   public static final String INDEX = "index";
   public static final int MAX_WAIT = 30000;
-  private Cache cache;
-  LuceneIndex index;
+
+  private InternalCache cache;
+  private LuceneIndex index;
 
   @Rule
   public ExpectedException thrown = ExpectedException.none();

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
----------------------------------------------------------------------
diff --git a/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java b/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
index 71d2051..ab8b5b0 100644
--- a/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
+++ b/geode-rebalancer/src/main/java/org/apache/geode/cache/util/AutoBalancer.java
@@ -40,6 +40,7 @@ import org.apache.geode.cache.partition.PartitionMemberInfo;
 import org.apache.geode.distributed.DistributedLockService;
 import org.apache.geode.distributed.internal.locks.DLockService;
 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.InternalPRInfo;
 import org.apache.geode.internal.cache.partitioned.LoadProbe;
@@ -65,7 +66,6 @@ import org.apache.geode.internal.logging.LogService;
  * <OL>
  * <LI>{@link AutoBalancer#SCHEDULE}
  * <LI>TBD THRESHOLDS
- * 
  */
 @Experimental("The autobalancer may be removed or the API may change in future releases")
 public class AutoBalancer implements Declarable {
@@ -344,19 +344,19 @@ public class AutoBalancer implements Declarable {
   static class GeodeCacheFacade implements CacheOperationFacade {
     private final AtomicBoolean isLockAcquired = new AtomicBoolean(false);
 
-    private GemFireCacheImpl cache;
+    private InternalCache cache;
 
     public GeodeCacheFacade() {
       this(null);
     }
 
-    public GeodeCacheFacade(GemFireCacheImpl cache) {
+    public GeodeCacheFacade(InternalCache cache) {
       this.cache = cache;
     }
 
     @Override
     public Map<PartitionedRegion, InternalPRInfo> getRegionMemberDetails() {
-      GemFireCacheImpl cache = getCache();
+      InternalCache cache = getCache();
       Map<PartitionedRegion, InternalPRInfo> detailsMap = new HashMap<>();
       for (PartitionedRegion region : cache.getPartitionedRegions()) {
         LoadProbe probe = cache.getInternalResourceManager().getLoadProbe();
@@ -411,7 +411,7 @@ public class AutoBalancer implements Declarable {
 
     @Override
     public void incrementAttemptCounter() {
-      GemFireCacheImpl cache = getCache();
+      InternalCache cache = getCache();
       try {
         cache.getInternalResourceManager().getStats().incAutoRebalanceAttempts();
       } catch (Exception e) {
@@ -442,7 +442,7 @@ public class AutoBalancer implements Declarable {
       }
     }
 
-    GemFireCacheImpl getCache() {
+    InternalCache getCache() {
       if (cache == null) {
         synchronized (this) {
           if (cache == null) {
@@ -486,15 +486,15 @@ public class AutoBalancer implements Declarable {
 
     @Override
     public DistributedLockService getDLS() {
-      GemFireCacheImpl cache = getCache();
+      InternalCache cache = getCache();
       DistributedLockService dls =
           DistributedLockService.getServiceNamed(AUTO_BALANCER_LOCK_SERVICE_NAME);
       if (dls == null) {
         if (logger.isDebugEnabled()) {
           logger.debug("Creating DistributeLockService");
         }
-        dls = DLockService.create(AUTO_BALANCER_LOCK_SERVICE_NAME, cache.getDistributedSystem(),
-            true, true, true);
+        dls = DLockService.create(AUTO_BALANCER_LOCK_SERVICE_NAME,
+            cache.getInternalDistributedSystem(), true, true, true);
       }
 
       return dls;

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WANFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WANFactoryImpl.java b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WANFactoryImpl.java
index a98510d..43d3871 100644
--- a/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WANFactoryImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/cache/client/internal/locator/wan/WANFactoryImpl.java
@@ -14,12 +14,12 @@
  */
 package org.apache.geode.cache.client.internal.locator.wan;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.wan.GatewayReceiverFactory;
 import org.apache.geode.cache.wan.GatewaySenderFactory;
 import org.apache.geode.distributed.internal.WanLocatorDiscoverer;
 import org.apache.geode.internal.DSFIDFactory;
 import org.apache.geode.internal.DataSerializableFixedID;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.wan.GatewayReceiverFactoryImpl;
 import org.apache.geode.internal.cache.wan.GatewaySenderFactoryImpl;
 import org.apache.geode.internal.cache.wan.spi.WANFactory;
@@ -45,12 +45,12 @@ public class WANFactoryImpl implements WANFactory {
   }
 
   @Override
-  public GatewaySenderFactory createGatewaySenderFactory(Cache cache) {
+  public GatewaySenderFactory createGatewaySenderFactory(InternalCache cache) {
     return new GatewaySenderFactoryImpl(cache);
   }
 
   @Override
-  public GatewayReceiverFactory createGatewayReceiverFactory(Cache cache) {
+  public GatewayReceiverFactory createGatewayReceiverFactory(InternalCache cache) {
     return new GatewayReceiverFactoryImpl(cache);
   }
 
@@ -63,6 +63,4 @@ public class WANFactoryImpl implements WANFactory {
   public LocatorMembershipListener createLocatorMembershipListener() {
     return new LocatorMembershipListenerImpl();
   }
-
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
index 68eb56c..dbc2cc6 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/AbstractRemoteGatewaySender.java
@@ -14,7 +14,13 @@
  */
 package org.apache.geode.internal.cache.wan;
 
-import org.apache.geode.cache.Cache;
+import java.io.IOException;
+import java.net.ConnectException;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.cache.client.PoolManager;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.client.internal.locator.wan.RemoteLocatorRequest;
@@ -23,32 +29,22 @@ import org.apache.geode.cache.wan.GatewayReceiver;
 import org.apache.geode.distributed.internal.WanLocatorDiscoverer;
 import org.apache.geode.distributed.internal.tcpserver.TcpClient;
 import org.apache.geode.internal.admin.remote.DistributionLocatorId;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PoolFactoryImpl;
 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.io.IOException;
-import java.net.ConnectException;
-import java.util.Iterator;
-import java.util.StringTokenizer;
 
 public abstract class AbstractRemoteGatewaySender extends AbstractGatewaySender {
   private static final Logger logger = LogService.getLogger();
 
-  public AbstractRemoteGatewaySender() {
-
-  }
+  /** used to reduce warning logs in case remote locator is down (#47634) */
+  protected int proxyFailureTries = 0;
 
-  public AbstractRemoteGatewaySender(Cache cache, GatewaySenderAttributes attrs) {
+  public AbstractRemoteGatewaySender(InternalCache cache, GatewaySenderAttributes attrs) {
     super(cache, attrs);
   }
 
-  /** used to reduce warning logs in case remote locator is down (#47634) */
-  protected int proxyFailureTries = 0;
-
   public synchronized void initProxy() {
     // return if it is being used for WBCL or proxy is already created
     if (this.remoteDSId == DEFAULT_DISTRIBUTED_SYSTEM_ID
@@ -68,8 +64,7 @@ public abstract class AbstractRemoteGatewaySender extends AbstractGatewaySender
     pf.setServerGroup(GatewayReceiver.RECEIVER_GROUP);
     RemoteLocatorRequest request =
         new RemoteLocatorRequest(this.remoteDSId, pf.getPoolAttributes().getServerGroup());
-    String locators =
-        ((GemFireCacheImpl) this.cache).getDistributedSystem().getConfig().getLocators();
+    String locators = this.cache.getInternalDistributedSystem().getConfig().getLocators();
     if (logger.isDebugEnabled()) {
       logger
           .debug("Gateway Sender is attempting to configure pool with remote locator information");
@@ -96,7 +91,6 @@ public abstract class AbstractRemoteGatewaySender extends AbstractGatewaySender
             logger.debug("Received the remote site {} location information:", this.remoteDSId,
                 response.getLocators());
           }
-          StringBuffer strBuffer = new StringBuffer();
           Iterator<String> itr = response.getLocators().iterator();
           while (itr.hasNext()) {
             String remoteLocator = itr.next();

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
index 8544636..d953d7f 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewayReceiverImpl.java
@@ -185,7 +185,7 @@ public class GatewayReceiverImpl implements GatewayReceiver {
     logger
         .info(LocalizedMessage.create(LocalizedStrings.GatewayReceiver_STARTED_ON_PORT, this.port));
 
-    InternalDistributedSystem system = this.cache.getDistributedSystem();
+    InternalDistributedSystem system = this.cache.getInternalDistributedSystem();
     system.handleResourceEvent(ResourceEvent.GATEWAYRECEIVER_START, this);
 
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
index 7398d29..2c7925b 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/GatewaySenderFactoryImpl.java
@@ -29,6 +29,7 @@ import org.apache.geode.cache.wan.GatewaySenderFactory;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.wan.parallel.ParallelGatewaySenderImpl;
 import org.apache.geode.internal.cache.wan.serial.SerialGatewaySenderImpl;
 import org.apache.geode.internal.cache.xmlcache.CacheCreation;
@@ -39,9 +40,7 @@ import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
 
 /**
- * 
  * @since GemFire 7.0
- * 
  */
 public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
 
@@ -53,12 +52,12 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
    */
   private GatewaySenderAttributes attrs = new GatewaySenderAttributes();
 
-  private Cache cache;
+  private InternalCache cache;
 
   private static final AtomicBoolean GATEWAY_CONNECTION_READ_TIMEOUT_PROPERTY_CHECKED =
       new AtomicBoolean(false);
 
-  public GatewaySenderFactoryImpl(Cache cache) {
+  public GatewaySenderFactoryImpl(InternalCache cache) {
     this.cache = cache;
   }
 
@@ -250,13 +249,6 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
             LocalizedStrings.SerialGatewaySenderImpl_GATEWAY_0_CANNOT_DEFINE_A_REMOTE_SITE_BECAUSE_AT_LEAST_ONE_LISTENER_IS_ALREADY_ADDED
                 .toLocalizedString(id));
       }
-      // if (this.attrs.getOrderPolicy() != null) {
-      // if (this.attrs.getDispatcherThreads() == GatewaySender.DEFAULT_DISPATCHER_THREADS) {
-      // throw new GatewaySenderException(
-      // LocalizedStrings.SerialGatewaySender_INVALID_GATEWAY_SENDER_ORDER_POLICY_CONCURRENCY_0
-      // .toLocalizedString(id));
-      // }
-      // }
       if (this.attrs.getOrderPolicy() == null && this.attrs.getDispatcherThreads() > 1) {
         this.attrs.policy = GatewaySender.DEFAULT_ORDER_POLICY;
       }
@@ -304,13 +296,6 @@ public class GatewaySenderFactoryImpl implements InternalGatewaySenderFactory {
         ((CacheCreation) this.cache).addGatewaySender(sender);
       }
     } else {
-      // if (this.attrs.getOrderPolicy() != null) {
-      // if (this.attrs.getDispatcherThreads() == GatewaySender.DEFAULT_DISPATCHER_THREADS) {
-      // throw new AsyncEventQueueConfigurationException(
-      // LocalizedStrings.AsyncEventQueue_INVALID_ORDER_POLICY_CONCURRENCY_0
-      // .toLocalizedString(id));
-      // }
-      // }
       if (this.attrs.getOrderPolicy() == null && this.attrs.getDispatcherThreads() > 1) {
         this.attrs.policy = GatewaySender.DEFAULT_ORDER_POLICY;
       }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
index 518966a..c2d4673 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderImpl.java
@@ -16,53 +16,36 @@ package org.apache.geode.internal.cache.wan.parallel;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.EntryOperation;
 import org.apache.geode.cache.asyncqueue.AsyncEventListener;
-import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueImpl;
-import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueStats;
-import org.apache.geode.cache.wan.GatewaySender;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
-import org.apache.geode.distributed.internal.DistributionAdvisor;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.ResourceEvent;
 import org.apache.geode.internal.cache.DistributedRegion;
 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.PartitionedRegionHelper;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
 import org.apache.geode.internal.cache.ha.ThreadIdentifier;
-import org.apache.geode.internal.cache.wan.AbstractRemoteGatewaySender;
 import org.apache.geode.internal.cache.wan.AbstractGatewaySenderEventProcessor;
-import org.apache.geode.internal.cache.wan.GatewaySenderAdvisor;
-import org.apache.geode.internal.cache.wan.GatewaySenderStats;
+import org.apache.geode.internal.cache.wan.AbstractRemoteGatewaySender;
 import org.apache.geode.internal.cache.wan.GatewaySenderAdvisor.GatewaySenderProfile;
 import org.apache.geode.internal.cache.wan.GatewaySenderAttributes;
-import org.apache.geode.internal.cache.xmlcache.CacheCreation;
 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;
 
 /**
  * @since GemFire 7.0
- *
  */
 public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
   private static final Logger logger = LogService.getLogger();
 
-  final ThreadGroup loggerGroup =
-      LoggingThreadGroup.createThreadGroup("Remote Site Discovery Logger Group", logger);
-
-  public ParallelGatewaySenderImpl() {
-    super();
-    this.isParallel = true;
-  }
-
-  public ParallelGatewaySenderImpl(Cache cache, GatewaySenderAttributes attrs) {
+  public ParallelGatewaySenderImpl(InternalCache cache, GatewaySenderAttributes attrs) {
     super(cache, attrs);
   }
 
@@ -77,8 +60,7 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
       }
 
       if (this.remoteDSId != DEFAULT_DISTRIBUTED_SYSTEM_ID) {
-        String locators =
-            ((GemFireCacheImpl) this.cache).getDistributedSystem().getConfig().getLocators();
+        String locators = this.cache.getInternalDistributedSystem().getConfig().getLocators();
         if (locators.length() == 0) {
           throw new IllegalStateException(
               LocalizedStrings.AbstractGatewaySender_LOCATOR_SHOULD_BE_CONFIGURED_BEFORE_STARTING_GATEWAY_SENDER
@@ -92,22 +74,16 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
        * of Concurrent version of processor and queue.
        */
       eventProcessor = new RemoteConcurrentParallelGatewaySenderEventProcessor(this);
-      /*
-       * if (getDispatcherThreads() > 1) { eventProcessor = new
-       * ConcurrentParallelGatewaySenderEventProcessor(this); } else { eventProcessor = new
-       * ParallelGatewaySenderEventProcessor(this); }
-       */
-
       eventProcessor.start();
       waitForRunningStatus();
+
       // Only notify the type registry if this is a WAN gateway queue
       if (!isAsyncEventQueue()) {
         ((GemFireCacheImpl) getCache()).getPdxRegistry().gatewaySenderStarted(this);
       }
       new UpdateAttributesProcessor(this).distribute(false);
 
-      InternalDistributedSystem system =
-          (InternalDistributedSystem) this.cache.getDistributedSystem();
+      InternalDistributedSystem system = this.cache.getInternalDistributedSystem();
       system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_START, this);
 
       logger.info(
@@ -119,15 +95,6 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
     }
   }
 
-  // /**
-  // * The sender is not started but only the message queue i.e. shadowPR is created on the node.
-  // * @param targetPr
-  // */
-  // private void createMessageQueueOnAccessorNode(PartitionedRegion targetPr) {
-  // eventProcessor = new ParallelGatewaySenderEventProcessor(this, targetPr);
-  // }
-
-
   @Override
   public void stop() {
     this.getLifeCycleLock().writeLock().lock();
@@ -137,7 +104,6 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
       }
       // Stop the dispatcher
       AbstractGatewaySenderEventProcessor ev = this.eventProcessor;
-      // try {
       if (ev != null && !ev.isStopped()) {
         ev.stopProcessing();
       }
@@ -162,9 +128,6 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
       clearTempEventsAfterSenderStopped();
       // Keep the eventProcessor around so we can ask it for the regionQueues later.
       // Tests expect to be able to do this.
-      // } finally {
-      // this.eventProcessor = null;
-      // }
     } finally {
       this.getLifeCycleLock().writeLock().unlock();
     }
@@ -207,24 +170,11 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
     pf.isDiskSynchronous = isDiskSynchronous();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see
-   * org.apache.geode.internal.cache.wan.AbstractGatewaySender#setModifiedEventId(org.apache.geode.
-   * internal.cache.EntryEventImpl)
-   */
   @Override
   protected void setModifiedEventId(EntryEventImpl clonedEvent) {
     int bucketId = -1;
     // merged from 42004
     if (clonedEvent.getRegion() instanceof DistributedRegion) {
-      // if (getOrderPolicy() == OrderPolicy.THREAD) {
-      // bucketId = PartitionedRegionHelper.getHashKey(
-      // ((EntryEventImpl)clonedEvent).getEventId().getThreadID(),
-      // getMaxParallelismForReplicatedRegion());
-      // }
-      // else
       bucketId = PartitionedRegionHelper.getHashKey(clonedEvent.getKey(),
           getMaxParallelismForReplicatedRegion());
     } else {
@@ -240,18 +190,6 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
     // we don't need to generate different threadId for secondary buckets
     // as they will be rejected if seen at PR level itself
 
-    // boolean isPrimary = ((PartitionedRegion)getQueue().getRegion())
-    // .getRegionAdvisor().getBucketAdvisor(bucketId).isPrimary();
-    // if (isPrimary) {
-    // newThreadId = ThreadIdentifier
-    // .createFakeThreadIDForParallelGSPrimaryBucket(bucketId,
-    // originatingThreadId);
-    // } else {
-    // newThreadId = ThreadIdentifier
-    // .createFakeThreadIDForParallelGSSecondaryBucket(bucketId,
-    // originatingThreadId);
-    // }
-
     EventID newEventId = new EventID(originalEventId.getMembershipID(), newThreadId,
         originalEventId.getSequenceID(), bucketId);
     if (logger.isDebugEnabled()) {
@@ -262,5 +200,4 @@ public class ParallelGatewaySenderImpl extends AbstractRemoteGatewaySender {
     }
     clonedEvent.setEventId(newEventId);
   }
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
index 3aa18ce..b300460 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderImpl.java
@@ -18,7 +18,6 @@ import java.util.Set;
 
 import org.apache.logging.log4j.Logger;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.asyncqueue.AsyncEventListener;
 import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.DistributedLockService;
@@ -28,6 +27,7 @@ import org.apache.geode.distributed.internal.ResourceEvent;
 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.RegionQueue;
 import org.apache.geode.internal.cache.UpdateAttributesProcessor;
 import org.apache.geode.internal.cache.ha.ThreadIdentifier;
@@ -38,26 +38,16 @@ import org.apache.geode.internal.cache.wan.GatewaySenderAttributes;
 import org.apache.geode.internal.cache.wan.GatewaySenderConfigurationException;
 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;
 
 /**
  * @since GemFire 7.0
- *
  */
 public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
 
   private static final Logger logger = LogService.getLogger();
 
-  final ThreadGroup loggerGroup =
-      LoggingThreadGroup.createThreadGroup("Remote Site Discovery Logger Group", logger);
-
-  public SerialGatewaySenderImpl() {
-    super();
-    this.isParallel = false;
-  }
-
-  public SerialGatewaySenderImpl(Cache cache, GatewaySenderAttributes attrs) {
+  public SerialGatewaySenderImpl(InternalCache cache, GatewaySenderAttributes attrs) {
     super(cache, attrs);
   }
 
@@ -75,8 +65,7 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
         return;
       }
       if (this.remoteDSId != DEFAULT_DISTRIBUTED_SYSTEM_ID) {
-        String locators =
-            ((GemFireCacheImpl) this.cache).getDistributedSystem().getConfig().getLocators();
+        String locators = this.cache.getInternalDistributedSystem().getConfig().getLocators();
         if (locators.length() == 0) {
           throw new GatewaySenderConfigurationException(
               LocalizedStrings.AbstractGatewaySender_LOCATOR_SHOULD_BE_CONFIGURED_BEFORE_STARTING_GATEWAY_SENDER
@@ -108,9 +97,7 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
       }
       new UpdateAttributesProcessor(this).distribute(false);
 
-
-      InternalDistributedSystem system =
-          (InternalDistributedSystem) this.cache.getDistributedSystem();
+      InternalDistributedSystem system = this.cache.getInternalDistributedSystem();
       system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_START, this);
 
       logger
@@ -230,13 +217,6 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
     pf.serverLocation = this.getServerLocation();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see
-   * org.apache.geode.internal.cache.wan.AbstractGatewaySender#setModifiedEventId(org.apache.geode.
-   * internal.cache.EntryEventImpl)
-   */
   @Override
   protected void setModifiedEventId(EntryEventImpl clonedEvent) {
     EventID originalEventId = clonedEvent.getEventId();
@@ -257,5 +237,4 @@ public class SerialGatewaySenderImpl extends AbstractRemoteGatewaySender {
     }
     clonedEvent.setEventId(newEventId);
   }
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/76c49838/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
----------------------------------------------------------------------
diff --git a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
index 8aa887b..34f0a8b 100644
--- a/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
+++ b/geode-wan/src/test/java/org/apache/geode/management/internal/configuration/ClusterConfigurationDUnitTest.java
@@ -493,7 +493,7 @@ public class ClusterConfigurationDUnitTest extends CliCommandTestBase {
     VM locatorAndMgr = getHost(0).getVM(3);
     locatorAndMgr.invoke(() -> {
       GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
-      ShutdownAllRequest.send(cache.getDistributedSystem().getDistributionManager(), -1);
+      ShutdownAllRequest.send(cache.getInternalDistributedSystem().getDistributionManager(), -1);
       return null;
     });
 


Mime
View raw message