geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [5/7] geode git commit: Change GemFireCacheImpl to InternalCache
Date Fri, 05 May 2017 17:32:32 GMT
http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
index 82e6f68..f09bb47 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelGatewaySenderQueue.java
@@ -56,7 +56,6 @@ import org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueImpl;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.distributed.internal.membership.InternalDistributedMember;
-import org.apache.geode.internal.Version;
 import org.apache.geode.internal.cache.AbstractBucketRegionQueue;
 import org.apache.geode.internal.cache.BucketNotFoundException;
 import org.apache.geode.internal.cache.BucketRegion;
@@ -67,7 +66,7 @@ import org.apache.geode.internal.cache.DiskRegionStats;
 import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EntryEventImpl;
 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.InternalRegionArguments;
 import org.apache.geode.internal.cache.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
@@ -81,7 +80,6 @@ import org.apache.geode.internal.cache.wan.GatewaySenderConfigurationException;
 import org.apache.geode.internal.cache.wan.GatewaySenderEventImpl;
 import org.apache.geode.internal.cache.wan.GatewaySenderException;
 import org.apache.geode.internal.cache.wan.GatewaySenderStats;
-import org.apache.geode.internal.cache.wan.parallel.ParallelQueueBatchRemovalMessage.ParallelQueueBatchRemovalResponse;
 import org.apache.geode.internal.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.LoggingThreadGroup;
@@ -119,8 +117,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
 
   protected volatile boolean resetLastPeeked = false;
 
-
-
   /**
    * There will be one shadow pr for each of the the PartitionedRegion which has added the
    * GatewaySender Fix for Bug#45917 We maintain a tempQueue to queue events when buckets are not
@@ -134,8 +130,10 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
    * the secondary nodes to remove the events which have already been dispatched from the queue.
    */
   public static final int DEFAULT_MESSAGE_SYNC_INTERVAL = 10;
+
   // TODO:REF: how to change the message sync interval ? should it be common for serial and parallel
   protected static volatile int messageSyncInterval = DEFAULT_MESSAGE_SYNC_INTERVAL;
+
   // TODO:REF: name change for thread, as it appears in the log
   private BatchRemovalThread removalThread = null;
 
@@ -223,16 +221,11 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   }
 
   final protected int index;
+
   final protected int nDispatcher;
 
   private MetaRegionFactory metaRegionFactory;
 
-  /**
-   * A transient queue to maintain the eventSeqNum of the events that are to be sent to remote site.
-   * It is cleared when the queue is cleared.
-   */
-  // private final BlockingQueue<Long> eventSeqNumQueue;
-
   public ParallelGatewaySenderQueue(AbstractGatewaySender sender, Set<Region> userRegions, int idx,
       int nDispatcher) {
     this(sender, userRegions, idx, nDispatcher, new MetaRegionFactory());
@@ -249,7 +242,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     this.sender = sender;
 
     List<Region> listOfRegions = new ArrayList<Region>(userRegions);
-    // eventSeqNumQueue = new LinkedBlockingQueue<Long>();
     Collections.sort(listOfRegions, new Comparator<Region>() {
       @Override
       public int compare(Region o1, Region o2) {
@@ -273,7 +265,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
         throw new GatewaySenderConfigurationException(
             LocalizedStrings.ParallelGatewaySender_0_CAN_NOT_BE_USED_WITH_REPLICATED_REGION_1
                 .toLocalizedString(new Object[] {this.sender.getId(), userRegion.getFullPath()}));
-        // addShadowPartitionedRegionForUserRR((DistributedRegion)userRegion);
       }
     }
 
@@ -295,7 +286,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     // still, it is safer approach to synchronize it
     synchronized (ParallelGatewaySenderQueue.class) {
       if (removalThread == null) {
-        removalThread = new BatchRemovalThread((GemFireCacheImpl) this.sender.getCache(), this);
+        removalThread = new BatchRemovalThread(this.sender.getCache(), this);
         removalThread.start();
       }
     }
@@ -317,7 +308,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
       if (this.userRegionNameToshadowPRMap.containsKey(regionName))
         return;
 
-      GemFireCacheImpl cache = (GemFireCacheImpl) sender.getCache();
+      InternalCache cache = sender.getCache();
       final String prQName = getQueueName(sender.getId(), userRegion.getFullPath());
       prQ = (PartitionedRegion) cache.getRegion(prQName);
       if (prQ == null) {
@@ -375,8 +366,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
                 prQ.getPartitionAttributes());
           }
 
-          // Suranjan: TODO This should not be set on the PR but on the
-          // GatewaySender
+          // TODO This should not be set on the PR but on the GatewaySender
           prQ.enableConflation(sender.isBatchConflationEnabled());
 
           // Before going ahead, make sure all the buckets of shadowPR are
@@ -391,32 +381,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
           }
           // In case of Replicated Region it may not be necessary.
 
-          // if (sender.isPersistenceEnabled()) {
-          // //Kishor: I need to write a test for this code.
-          // Set<Integer> allBucketsClone = new HashSet<Integer>();
-          // // allBucketsClone.addAll(allBuckets);*/
-          // for (int i = 0; i < sender.getMaxParallelismForReplicatedRegion(); i++)
-          // allBucketsClone.add(i);
-          //
-          // while (!(allBucketsClone.size() == 0)) {
-          // Iterator<Integer> itr = allBucketsClone.iterator();
-          // while (itr.hasNext()) {
-          // InternalDistributedMember node = prQ.getNodeForBucketWrite(
-          // itr.next(), null);
-          // if (node != null) {
-          // itr.remove();
-          // }
-          // }
-          // // after the iteration is over, sleep for sometime before trying
-          // // again
-          // try {
-          // Thread.sleep(WAIT_CYCLE_SHADOW_BUCKET_LOAD);
-          // }
-          // catch (InterruptedException e) {
-          // logger.error(e);
-          // }
-          // }
-          // }
         } catch (IOException veryUnLikely) {
           logger.fatal(LocalizedMessage.create(
               LocalizedStrings.SingleWriteSingleReadRegionQueue_UNEXPECTED_EXCEPTION_DURING_INIT_OF_0,
@@ -453,7 +417,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   }
 
   private static String convertPathToName(String fullPath) {
-    // return fullPath.replaceAll("/", "_");
     return "";
   }
 
@@ -490,7 +453,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
                 .toLocalizedString(new Object[] {this.sender.getId(), userPR.getFullPath()}));
       }
 
-      GemFireCacheImpl cache = (GemFireCacheImpl) sender.getCache();
+      InternalCache cache = sender.getCache();
       boolean isAccessor = (userPR.getLocalMaxMemory() == 0);
 
       final String prQName = sender.getId() + QSTRING + convertPathToName(userPR.getFullPath());
@@ -549,7 +512,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
                   .setInternalRegion(true).setSnapshotInputStream(null).setImageTarget(null));
           // at this point we should be able to assert prQ == meta;
 
-          // Suranjan: TODO This should not be set on the PR but on the GatewaySender
+          // TODO This should not be set on the PR but on the GatewaySender
           prQ.enableConflation(sender.isBatchConflationEnabled());
           if (isAccessor)
             return; // return from here if accessor node
@@ -576,7 +539,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
 
     } finally {
       if (prQ != null) {
-
         this.userRegionNameToshadowPRMap.put(userPR.getFullPath(), prQ);
       }
       /*
@@ -611,7 +573,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   }
 
   protected void afterRegionAdd(PartitionedRegion userPR) {
-
+    // nothing
   }
 
   /**
@@ -666,18 +628,12 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   public boolean put(Object object) throws InterruptedException, CacheException {
     final boolean isDebugEnabled = logger.isDebugEnabled();
     boolean putDone = false;
-    // Suranjan : Can this region ever be null? Should we work with regionName and not with region
+    // Can this region ever be null? Should we work with regionName and not with region
     // instance.
     // It can't be as put is happeing on the region and its still under process
     GatewaySenderEventImpl value = (GatewaySenderEventImpl) object;
     boolean isDREvent = isDREvent(value);
 
-    // if (isDREvent(value)) {
-    // putInShadowPRForReplicatedRegion(object);
-    // value.freeOffHeapValue();
-    // return;
-    // }
-
     Region region = value.getRegion();
     String regionPath = null;
     if (isDREvent) {
@@ -795,11 +751,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
                     brq.getInitializationLock().readLock().unlock();
                   }
                 } else {
-                  // tempQueue = this.bucketToTempQueueMap.get(bucketId);
-                  // if (tempQueue == null) {
-                  // tempQueue = new LinkedBlockingQueue();
-                  // this.bucketToTempQueueMap.put(bucketId, tempQueue);
-                  // }
                   tempQueue.add(value);
                   putDone = true;
                   // For debugging purpose.
@@ -811,7 +762,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
                 }
               }
             }
-            // }
           }
 
         } finally {
@@ -873,12 +823,9 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     try {
       if (brq != null) {
         addedValueToQueue = brq.addToQueue(key, value);
-        // TODO : Kishor : During merge, ParallelWANstats test failed. On
+        // TODO: During merge, ParallelWANstats test failed. On
         // comment below code test passed. cheetha does not have below code.
         // need to find out from hcih revision this code came
-        // if (brq.getBucketAdvisor().isPrimary()) {
-        // this.stats.incQueueSize();
-        // }
       }
     } catch (BucketNotFoundException e) {
       if (logger.isDebugEnabled()) {
@@ -933,18 +880,13 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     return new HashSet(this.userRegionNameToshadowPRMap.values());
   }
 
-  // TODO: Suranjan Find optimal way to get Random shadow pr as this will be called in each put and
-  // peek.
+  // TODO: Find optimal way to get Random shadow pr as this will be called in each put and peek.
   protected PartitionedRegion getRandomShadowPR() {
     PartitionedRegion prQ = null;
     if (this.userRegionNameToshadowPRMap.values().size() > 0) {
       int randomIndex = new Random().nextInt(this.userRegionNameToshadowPRMap.size());
       prQ = (PartitionedRegion) this.userRegionNameToshadowPRMap.values().toArray()[randomIndex];
     }
-    // if (this.userPRToshadowPRMap.values().size() > 0
-    // && (prQ == null)) {
-    // prQ = getRandomShadowPR();
-    // }
     return prQ;
   }
 
@@ -1029,13 +971,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
 
       // TODO:REF: instead of shuffle use random number, in this method we are
       // returning id instead we should return BRQ itself
-      /*
-       * Collections.shuffle(thisProcessorBuckets); for (Integer bucketId : thisProcessorBuckets) {
-       * BucketRegionQueue br = (BucketRegionQueue)prQ.getDataStore()
-       * .getBucketRegionQueueByBucketId(bucketId);
-       *
-       * if (br != null && br.isReadyForPeek()) { return br.getId(); } }
-       */
     }
     return -1;
   }
@@ -1052,9 +987,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
 
       GatewaySenderEventImpl event = this.peekedEvents.remove();
       try {
-        // PartitionedRegion prQ = this.userPRToshadowPRMap.get(ColocationHelper
-        // .getLeaderRegion((PartitionedRegion)event.getRegion()).getFullPath());
-        //
         PartitionedRegion prQ = null;
         int bucketId = -1;
         Object key = null;
@@ -1071,11 +1003,10 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
           }
         } else {
           String regionPath = event.getRegionPath();
-          GemFireCacheImpl cache = (GemFireCacheImpl) this.sender.getCache();
+          InternalCache cache = this.sender.getCache();
           Region region = (PartitionedRegion) cache.getRegion(regionPath);
           if (region != null && !region.isDestroyed()) {
-            // TODO: Suranjan We have to get colocated parent region for this
-            // region
+            // TODO: We have to get colocated parent region for this region
             if (region instanceof DistributedRegion) {
               prQ = this.userRegionNameToshadowPRMap.get(region.getFullPath());
               event.getBucketId();
@@ -1105,7 +1036,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   private void destroyEventFromQueue(PartitionedRegion prQ, int bucketId, Object key) {
     boolean isPrimary = prQ.getRegionAdvisor().getBucketAdvisor(bucketId).isPrimary();
     BucketRegionQueue brq = getBucketRegionQueueByBucketId(prQ, bucketId);
-    // TODO : Kishor : Make sure we dont need to initalize a bucket
+    // TODO : Make sure we dont need to initalize a bucket
     // before destroying a key from it
     try {
       if (brq != null) {
@@ -1261,7 +1192,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
       }
-      blockProcesorThreadIfRequired();
+      blockProcessorThreadIfRequired();
       return batch;
     }
 
@@ -1340,7 +1271,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
           this, batch.size(), size(), localSize());
     }
     if (batch.size() == 0) {
-      blockProcesorThreadIfRequired();
+      blockProcessorThreadIfRequired();
     }
     return batch;
   }
@@ -1400,10 +1331,9 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     }
   }
 
-  protected void blockProcesorThreadIfRequired() throws InterruptedException {
+  protected void blockProcessorThreadIfRequired() throws InterruptedException {
     queueEmptyLock.lock();
     try {
-      // while (isQueueEmpty) {
       if (isQueueEmpty) { // merge44610: this if condition came from cheetah 44610
         if (logger.isDebugEnabled()) {
           logger.debug("Going to wait, till notified.");
@@ -1414,7 +1344,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
         // parameter but cedar does not have such corresponding method
         queueEmptyCondition.await(1000);
         // merge44610: this time waiting came from cheetah 44610
-        // isQueueEmpty = this.localSize() == 0;
       }
       // update the flag so that next time when we come we will block.
       isQueueEmpty = this.localSizeForProcessor() == 0;
@@ -1526,7 +1455,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     throw new UnsupportedOperationException();
   }
 
-
   @Override
   public void remove(int batchSize) throws CacheException {
     for (int i = 0; i < batchSize; i++) {
@@ -1596,14 +1524,6 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   @Override
   public void close() {
     // Because of bug 49060 do not close the regions of a parallel queue
-    // for (Region r: getRegions()) {
-    // if (r != null && !r.isDestroyed()) {
-    // try {
-    // r.close();
-    // } catch (RegionDestroyedException e) {
-    // }
-    // }
-    // }
   }
 
   /**
@@ -1634,14 +1554,14 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
      */
     private volatile boolean shutdown = false;
 
-    private final GemFireCacheImpl cache;
+    private final InternalCache cache;
 
     private final ParallelGatewaySenderQueue parallelQueue;
 
     /**
      * Constructor : Creates and initializes the thread
      */
-    public BatchRemovalThread(GemFireCacheImpl c, ParallelGatewaySenderQueue queue) {
+    public BatchRemovalThread(InternalCache c, ParallelGatewaySenderQueue queue) {
       super("BatchRemovalThread");
       // TODO:REF: Name for this thread ?
       this.setDaemon(true);
@@ -1772,7 +1692,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
       }
     }
 
-    private Set<InternalDistributedMember> getAllRecipients(GemFireCacheImpl cache, Map map) {
+    private Set<InternalDistributedMember> getAllRecipients(InternalCache cache, Map map) {
       Set recipients = new ObjectOpenHashSet();
       for (Object pr : map.keySet()) {
         PartitionedRegion partitionedRegion = (PartitionedRegion) cache.getRegion((String) pr);
@@ -1811,7 +1731,7 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
     AbstractGatewaySender sender = null;
 
     public ParallelGatewaySenderQueueMetaRegion(String regionName, RegionAttributes attrs,
-        LocalRegion parentRegion, GemFireCacheImpl cache, AbstractGatewaySender pgSender) {
+        LocalRegion parentRegion, InternalCache cache, AbstractGatewaySender pgSender) {
       super(regionName, attrs, parentRegion, cache,
           new InternalRegionArguments().setDestroyLockFlag(true).setRecreateFlag(false)
               .setSnapshotInputStream(null).setImageTarget(null)
@@ -1872,8 +1792,8 @@ public class ParallelGatewaySenderQueue implements RegionQueue {
   }
 
   static class MetaRegionFactory {
-    ParallelGatewaySenderQueueMetaRegion newMetataRegion(GemFireCacheImpl cache,
-        final String prQName, final RegionAttributes ra, AbstractGatewaySender sender) {
+    ParallelGatewaySenderQueueMetaRegion newMetataRegion(InternalCache cache, final String prQName,
+        final RegionAttributes ra, AbstractGatewaySender sender) {
       ParallelGatewaySenderQueueMetaRegion meta =
           new ParallelGatewaySenderQueueMetaRegion(prQName, ra, null, cache, sender);
       return meta;

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessage.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessage.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessage.java
index 921af9c..a7eb9e3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessage.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/parallel/ParallelQueueRemovalMessage.java
@@ -38,6 +38,7 @@ import org.apache.geode.distributed.internal.PooledDistributionMessage;
 import org.apache.geode.internal.cache.AbstractBucketRegionQueue;
 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.LocalRegion;
 import org.apache.geode.internal.cache.PartitionedRegion;
 import org.apache.geode.internal.cache.PartitionedRegionHelper;
@@ -52,7 +53,6 @@ import org.apache.geode.internal.logging.log4j.LocalizedMessage;
  * 
  * @since GemFire 8.0
  */
-
 public class ParallelQueueRemovalMessage extends PooledDistributionMessage {
 
   private static final Logger logger = LogService.getLogger();
@@ -73,7 +73,7 @@ public class ParallelQueueRemovalMessage extends PooledDistributionMessage {
   @Override
   protected void process(DistributionManager dm) {
     final boolean isDebugEnabled = logger.isDebugEnabled();
-    final GemFireCacheImpl cache;
+    final InternalCache cache;
     cache = GemFireCacheImpl.getInstance();
     if (cache != null) {
       int oldLevel = LocalRegion.setThreadInitLevelRequirement(LocalRegion.BEFORE_INITIAL_IMAGE);

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
index 60775a4..7928662 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderQueue.java
@@ -54,7 +54,6 @@ import org.apache.geode.internal.cache.CachedDeserializable;
 import org.apache.geode.internal.cache.Conflatable;
 import org.apache.geode.internal.cache.DistributedRegion;
 import org.apache.geode.internal.cache.EntryEventImpl;
-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;
@@ -73,7 +72,6 @@ import org.apache.geode.pdx.internal.PeerTypeRegistration;
 
 /**
  * @since GemFire 7.0
- * 
  */
 public class SerialGatewaySenderQueue implements RegionQueue {
 
@@ -209,14 +207,12 @@ public class SerialGatewaySenderQueue implements RegionQueue {
     initializeRegion(abstractSender, listener);
     // Increment queue size. Fix for bug 51988.
     this.stats.incQueueSize(this.region.size());
-    this.removalThread = new BatchRemovalThread((GemFireCacheImpl) abstractSender.getCache());
+    this.removalThread = new BatchRemovalThread(abstractSender.getCache());
     this.removalThread.start();
     this.sender = abstractSender;
     if (logger.isDebugEnabled()) {
       logger.debug("{}: Contains {} elements", this, size());
     }
-
-
   }
 
   public Region<Long, AsyncEvent> getRegion() {
@@ -399,7 +395,7 @@ public class SerialGatewaySenderQueue implements RegionQueue {
     boolean wasEmpty = this.lastDispatchedKey == this.lastDestroyedKey;
     this.lastDispatchedKey = key;
     if (wasEmpty) {
-      this.notify();
+      notifyAll();
     }
 
     if (logger.isDebugEnabled()) {
@@ -425,7 +421,6 @@ public class SerialGatewaySenderQueue implements RegionQueue {
   }
 
   public Object peek() throws CacheException {
-    // resetLastPeeked();
     Object object = peekAhead();
     if (logger.isTraceEnabled()) {
       logger.trace("{}: Peeked {} -> {}", this, peekedIds, object);
@@ -451,7 +446,6 @@ public class SerialGatewaySenderQueue implements RegionQueue {
     }
     List<AsyncEvent> batch = new ArrayList<AsyncEvent>(size * 2); // why
                                                                   // *2?
-    // resetLastPeeked();
     while (batch.size() < size) {
       AsyncEvent object = peekAhead();
       // Conflate here
@@ -682,7 +676,6 @@ public class SerialGatewaySenderQueue implements RegionQueue {
 
   /**
    * Clear the list of peeked keys. The next peek will start again at the head key.
-   * 
    */
   public void resetLastPeeked() {
     this.peekedIds.clear();
@@ -693,7 +686,6 @@ public class SerialGatewaySenderQueue implements RegionQueue {
    * 
    * @throws CacheException
    */
-
   private Long getCurrentKey() {
     long currentKey;
     if (this.peekedIds.isEmpty()) {
@@ -732,7 +724,6 @@ public class SerialGatewaySenderQueue implements RegionQueue {
       return null;
     }
 
-
     // It's important here that we check where the current key
     // is in relation to the tail key before we check to see if the
     // object exists. The reason is that the tail key is basically
@@ -742,7 +733,7 @@ public class SerialGatewaySenderQueue implements RegionQueue {
     // If we check for the object, and then check the tail key, we could
     // skip objects.
 
-    // @todo don't do a get which updates the lru, instead just get the value
+    // TODO: don't do a get which updates the lru, instead just get the value
     // w/o modifying the LRU.
     // Note: getting the serialized form here (if it has overflowed to disk)
     // does not save anything since GatewayBatchOp needs to GatewayEventImpl
@@ -1022,12 +1013,14 @@ public class SerialGatewaySenderQueue implements RegionQueue {
      */
     private volatile boolean shutdown = false;
 
-    private final GemFireCacheImpl cache;
+    private final InternalCache cache;
 
     /**
      * Constructor : Creates and initializes the thread
+     * 
+     * @param c
      */
-    public BatchRemovalThread(GemFireCacheImpl c) {
+    public BatchRemovalThread(InternalCache c) {
       this.setDaemon(true);
       this.cache = c;
     }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
index 12a71a6..4cc75aa 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheCreation.java
@@ -1137,6 +1137,36 @@ public class CacheCreation implements InternalCache {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
+  @Override
+  public InternalLogWriter getInternalLogWriter() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public InternalLogWriter getSecurityInternalLogWriter() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public Set<LocalRegion> getApplicationRegions() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public void removeGatewaySender(final GatewaySender sender) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public DistributedLockService getGatewaySenderLockService() {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
+  @Override
+  public Properties getDeclarableProperties(final Declarable declarable) {
+    throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
+  }
+
   public void addGatewayReceiver(GatewayReceiver receiver) {
     this.gatewayReceivers.add(receiver);
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
index 21431a0..0cee768 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlGenerator.java
@@ -14,9 +14,9 @@
  */
 package org.apache.geode.internal.cache.xmlcache;
 
+import static javax.xml.XMLConstants.*;
 import static org.apache.geode.internal.cache.xmlcache.XmlGeneratorUtils.*;
 import static org.apache.geode.management.internal.configuration.utils.XmlConstants.*;
-import static javax.xml.XMLConstants.*;
 
 import java.io.File;
 import java.io.FileWriter;
@@ -42,7 +42,6 @@ import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamResult;
 
-import org.apache.geode.cache.wan.*;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.DTDHandler;
@@ -93,6 +92,7 @@ import org.apache.geode.cache.client.ClientRegionShortcut;
 import org.apache.geode.cache.client.Pool;
 import org.apache.geode.cache.client.PoolFactory;
 import org.apache.geode.cache.client.PoolManager;
+import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.cache.client.internal.PoolImpl;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionService;
@@ -103,6 +103,11 @@ import org.apache.geode.cache.query.internal.index.PrimaryKeyIndex;
 import org.apache.geode.cache.server.CacheServer;
 import org.apache.geode.cache.server.ServerLoadProbe;
 import org.apache.geode.cache.util.ObjectSizer;
+import org.apache.geode.cache.wan.GatewayEventFilter;
+import org.apache.geode.cache.wan.GatewayEventSubstitutionFilter;
+import org.apache.geode.cache.wan.GatewayReceiver;
+import org.apache.geode.cache.wan.GatewaySender;
+import org.apache.geode.cache.wan.GatewayTransportFilter;
 import org.apache.geode.distributed.Role;
 import org.apache.geode.internal.Assert;
 import org.apache.geode.internal.cache.AbstractRegion;
@@ -111,6 +116,7 @@ import org.apache.geode.internal.cache.ClientSubscriptionConfigImpl;
 import org.apache.geode.internal.cache.ColocationHelper;
 import org.apache.geode.internal.cache.DiskWriteAttributesImpl;
 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.PartitionAttributesImpl;
 import org.apache.geode.internal.cache.PartitionedRegion;
@@ -127,7 +133,6 @@ import org.apache.geode.pdx.ReflectionBasedAutoSerializer;
  * developed for testing purposes, but it is conceivable that it could be used in the product as
  * well.
  *
- *
  * @since GemFire 3.0
  */
 @SuppressWarnings("deprecation")
@@ -139,8 +144,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   /** The content handler to which SAX events are generated */
   private ContentHandler handler;
 
-  ///////////////////////// Instance Fields ////////////////////////
-
   /** The Cache that we're generating XML for */
   final private Cache cache;
 
@@ -151,18 +154,9 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   private boolean includeKeysValues = true;
   private final boolean generateDefaults;
 
-  // final private int cacheLockLease;
-  // final private int cacheLockTimeout;
-  // final private int cacheSearchTimeout;
-  // final private boolean isServer;
-  // final private boolean copyOnRead;
-
   /** The <code>CacheCreation</code> from which XML is generated */
   private final CacheCreation creation;
 
-  /////////////////////// Static Methods ///////////////////////
-
-
   /**
    * Examines the given <code>Cache</code> and from it generates XML data that is written to the
    * given <code>PrintWriter</code>. The schema/dtd for the current version of GemFire is used.
@@ -280,9 +274,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     (new CacheXmlGenerator()).generate(pw);
   }
 
-
-  //////////////////////// Constructors ////////////////////////
-
   /**
    * Creates a new <code>CacheXmlGenerator</code> that generates XML for a given <code>Cache</code>.
    */
@@ -304,7 +295,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
       this.creation.startingGenerate();
 
     } else if (cache instanceof GemFireCacheImpl) {
-      if (((GemFireCacheImpl) cache).isClient()) {
+      if (((InternalCache) cache).isClient()) {
         this.creation = new ClientCacheCreation();
         if (generateDefaults() || cache.getCopyOnRead()) {
           this.creation.setCopyOnRead(cache.getCopyOnRead());
@@ -402,8 +393,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     creation.setCopyOnRead(GemFireCacheImpl.DEFAULT_COPY_ON_READ);
   }
 
-  ////////////////////// Instance Methods //////////////////////
-
   /**
    * Writes the generator's state to pw
    */
@@ -563,7 +552,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
 
       if (this.version.compareTo(CacheXmlVersion.GEMFIRE_6_5) >= 0) {
         if (this.cache instanceof GemFireCacheImpl) {
-          GemFireCacheImpl gfc = (GemFireCacheImpl) this.cache;
+          InternalCache gfc = (InternalCache) this.cache;
           for (DiskStore ds : gfc.listDiskStores()) {
             generate(ds);
           }
@@ -587,7 +576,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
           // we need to exclude them in all versions.
           // It would be better if CacheCreation could only predefine them
           // for versions 6.5 and later but that is not easy to do
-          /* if (this.version.compareTo(CacheXmlVersion.GEMFIRE_6_5) >= 0) */ {
+          {
             if (this.creation instanceof ClientCacheCreation) {
               try {
                 ClientRegionShortcut.valueOf(id);
@@ -632,8 +621,8 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
       if (!isClientCache) {
         if (this.version.compareTo(CacheXmlVersion.GEMFIRE_6_5) >= 0) {
           if (this.cache instanceof GemFireCacheImpl) {
-            GemFireCacheImpl gfc = (GemFireCacheImpl) this.cache;
-            for (File file : gfc.getBackupFiles()) {
+            InternalCache internalCache = (InternalCache) this.cache;
+            for (File file : internalCache.getBackupFiles()) {
               generateBackupFile(file);
             }
           } else {
@@ -646,12 +635,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
       if (this.version.compareTo(CacheXmlVersion.GEMFIRE_6_6) >= 0) {
         generateInitializer();
       }
-    } else {
-      if (handler instanceof LexicalHandler) {
-        // LexicalHandler lex = (LexicalHandler) handler;
-        // lex.comment(comment.toCharArray(), 0, comment.length());
-      }
-
     }
 
     if (cache instanceof Extensible) {
@@ -670,12 +653,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
 
   private void generatePdx() throws SAXException {
     AttributesImpl atts = new AttributesImpl();
-    CacheConfig config;
-    if (this.cache instanceof CacheCreation) {
-      config = ((CacheCreation) cache).getCacheConfig();
-    } else {
-      config = ((GemFireCacheImpl) cache).getCacheConfig();
-    }
+    CacheConfig config = ((InternalCache) cache).getCacheConfig();
     if (config.pdxReadSerializedUserSet) {
       if (generateDefaults() || this.cache.getPdxReadSerialized())
         atts.addAttribute("", "", READ_SERIALIZED, "",
@@ -929,7 +907,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
    * 
    * @since GemFire 5.7
    */
-
   private void generateClientHaQueue(CacheServer bridge) throws SAXException {
     AttributesImpl atts = new AttributesImpl();
     ClientSubscriptionConfigImpl csc =
@@ -1006,11 +983,10 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
             String.valueOf(bridge.getMaximumMessageCount()));
 
       if (generateDefaults()
-          || bridge.getMessageTimeToLive() != CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE)
+          || bridge.getMessageTimeToLive() != CacheServer.DEFAULT_MESSAGE_TIME_TO_LIVE) {
         atts.addAttribute("", "", MESSAGE_TIME_TO_LIVE, "",
             String.valueOf(bridge.getMessageTimeToLive()));
-
-
+      }
 
       if (this.version.compareTo(CacheXmlVersion.GEMFIRE_5_7) < 0) {
         return;
@@ -1063,8 +1039,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
         if (generateDefaults() || !probe.equals(CacheServer.DEFAULT_LOAD_PROBE)) {
           generate(LOAD_PROBE, probe);
         }
-
-
       }
       if (this.version.compareTo(CacheXmlVersion.GEMFIRE_5_7) >= 0) {
         handler.endElement("", "", CACHE_SERVER);
@@ -1184,8 +1158,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
 
   /**
    * Compare regions by name
-   * 
-   *
    */
   class RegionComparator implements Comparator {
     public int compare(Object o1, Object o2) {
@@ -1197,7 +1169,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     }
   }
 
-
   /**
    * Generates XML for the given connection pool
    *
@@ -1598,7 +1569,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   }
 
   private void generateGatewayEventFilter(GatewayEventFilter gef) throws SAXException {
-
     handler.startElement("", GATEWAY_EVENT_FILTER, GATEWAY_EVENT_FILTER, EMPTY);
     String className = gef.getClass().getName();
 
@@ -1614,7 +1584,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   }
 
   private void generateGatewayTransportFilter(GatewayTransportFilter gef) throws SAXException {
-
     handler.startElement("", GATEWAY_TRANSPORT_FILTER, GATEWAY_TRANSPORT_FILTER, EMPTY);
     String className = gef.getClass().getName();
 
@@ -1646,24 +1615,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     }
     handler.endElement("", GATEWAY_EVENT_SUBSTITUTION_FILTER, GATEWAY_EVENT_SUBSTITUTION_FILTER);
   }
-  //
-  // private void generateGatewayEventListener(GatewayEventListener gef)
-  // throws SAXException {
-  //
-  // handler.startElement("", GATEWAY_EVENT_LISTENER, GATEWAY_EVENT_LISTENER,
-  // EMPTY);
-  // String className = gef.getClass().getName();
-  //
-  // handler.startElement("", CLASS_NAME, CLASS_NAME, EMPTY);
-  // handler.characters(className.toCharArray(), 0, className.length());
-  // handler.endElement("", CLASS_NAME, CLASS_NAME);
-  // Properties props = null;
-  // if (gef instanceof Declarable2) {
-  // props = ((Declarable2)gef).getConfig();
-  // generate(props, null);
-  // }
-  // handler.endElement("", GATEWAY_EVENT_LISTENER, GATEWAY_EVENT_LISTENER);
-  // }
 
   /**
    * Generates XML for a given region
@@ -1996,8 +1947,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
       }
     }
 
-
-
     if ((!(attrs instanceof RegionAttributesCreation)
         || ((RegionAttributesCreation) attrs).hasStatisticsEnabled())) {
       if (generateDefaults() || attrs.getStatisticsEnabled())
@@ -2230,7 +2179,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
    * Generates XML for a <code>CacheCallback</code>
    */
   private void generate(String kind, Object callback) throws SAXException {
-
     if (callback == null) {
       return;
     }
@@ -2248,7 +2196,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     } else if (callback instanceof ReflectionBasedAutoSerializer) {
       props = ((ReflectionBasedAutoSerializer) callback).getConfig();
     } else if (callback instanceof Declarable && cache instanceof GemFireCacheImpl) {
-      props = ((GemFireCacheImpl) cache).getDeclarableProperties((Declarable) callback);
+      props = ((InternalCache) cache).getDeclarableProperties((Declarable) callback);
     }
     generate(props, null);
 
@@ -2256,7 +2204,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   }
 
   private void generate(String kind, Declarable d, Properties p) throws SAXException {
-
     if (d == null) {
       return;
     }
@@ -2274,7 +2221,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   }
 
   private void generate(EvictionAttributes ea) throws SAXException {
-
     EvictionAction eAction = ea.getAction();
     if (eAction.isNone()) {
       return;
@@ -2366,7 +2312,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
    * Generates XML for <code>SubscriptionAttributes</code>
    */
   private void generate(SubscriptionAttributes attrs) throws SAXException {
-
     if (attrs == null) {
       return;
     }
@@ -2394,7 +2339,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
    * Generates XML for a <code>PartitionAttributes</code>
    */
   private void generate(PartitionAttributes pa) throws SAXException {
-
     AttributesImpl atts = new AttributesImpl();
 
     if (generateDefaults() || pa.getRedundantCopies() != 0)
@@ -2530,7 +2474,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     }
   }
 
-
   /**
    * Generates XML for a <code>DiskWriteAttributes</code>
    */
@@ -2631,29 +2574,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     if (d instanceof Declarable2) {
       Properties props = ((Declarable2) d).getConfig();
       generate(props, null);
-      // for (Iterator iter = props.entrySet().iterator();
-      // iter.hasNext(); ) {
-      // Map.Entry entry = (Map.Entry) iter.next();
-      // String name = (String) entry.getKey();
-      // Object value = entry.getValue();
-      //
-      // AttributesImpl atts = new AttributesImpl();
-      // atts.addAttribute("", "", NAME, "", name);
-      //
-      // handler.startElement("", PARAMETER, PARAMETER, atts);
-      //
-      // if (value instanceof String) {
-      // generate((String) value);
-      //
-      // } else if (value instanceof Declarable) {
-      // generate((Declarable) value);
-      //
-      // } else {
-      // // Ignore it
-      // }
-      //
-      // handler.endElement("", PARAMETER, PARAMETER);
-      // }
     }
 
     if (includeDeclarable) {
@@ -2705,7 +2625,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     }
   }
 
-
   private void generate(final Properties props, String elementName) throws SAXException {
     if (props == null || props.isEmpty()) {
       return;
@@ -2762,8 +2681,6 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
     return this;
   }
 
-  ////////// Inherited methods that don't do anything //////////
-
   public boolean getFeature(String name)
       throws SAXNotRecognizedException, SAXNotSupportedException {
     return false;
@@ -2771,7 +2688,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
 
   public void setFeature(String name, boolean value)
       throws SAXNotRecognizedException, SAXNotSupportedException {
-
+    // nothing
   }
 
   public Object getProperty(String name)
@@ -2782,11 +2699,11 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
 
   public void setProperty(String name, Object value)
       throws SAXNotRecognizedException, SAXNotSupportedException {
-
+    // nothing
   }
 
   public void setEntityResolver(EntityResolver resolver) {
-
+    // nothing
   }
 
   public EntityResolver getEntityResolver() {
@@ -2794,7 +2711,7 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   }
 
   public void setDTDHandler(DTDHandler handler) {
-
+    // nothing
   }
 
   public DTDHandler getDTDHandler() {
@@ -2802,14 +2719,13 @@ public class CacheXmlGenerator extends CacheXml implements XMLReader {
   }
 
   public void setErrorHandler(ErrorHandler handler) {
-
+    // nothing
   }
 
   public void parse(String systemId) throws IOException, SAXException {
-
+    // nothing
   }
 
-
   /**
    * Used by gemfire build.xml to generate a default gemfire.properties for use by applications. See
    * bug 30995 for the feature request.

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
index fd8fb2a..c8635d5 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/CacheXmlParser.java
@@ -108,7 +108,7 @@ import org.apache.geode.internal.cache.DiskStoreAttributes;
 import org.apache.geode.internal.cache.DiskWriteAttributesImpl;
 import org.apache.geode.internal.cache.EvictionAttributesImpl;
 import org.apache.geode.internal.cache.FixedPartitionAttributesImpl;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.PartitionAttributesImpl;
 import org.apache.geode.internal.cache.PartitionedRegionHelper;
 import org.apache.geode.internal.cache.lru.LRUCapacityController;
@@ -332,8 +332,9 @@ public class CacheXmlParser extends CacheXml implements ContentHandler {
    * @throws TimeoutException
    * @throws CacheWriterException
    * @throws RegionExistsException
+   * @param cache
    */
-  public void create(GemFireCacheImpl cache)
+  public void create(InternalCache cache)
       throws TimeoutException, GatewayException, CacheWriterException, RegionExistsException {
     if (this.cache == null) {
       String s = "A cache or client-cache element is required";

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
index 30b6237..cf8c4c9 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionAttributesCreation.java
@@ -41,6 +41,7 @@ import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.Scope;
 import org.apache.geode.cache.SubscriptionAttributes;
+import org.apache.geode.cache.client.internal.InternalClientCache;
 import org.apache.geode.compression.Compressor;
 import org.apache.geode.internal.cache.EvictionAttributesImpl;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
@@ -62,8 +63,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
 
   private static final RegionAttributes defaultAttributes = new AttributesFactory().create();
 
-  /////////////////////// Instance Fields ///////////////////////
-
   /** The attributes' cache listener */
   private ArrayList cacheListeners;
   /** The attributes' gateway senders */
@@ -288,8 +287,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     }
   }
 
-  ////////////////////// Instance Methods //////////////////////
-
   /**
    * Returns whether or not two objects are {@linkplain Object#equals equals} taking
    * <code>null</code> into account.
@@ -386,14 +383,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
    * <code>RegionAttributes</code>.
    */
   public boolean sameAs(RegionAttributes other) {
-    // if (!equal(this.cacheListeners, Arrays.asList(other.getCacheListeners()))) {
-    // throw new RuntimeException("cacheListeners not equal "
-    // + this.cacheListeners
-    // + " and "
-    // + Arrays.asList(other.getCacheListeners())
-    // + " this=" + this
-    // + " other=" + other);
-    // }
     if (!equal(this.cacheListeners, Arrays.asList(other.getCacheListeners()))) {
       throw new RuntimeException(
           LocalizedStrings.RegionAttributesCreation_CACHELISTENERS_ARE_NOT_THE_SAME
@@ -895,7 +884,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     setHasMulticastEnabled(true);
   }
 
-  /*
+  /**
    * @deprecated as of prPersistSprint1
    */
   @Deprecated
@@ -903,13 +892,12 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     return this.publisher;
   }
 
-  /*
+  /**
    * @deprecated as of prPersistSprint1
    */
   @Deprecated
   public void setPublisher(boolean v) {
-    // this.publisher = v;
-    // setHasPublisher(true);
+    // nothing
   }
 
   public boolean getEnableConflation() { // deprecated in 5.0
@@ -958,11 +946,10 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public void setDiskWriteAttributes(DiskWriteAttributes attrs) {
     // not throw exception for mixed API, since it's internal
     this.diskWriteAttributes = attrs;
-    // Asif: Take the value of isSynchronous from it;
-    // Asif : Is this correct?
     this.isDiskSynchronous = attrs.isSynchronous();
     setHasDiskWriteAttributes(true);
   }
@@ -970,6 +957,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public File[] getDiskDirs() {
     // not throw exception for mixed API, since it's internal
     return this.diskDirs;
@@ -978,6 +966,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public int[] getDiskDirSizes() {
     // not throw exception for mixed API, since it's internal
     return this.diskSizes;
@@ -986,6 +975,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public void setDiskDirs(File[] diskDirs) {
     // not throw exception for mixed API, since it's internal
     checkIfDirectoriesExist(diskDirs);
@@ -1008,12 +998,8 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
 
   public boolean isDiskSynchronous() {
     return this.isDiskSynchronous;
-    // Asif: If DiskWriteAttributes is set, the flag needs to be checked from DiskWriteAttribs
+    // If DiskWriteAttributes is set, the flag needs to be checked from DiskWriteAttribs
     // TODO: Should we set the correct value in the flag isDiskSynchronous
-    /*
-     * if(hasDiskWriteAttributes()) { return this.diskWriteAttributes.isSynchronous(); }else {
-     * return this.isDiskSynchronous; }
-     */
   }
 
   public void setDiskSynchronous(boolean isDiskSynchronous) {
@@ -1036,10 +1022,10 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     }
   }
 
-
   /**
    * @deprecated as of prPersistSprint2
    */
+  @Deprecated
   public void setDiskDirsAndSize(File[] diskDirs, int[] sizes) {
     // not throw exception for mixed API, since it's internal
     checkIfDirectoriesExist(diskDirs);
@@ -1055,7 +1041,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
     this.setHasDiskDirs(true);
   }
 
-
   private void verifyNonNegativeDirSize(int[] sizes) {
     for (int i = 0; i < sizes.length; i++) {
       if (sizes[i] < 0) {
@@ -1126,7 +1111,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
       if (setDefaultPool && this.requiresPoolName && !hasPoolName()) {
         String defaultPoolName = null;
         if (cache instanceof GemFireCacheImpl) {
-          GemFireCacheImpl gfc = (GemFireCacheImpl) cache;
+          InternalClientCache gfc = (InternalClientCache) cache;
           if (gfc.getDefaultPool() != null) {
             defaultPoolName = gfc.getDefaultPool().getName();
           }
@@ -1162,7 +1147,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
         if (!hasPoolName()) {
           String defaultPoolName = null;
           if (cache instanceof GemFireCacheImpl) {
-            GemFireCacheImpl gfc = (GemFireCacheImpl) cache;
+            InternalClientCache gfc = (InternalClientCache) cache;
             if (gfc.getDefaultPool() != null) {
               defaultPoolName = gfc.getDefaultPool().getName();
             }
@@ -1547,7 +1532,6 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
         setMulticastEnabled(parent.getMulticastEnabled());
       }
     }
-
   }
 
   public PartitionAttributes getPartitionAttributes() {
@@ -1569,6 +1553,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated this API is scheduled to be removed
    */
+  @Deprecated
   public MembershipAttributes getMembershipAttributes() {
     return this.membershipAttributes;
   }
@@ -1576,6 +1561,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
   /**
    * @deprecated this API is scheduled to be removed
    */
+  @Deprecated
   public void setMembershipAttributes(MembershipAttributes pa) {
     this.membershipAttributes = pa;
     setHasMembershipAttributes(true);
@@ -1656,7 +1642,7 @@ public class RegionAttributesCreation extends UserSpecifiedRegionAttributes
           && (getRegionTimeToLive().getTimeout() != 0 || getRegionIdleTimeout().getTimeout() != 0
               || getEntryTimeToLive().getTimeout() != 0 || getEntryIdleTimeout().getTimeout() != 0
               || getCustomEntryIdleTimeout() != null || getCustomEntryTimeToLive() != null)) {
-        // @todo we could do some more implementation work so that we would
+        // TODO: we could do some more implementation work so that we would
         // not need to enable stats unless entryIdleTimeout is enabled.
         // We need the stats in that case because we need a new type of RegionEntry
         // so we know that last time it was accessed. But for all the others we

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
index 9e18a3a..a107fb3 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/xmlcache/RegionCreation.java
@@ -46,7 +46,6 @@ import org.apache.geode.cache.TimeoutException;
 import org.apache.geode.cache.query.SelectResults;
 import org.apache.geode.cache.query.internal.index.IndexCreationData;
 import org.apache.geode.cache.snapshot.RegionSnapshotService;
-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.extension.Extensible;
@@ -59,18 +58,10 @@ import org.apache.geode.internal.i18n.LocalizedStrings;
  * {@link Region} interface so that this class must be updated when {@link Region} is modified. This
  * class is public for testing purposes.
  *
- *
  * @since GemFire 3.0
  */
 public class RegionCreation implements Region, Extensible<Region<?, ?>> {
 
-  // /** An <code>AttributesFactory</code> for creating default
-  // * <code>RegionAttribute</code>s */
-  // private static final AttributesFactory defaultFactory =
-  // new AttributesFactory();
-
-  /////////////////////// Instance Fields ///////////////////////
-
   /** The name of this region */
   private final String name;
 
@@ -116,8 +107,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
   private final SimpleExtensionPoint<Region<?, ?>> extensionPoint =
       new SimpleExtensionPoint<Region<?, ?>>(this, this);
 
-  /////////////////////// Constructors ///////////////////////
-
   /**
    * Creates a new <code>RegionCreation</code> with the given name and with the default
    * <code>RegionAttributes</code>.
@@ -147,8 +136,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     this(cache, null, name, null);
   }
 
-  ////////////////////// Instance Methods //////////////////////
-
   public Object put(Object key, Object value) throws TimeoutException, CacheWriterException {
     return this.values.put(key, value);
   }
@@ -636,8 +623,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     return this.fullPath;
   }
 
-  ////////// Inherited methods that don't do anything //////////
-
   public Region getParentRegion() {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
@@ -666,7 +651,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
-
   public void destroyRegion() throws CacheWriterException, TimeoutException {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
@@ -737,7 +721,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
   }
 
-
   public Object destroy(Object key)
       throws TimeoutException, EntryNotFoundException, CacheWriterException {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
@@ -754,7 +737,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
 
   public void localDestroy(Object key, Object callbackArgument) throws EntryNotFoundException {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-
   }
 
   public Set keys() {
@@ -832,7 +814,6 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
 
   public void clear() {
     throw new UnsupportedOperationException(LocalizedStrings.SHOULDNT_INVOKE.toLocalizedString());
-
   }
 
   public boolean isEmpty() {
@@ -900,39 +881,18 @@ public class RegionCreation implements Region, Extensible<Region<?, ?>> {
     throw new UnsupportedOperationException("Shouldn't be invoked");
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#putIfAbsent(java.lang.Object, java.lang.Object)
-   */
   public Object putIfAbsent(Object key, Object value) {
     throw new UnsupportedOperationException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#remove(java.lang.Object, java.lang.Object)
-   */
   public boolean remove(Object key, Object value) {
     throw new UnsupportedOperationException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#replace(java.lang.Object, java.lang.Object)
-   */
   public Object replace(Object key, Object value) {
     throw new UnsupportedOperationException();
   }
 
-  /*
-   * (non-Javadoc)
-   * 
-   * @see java.util.concurrent.ConcurrentMap#replace(java.lang.Object, java.lang.Object,
-   * java.lang.Object)
-   */
   public boolean replace(Object key, Object oldValue, Object newValue) {
     throw new UnsupportedOperationException();
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
index 08ee355..3c9dd72 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/DataType.java
@@ -27,6 +27,7 @@ import org.apache.geode.internal.DSFIDFactory;
 import org.apache.geode.internal.InternalDataSerializer;
 import org.apache.geode.internal.InternalInstantiator;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.pdx.internal.EnumInfo;
 import org.apache.geode.pdx.internal.PdxType;
 
@@ -200,7 +201,7 @@ public class DataType implements DSCODE {
         case PDX: {
           int typeId = in.readInt();
           try {
-            GemFireCacheImpl gfc = GemFireCacheImpl
+            InternalCache gfc = GemFireCacheImpl
                 .getForPdx("PDX registry is unavailable because the Cache has been closed.");
             PdxType pdxType = gfc.getPdxRegistry().getType(typeId);
             if (pdxType == null) { // fix 52164
@@ -216,7 +217,7 @@ public class DataType implements DSCODE {
           int tmp = InternalDataSerializer.readArrayLength(in);
           int enumId = (dsId << 24) | (tmp & 0xFFFFFF);
           try {
-            GemFireCacheImpl gfc = GemFireCacheImpl
+            InternalCache gfc = GemFireCacheImpl
                 .getForPdx("PDX registry is unavailable because the Cache has been closed.");
             EnumInfo enumInfo = gfc.getPdxRegistry().getEnumInfoById(enumId);
             return "PdxRegistry/java.lang.Enum:" + enumInfo.getClassName();
@@ -244,10 +245,8 @@ public class DataType implements DSCODE {
       }
       return "Unknown header byte: " + header;
     } catch (IOException e) {
-      // return "IOException for header byte: " + header;
       throw new Error(e);
     } catch (ClassNotFoundException e) {
-      // return "IOException for header byte: " + header;
       throw new Error(e);
     }
   }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java b/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
index 4dd152e..f057369 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/offheap/MemoryAllocatorImpl.java
@@ -14,18 +14,31 @@
  */
 package org.apache.geode.internal.offheap;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.logging.log4j.Logger;
+
 import org.apache.geode.cache.CacheClosedException;
 import org.apache.geode.cache.Region;
 import org.apache.geode.cache.RegionService;
 import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.internal.cache.*;
+import org.apache.geode.internal.cache.BucketRegion;
+import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.LocalRegion;
+import org.apache.geode.internal.cache.PartitionedRegion;
+import org.apache.geode.internal.cache.PartitionedRegionDataStore;
+import org.apache.geode.internal.cache.RegionEntry;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.offheap.annotations.OffHeapIdentifier;
 import org.apache.geode.internal.offheap.annotations.Unretained;
-import org.apache.logging.log4j.Logger;
-
-import java.util.*;
-import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * This allocator is somewhat like an Arena allocator. We start out with an array of multiple large

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
index 5952c4c..7d02d38 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisee.java
@@ -14,6 +14,8 @@
  */
 package org.apache.geode.management.internal;
 
+import java.net.UnknownHostException;
+
 import org.apache.geode.CancelCriterion;
 import org.apache.geode.distributed.internal.DM;
 import org.apache.geode.distributed.internal.DistributionAdvisee;
@@ -22,26 +24,23 @@ import org.apache.geode.distributed.internal.DistributionAdvisor.Profile;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 import org.apache.geode.internal.admin.SSLConfig;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SSLConfigurationFactory;
 import org.apache.geode.internal.net.SocketCreator;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.internal.JmxManagerAdvisor.JmxManagerProfile;
 
-import java.net.UnknownHostException;
-
 /**
- * 
  * @since GemFire 7.0
  */
 public class JmxManagerAdvisee implements DistributionAdvisee {
 
   private final int serialNumber;
-  private final GemFireCacheImpl cache;
+  private final InternalCache cache;
   private JmxManagerProfile myMostRecentProfile;
 
-  public JmxManagerAdvisee(GemFireCacheImpl cache) {
+  public JmxManagerAdvisee(InternalCache cache) {
     this.serialNumber = DistributionAdvisor.createSerialNumber();
     this.cache = cache;
   }
@@ -73,7 +72,7 @@ public class JmxManagerAdvisee implements DistributionAdvisee {
 
   @Override
   public InternalDistributedSystem getSystem() {
-    return this.cache.getSystem();
+    return this.cache.getInternalDistributedSystem();
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
index a0f63ce..c8858f4 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/JmxManagerAdvisor.java
@@ -35,12 +35,12 @@ import org.apache.geode.distributed.internal.HighPriorityDistributionMessage;
 import org.apache.geode.distributed.internal.ReplyException;
 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.i18n.LocalizedStrings;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LocalizedMessage;
 
 /**
- * 
  * @since GemFire 7.0
  */
 public class JmxManagerAdvisor extends DistributionAdvisor {
@@ -104,10 +104,10 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
     return new JmxManagerProfile(memberId, version);
   }
 
-  @Override
   /**
    * Overridden to also include our profile. If our profile is included it will always be first.
    */
+  @Override
   protected List/* <Profile> */ fetchProfiles(Filter f) {
     initializationGate();
     List result = null;
@@ -169,18 +169,12 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
       this.profile = p;
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geode.distributed.internal.DistributionMessage#process(org.apache.geode.
-     * distributed.internal.DistributionManager)
-     */
     @Override
     protected void process(DistributionManager dm) {
       Throwable thr = null;
       JmxManagerProfile p = null;
       try {
-        final GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+        final InternalCache cache = GemFireCacheImpl.getInstance();
         if (cache != null && !cache.isClosed()) {
           final JmxManagerAdvisor adv = cache.getJmxManagerAdvisor();
           p = this.profile;
@@ -194,7 +188,7 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
         }
       } catch (CancelException e) {
         if (logger.isDebugEnabled()) {
-          logger.debug("Cache closed, ", this);
+          logger.debug("Cache closed, {}", this);
         }
       } catch (VirtualMachineError err) {
         SystemFailure.initiateFailure(err);
@@ -219,11 +213,6 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
       }
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.geode.internal.DataSerializableFixedID#getDSFID()
-     */
     public int getDSFID() {
       return JMX_MANAGER_PROFILE_MESSAGE;
     }
@@ -338,7 +327,7 @@ public class JmxManagerAdvisor extends DistributionAdvisor {
     @Override
     public void processIncoming(DistributionManager dm, String adviseePath, boolean removeProfile,
         boolean exchangeProfiles, final List<Profile> replyProfiles) {
-      final GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
+      final InternalCache cache = GemFireCacheImpl.getInstance();
       if (cache != null && !cache.isClosed()) {
         handleDistributionAdvisee(cache.getJmxManagerAdvisor().getAdvisee(), removeProfile,
             exchangeProfiles, replyProfiles);

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
index 9394efb..62310e8 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementAgent.java
@@ -14,32 +14,6 @@
  */
 package org.apache.geode.management.internal;
 
-import org.apache.geode.GemFireConfigException;
-import org.apache.geode.cache.CacheFactory;
-import org.apache.geode.distributed.internal.DistributionConfig;
-import org.apache.geode.distributed.internal.DistributionManager;
-import org.apache.geode.internal.GemFireVersion;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.lang.StringUtils;
-import org.apache.geode.internal.logging.LogService;
-import org.apache.geode.internal.net.SSLConfigurationFactory;
-import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.net.SocketCreatorFactory;
-import org.apache.geode.internal.security.SecurableCommunicationChannel;
-import org.apache.geode.internal.security.SecurityService;
-import org.apache.geode.internal.security.shiro.JMXShiroAuthenticator;
-import org.apache.geode.internal.tcp.TCPConduit;
-import org.apache.geode.management.ManagementException;
-import org.apache.geode.management.ManagementService;
-import org.apache.geode.management.ManagerMXBean;
-import org.apache.geode.management.internal.security.AccessControlMBean;
-import org.apache.geode.management.internal.security.MBeanServerWrapper;
-import org.apache.geode.management.internal.security.ResourceConstants;
-import org.apache.geode.management.internal.unsafe.ReadOpFileAccessController;
-import org.apache.logging.log4j.Logger;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-
 import java.io.IOException;
 import java.io.Serializable;
 import java.lang.management.ManagementFactory;
@@ -55,6 +29,7 @@ import java.rmi.server.RMIServerSocketFactory;
 import java.rmi.server.UnicastRemoteObject;
 import java.util.HashMap;
 import java.util.Set;
+
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
@@ -68,6 +43,33 @@ import javax.management.remote.rmi.RMIJRMPServerImpl;
 import javax.management.remote.rmi.RMIServerImpl;
 import javax.rmi.ssl.SslRMIClientSocketFactory;
 
+import org.apache.logging.log4j.Logger;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+
+import org.apache.geode.GemFireConfigException;
+import org.apache.geode.cache.CacheFactory;
+import org.apache.geode.distributed.internal.DistributionConfig;
+import org.apache.geode.distributed.internal.DistributionManager;
+import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.cache.InternalCache;
+import org.apache.geode.internal.lang.StringUtils;
+import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.internal.net.SSLConfigurationFactory;
+import org.apache.geode.internal.net.SocketCreator;
+import org.apache.geode.internal.net.SocketCreatorFactory;
+import org.apache.geode.internal.security.SecurableCommunicationChannel;
+import org.apache.geode.internal.security.SecurityService;
+import org.apache.geode.internal.security.shiro.JMXShiroAuthenticator;
+import org.apache.geode.internal.tcp.TCPConduit;
+import org.apache.geode.management.ManagementException;
+import org.apache.geode.management.ManagementService;
+import org.apache.geode.management.ManagerMXBean;
+import org.apache.geode.management.internal.security.AccessControlMBean;
+import org.apache.geode.management.internal.security.MBeanServerWrapper;
+import org.apache.geode.management.internal.security.ResourceConstants;
+import org.apache.geode.management.internal.unsafe.ReadOpFileAccessController;
+
 /**
  * Agent implementation that controls the JMX server end points for JMX clients to connect, such as
  * an RMI server.
@@ -118,11 +120,11 @@ public class ManagementAgent {
     this.isHttpServiceRunning = isHttpServiceRunning;
   }
 
-  private boolean isAPIRestServiceRunning(GemFireCacheImpl cache) {
+  private boolean isAPIRestServiceRunning(InternalCache cache) {
     return (cache != null && cache.getRestAgent() != null && cache.getRestAgent().isRunning());
   }
 
-  private boolean isServerNode(GemFireCacheImpl cache) {
+  private boolean isServerNode(InternalCache cache) {
     return (cache.getInternalDistributedSystem().getDistributedMember()
         .getVmKind() != DistributionManager.LOCATOR_DM_TYPE
         && cache.getInternalDistributedSystem().getDistributedMember()
@@ -130,7 +132,7 @@ public class ManagementAgent {
         && !cache.isClient());
   }
 
-  public synchronized void startAgent(GemFireCacheImpl cache) {
+  public synchronized void startAgent(InternalCache cache) {
     // Do not start Management REST service if developer REST service is already
     // started.
 
@@ -285,7 +287,7 @@ public class ManagementAgent {
 
           // set cache property for developer REST service running
           if (isRestWebAppAdded) {
-            GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+            InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
             cache.setRESTServiceRunning(true);
 
             // create region to hold query information (queryId, queryString).
@@ -354,12 +356,9 @@ public class ManagementAgent {
    * https://blogs.oracle.com/jmxetc/entry/java_5_premain_rmi_connectors
    * https://blogs.oracle.com/jmxetc/entry/building_a_remotely_stoppable_connector
    * https://blogs.oracle.com/jmxetc/entry/jmx_connecting_through_firewalls_using
+   * https://blogs.oracle.com/jmxetc/entry/java_5_premain_rmi_connectors
    */
   private void configureAndStart() throws IOException {
-    // KIRK: I copied this from
-    // https://blogs.oracle.com/jmxetc/entry/java_5_premain_rmi_connectors
-    // we'll need to change this significantly but it's a starting point
-
     // get the port for RMI Registry and RMI Connector Server
     final int port = this.config.getJmxManagerPort();
     final String hostname;
@@ -387,7 +386,6 @@ public class ManagementAgent {
           (bindAddr != null ? (" bound to " + bindAddr) : "") + (ssl ? " using SSL" : ""));
     }
     RMIClientSocketFactory rmiClientSocketFactory = ssl ? new SslRMIClientSocketFactory() : null;// RMISocketFactory.getDefaultSocketFactory();
-    // new GemFireRMIClientSocketFactory(sc, getLogger());
     RMIServerSocketFactory rmiServerSocketFactory =
         new GemFireRMIServerSocketFactory(socketCreator, bindAddr);
 
@@ -399,14 +397,14 @@ public class ManagementAgent {
     // everywhere, or nowhere. Since we want to use them in the JMX
     // RMI Connector server, we must also use them in the RMI Registry.
     // Otherwise, we wouldn't be able to use a single port.
-    //
+
     // Start an RMI registry on port <port>.
     registry = LocateRegistry.createRegistry(port, rmiClientSocketFactory, rmiServerSocketFactory);
 
     // Retrieve the PlatformMBeanServer.
     MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 
-    // Environment map. KIRK: why is this declared as HashMap?
+    // Environment map. why is this declared as HashMap?
     final HashMap<String, Object> env = new HashMap<String, Object>();
 
     // Manually creates and binds a JMX RMI Connector Server stub with the
@@ -441,7 +439,7 @@ public class ManagementAgent {
 
     // Create an RMI connector server with the JMXServiceURL
     //
-    // KIRK: JDK 1.5 cannot use JMXConnectorServerFactory because of
+    // JDK 1.5 cannot use JMXConnectorServerFactory because of
     // http://bugs.sun.com/view_bug.do?bug_id=5107423
     // but we're using JDK 1.6
     jmxConnectorServer =
@@ -538,8 +536,6 @@ public class ManagementAgent {
     }
   }
 
-  ;
-
   private static class GemFireRMIServerSocketFactory
       implements RMIServerSocketFactory, Serializable {
 
@@ -557,6 +553,4 @@ public class ManagementAgent {
       return this.sc.createServerSocket(port, TCPConduit.getBackLog(), this.bindAddr);
     }
   }
-
-  ;
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
index 26f4d38..097b161 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/ManagementFunction.java
@@ -29,6 +29,7 @@ import org.apache.geode.cache.execute.FunctionAdapter;
 import org.apache.geode.cache.execute.FunctionContext;
 import org.apache.geode.internal.InternalEntity;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 
 /**
@@ -40,17 +41,11 @@ import org.apache.geode.internal.logging.LogService;
  * 
  * 1) All setter methods 2) All operations 3) addNotificationListener 4) removeNotificationListener
  * 5) getNotificationInfo
- * 
- * 
  */
-
 public class ManagementFunction extends FunctionAdapter implements InternalEntity {
 
   private static final Logger logger = LogService.getLogger();
 
-  /**
-   * 
-   */
   private static final long serialVersionUID = 1L;
 
   /**
@@ -81,8 +76,7 @@ public class ManagementFunction extends FunctionAdapter implements InternalEntit
 
     boolean executedSuccessfully = false;
 
-    GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
-
+    InternalCache cache = GemFireCacheImpl.getInstance();
 
     Object[] functionArguments = (Object[]) fc.getArguments();
 
@@ -145,10 +139,8 @@ public class ManagementFunction extends FunctionAdapter implements InternalEntit
           sendException(e, fc);
           return; // member is closing or invalid member
         }
-
       }
     }
-
   }
 
   public String getId() {

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java b/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
index 3c80969..916cbd7 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/Manager.java
@@ -14,10 +14,8 @@
  */
 package org.apache.geode.management.internal;
 
-import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
-import org.apache.geode.internal.logging.InternalLogWriter;
+import org.apache.geode.internal.cache.InternalCache;
 
 /**
  * The Manager is a 7.0 JMX Agent which is hosted within a GemFire process. Only one instance is
@@ -28,44 +26,32 @@ import org.apache.geode.internal.logging.InternalLogWriter;
  */
 public abstract class Manager {
 
-
-  /**
-   * GemFire Cache implementation
-   */
-
-  protected GemFireCacheImpl cache;
-
+  protected InternalCache cache;
 
   /**
    * depicts whether this node is a Managing node or not
    */
   protected volatile boolean running = false;
 
-
   /**
    * depicts whether this node is a Managing node or not
    */
   protected volatile boolean stopCacheOps = false;
 
-
-
   /**
    * This is a single window to manipulate region resources for management
    */
   protected ManagementResourceRepo repo;
 
-
   /**
    * The concrete implementation of DistributedSystem that provides internal-only functionality.
    */
-
   protected InternalDistributedSystem system;
 
-
-
-  public Manager(ManagementResourceRepo repo, InternalDistributedSystem system, Cache cache) {
+  public Manager(ManagementResourceRepo repo, InternalDistributedSystem system,
+      InternalCache cache) {
     this.repo = repo;
-    this.cache = (GemFireCacheImpl) cache;
+    this.cache = cache;
     this.system = system;
   }
 
@@ -77,12 +63,8 @@ public abstract class Manager {
 
   /**
    * For internal use only
-   * 
    */
-
   public ManagementResourceRepo getManagementResourceRepo() {
     return repo;
   }
-
-
 }

http://git-wip-us.apache.org/repos/asf/geode/blob/bccdb56e/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java b/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
index 07e6e25..837e815 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/RestAgent.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.management.internal;
 
 import java.net.UnknownHostException;
@@ -29,9 +28,9 @@ import org.apache.geode.cache.RegionAttributes;
 import org.apache.geode.cache.Scope;
 import org.apache.geode.distributed.internal.DistributionConfig;
 import org.apache.geode.internal.GemFireVersion;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.net.SSLConfigurationFactory;
 import org.apache.geode.internal.net.SocketCreator;
-import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.internal.cache.InternalRegionArguments;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.security.SecurableCommunicationChannel;
@@ -60,15 +59,14 @@ public class RestAgent {
     return this.running;
   }
 
-  private boolean isManagementRestServiceRunning(GemFireCacheImpl cache) {
+  private boolean isManagementRestServiceRunning(InternalCache cache) {
     final SystemManagementService managementService =
         (SystemManagementService) ManagementService.getManagementService(cache);
     return (managementService.getManagementAgent() != null
         && managementService.getManagementAgent().isHttpServiceRunning());
-
   }
 
-  public synchronized void start(GemFireCacheImpl cache) {
+  public synchronized void start(InternalCache cache) {
     if (!this.running && this.config.getHttpServicePort() != 0
         && !isManagementRestServiceRunning(cache)) {
       try {
@@ -84,7 +82,6 @@ public class RestAgent {
         logger.debug(e.getMessage(), e);
       }
     }
-
   }
 
   public synchronized void stop() {
@@ -141,7 +138,7 @@ public class RestAgent {
         this.httpServer = JettyHelper.addWebApplication(httpServer, "/geode", gemfireAPIWar);
 
         if (logger.isDebugEnabled()) {
-          logger.info("Starting HTTP embedded server on port ({}) at bind-address ({})...",
+          logger.debug("Starting HTTP embedded server on port ({}) at bind-address ({})...",
               ((ServerConnector) this.httpServer.getConnectors()[0]).getPort(),
               httpServiceBindAddress);
         }
@@ -212,9 +209,8 @@ public class RestAgent {
       if (logger.isDebugEnabled()) {
         logger.debug("Starting creation of  __ParameterizedQueries__ region");
       }
-      GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+      InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
       if (cache != null) {
-        // cache.getCacheConfig().setPdxReadSerialized(true);
         final InternalRegionArguments regionArguments = new InternalRegionArguments();
         regionArguments.setIsUsedForMetaRegion(true);
         final AttributesFactory<String, String> attributesFactory =


Mime
View raw message