geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kl...@apache.org
Subject [31/90] [abbrv] incubator-geode git commit: GEODE-1377: Initial move of system properties from private to public
Date Wed, 08 Jun 2016 00:05:08 GMT
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStore.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStore.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStore.java
index 40821c2..3855adc 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStore.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionDataStore.java
@@ -16,50 +16,10 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.locks.Lock;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.InternalGemFireException;
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.AttributesMutator;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheListener;
-import com.gemstone.gemfire.cache.CacheLoader;
-import com.gemstone.gemfire.cache.CacheRuntimeException;
-import com.gemstone.gemfire.cache.CustomExpiry;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.EntryEvent;
-import com.gemstone.gemfire.cache.EntryExistsException;
-import com.gemstone.gemfire.cache.EntryNotFoundException;
-import com.gemstone.gemfire.cache.EvictionAttributes;
-import com.gemstone.gemfire.cache.ExpirationAction;
-import com.gemstone.gemfire.cache.ExpirationAttributes;
-import com.gemstone.gemfire.cache.InterestRegistrationEvent;
-import com.gemstone.gemfire.cache.PartitionAttributes;
-import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.Region.Entry;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.RegionDestroyedException;
-import com.gemstone.gemfire.cache.RegionEvent;
-import com.gemstone.gemfire.cache.RegionExistsException;
-import com.gemstone.gemfire.cache.Scope;
 import com.gemstone.gemfire.cache.execute.Function;
 import com.gemstone.gemfire.cache.execute.FunctionException;
 import com.gemstone.gemfire.cache.execute.ResultSender;
@@ -70,8 +30,10 @@ import com.gemstone.gemfire.cache.query.internal.index.IndexCreationData;
 import com.gemstone.gemfire.cache.query.internal.index.PartitionedIndex;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.DM;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.DistributionManager;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
+import com.gemstone.gemfire.i18n.StringId;
 import com.gemstone.gemfire.internal.Assert;
 import com.gemstone.gemfire.internal.cache.BucketRegion.RawValue;
 import com.gemstone.gemfire.internal.cache.LocalRegion.RegionPerfStats;
@@ -81,13 +43,7 @@ import com.gemstone.gemfire.internal.cache.execute.BucketMovedException;
 import com.gemstone.gemfire.internal.cache.execute.FunctionStats;
 import com.gemstone.gemfire.internal.cache.execute.PartitionedRegionFunctionResultSender;
 import com.gemstone.gemfire.internal.cache.execute.RegionFunctionContextImpl;
-import com.gemstone.gemfire.internal.cache.partitioned.Bucket;
-import com.gemstone.gemfire.internal.cache.partitioned.PRLocallyDestroyedException;
-import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionFunctionStreamingMessage;
-import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserver;
-import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionObserverHolder;
-import com.gemstone.gemfire.internal.cache.partitioned.RedundancyAlreadyMetException;
-import com.gemstone.gemfire.internal.cache.partitioned.RemoveBucketMessage;
+import com.gemstone.gemfire.internal.cache.partitioned.*;
 import com.gemstone.gemfire.internal.cache.partitioned.RemoveBucketMessage.RemoveBucketResponse;
 import com.gemstone.gemfire.internal.cache.persistence.BackupManager;
 import com.gemstone.gemfire.internal.cache.tier.sockets.ClientProxyMembershipID;
@@ -102,7 +58,16 @@ import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
 import com.gemstone.gemfire.internal.util.concurrent.StoppableReentrantReadWriteLock;
 import com.gemstone.gemfire.internal.util.concurrent.StoppableReentrantReadWriteLock.StoppableReadLock;
 import com.gemstone.gemfire.internal.util.concurrent.StoppableReentrantReadWriteLock.StoppableWriteLock;
-import com.gemstone.gemfire.i18n.StringId;
+import org.apache.logging.log4j.Logger;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.locks.Lock;
 
 /**
  * Implementation of DataStore (DS) for a PartitionedRegion (PR). This will be
@@ -177,7 +142,7 @@ public class PartitionedRegionDataStore implements HasCachePerfStats
    * Update an entry's last access time if a client is interested in the entry.
    */
   private static final boolean UPDATE_ACCESS_TIME_ON_INTEREST = Boolean
-      .getBoolean("gemfire.updateAccessTimeOnClientInterest");
+      .getBoolean(DistributionConfig.GEMFIRE_PREFIX + "updateAccessTimeOnClientInterest");
 
   
   //Only for testing
@@ -745,8 +710,8 @@ public class PartitionedRegionDataStore implements HasCachePerfStats
       factory.setCacheLoader(this.loader);
     }
     factory.setEnableAsyncConflation(true);
-    
-    if (Boolean.getBoolean("gemfire.PRDebug")) {
+
+    if (Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "PRDebug")) {
       factory.addCacheListener(createDebugBucketListener());
     }
     
@@ -806,7 +771,7 @@ public class PartitionedRegionDataStore implements HasCachePerfStats
     LocalRegion rootRegion = PartitionedRegionHelper.getPRRoot(this.partitionedRegion.getCache());
     BucketRegion bucketRegion = null;
 
-    if (Boolean.getBoolean("gemfire.PRDebug")) {
+    if (Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "PRDebug")) {
       logger.info(LocalizedMessage.create(
           LocalizedStrings.PartitionedRegionDataStore_CREATEBUCKETREGION_CREATING_BUCKETID_0_NAME_1,
           new Object[] {this.partitionedRegion.bucketStringForLogs(bucketId), bucketRegionName}));
@@ -853,7 +818,7 @@ public class PartitionedRegionDataStore implements HasCachePerfStats
     // Determine the size of the bucket (the Region in this case is mirrored,
     // get initial image has populated the bucket, compute the size of the
     // region)
-    if (Boolean.getBoolean("gemfire.PRDebug")) {
+    if (Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "PRDebug")) {
       dumpBuckets(); 
       dumpBucket(bucketId, bucketRegion);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHelper.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHelper.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHelper.java
index 6ce783a..8fe8f45 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHelper.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionHelper.java
@@ -17,35 +17,8 @@
 
 package com.gemstone.gemfire.internal.cache;
 
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.CancelException;
-import com.gemstone.gemfire.cache.AttributesFactory;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheWriterException;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.EntryDestroyedException;
-import com.gemstone.gemfire.cache.EntryEvent;
-import com.gemstone.gemfire.cache.EntryNotFoundException;
-import com.gemstone.gemfire.cache.EntryOperation;
-import com.gemstone.gemfire.cache.FixedPartitionAttributes;
-import com.gemstone.gemfire.cache.FixedPartitionResolver;
-import com.gemstone.gemfire.cache.Operation;
-import com.gemstone.gemfire.cache.PartitionResolver;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.RegionExistsException;
-import com.gemstone.gemfire.cache.Scope;
+import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.partition.PartitionNotAvailableException;
 import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
 import com.gemstone.gemfire.cache.util.CacheWriterAdapter;
@@ -53,6 +26,7 @@ import com.gemstone.gemfire.distributed.DistributedLockService;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.DistributedSystem;
 import com.gemstone.gemfire.distributed.internal.DM;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.distributed.internal.MembershipListener;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
@@ -63,6 +37,10 @@ import com.gemstone.gemfire.internal.cache.partitioned.RegionAdvisor;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.io.IOException;
+import java.util.*;
 
 /**
  */
@@ -99,7 +77,7 @@ public class PartitionedRegionHelper
    * modify shared meta-data and this property controls the delay before giving
    * up trying to acquire a global lock
    */
-  static final String VM_OWNERSHIP_WAIT_TIME_PROPERTY = "gemfire.VM_OWNERSHIP_WAIT_TIME";
+  static final String VM_OWNERSHIP_WAIT_TIME_PROPERTY = DistributionConfig.GEMFIRE_PREFIX + "VM_OWNERSHIP_WAIT_TIME";
 
   /** Wait forever for ownership */
   static final long VM_OWNERSHIP_WAIT_TIME_DEFAULT = Long.MAX_VALUE;
@@ -248,7 +226,7 @@ public class PartitionedRegionHelper
       factory.setScope(Scope.DISTRIBUTED_ACK);
       factory.setDataPolicy(DataPolicy.REPLICATE);
       factory.addCacheListener(new FixedPartitionAttributesListener());
-      if (Boolean.getBoolean("gemfire.PRDebug")) {
+      if (Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "PRDebug")) {
         factory.addCacheListener( new CacheListenerAdapter() {
           @Override
           public void afterCreate(EntryEvent event)
@@ -932,7 +910,7 @@ public class PartitionedRegionHelper
    * @param callingMethod methodName of the calling method.
    */
   public static void logForDataLoss(PartitionedRegion partitionedRegion, int bucketId, String callingMethod) {
-    if (! Boolean.getBoolean("gemfire.PRDebug")) {
+    if (!Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "PRDebug")) {
       return;
     }
     Region root = PartitionedRegionHelper.getPRRoot(partitionedRegion.getCache());

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryEvaluator.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryEvaluator.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryEvaluator.java
index 5ca17a8..987d8a0 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryEvaluator.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegionQueryEvaluator.java
@@ -16,60 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
-import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.CopyHelper;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.query.QueryException;
-import com.gemstone.gemfire.cache.query.QueryExecutionLowMemoryException;
-import com.gemstone.gemfire.cache.query.QueryInvocationTargetException;
-import com.gemstone.gemfire.cache.query.SelectResults;
-import com.gemstone.gemfire.cache.query.Struct;
-import com.gemstone.gemfire.cache.query.internal.CompiledGroupBySelect;
-import com.gemstone.gemfire.cache.query.internal.CompiledSelect;
-import com.gemstone.gemfire.cache.query.internal.CompiledSortCriterion;
-import com.gemstone.gemfire.cache.query.internal.CompiledValue;
-import com.gemstone.gemfire.cache.query.internal.CumulativeNonDistinctResults;
-import com.gemstone.gemfire.cache.query.internal.DefaultQuery;
-import com.gemstone.gemfire.cache.query.internal.DefaultQueryService;
-import com.gemstone.gemfire.cache.query.internal.ExecutionContext;
+import com.gemstone.gemfire.cache.query.*;
+import com.gemstone.gemfire.cache.query.internal.*;
 import com.gemstone.gemfire.cache.query.internal.IndexTrackingQueryObserver.IndexInfo;
-import com.gemstone.gemfire.cache.query.internal.NWayMergeResults;
-import com.gemstone.gemfire.cache.query.internal.OrderByComparator;
-import com.gemstone.gemfire.cache.query.internal.PRQueryTraceInfo;
-import com.gemstone.gemfire.cache.query.internal.QueryExecutionContext;
-import com.gemstone.gemfire.cache.query.internal.QueryMonitor;
-import com.gemstone.gemfire.cache.query.internal.ResultsSet;
-import com.gemstone.gemfire.cache.query.internal.SortedResultsBag;
-import com.gemstone.gemfire.cache.query.internal.SortedStructBag;
-import com.gemstone.gemfire.cache.query.internal.StructSet;
 import com.gemstone.gemfire.cache.query.internal.utils.PDXUtils;
 import com.gemstone.gemfire.cache.query.types.ObjectType;
 import com.gemstone.gemfire.cache.query.types.StructType;
 import com.gemstone.gemfire.distributed.DistributedMember;
-import com.gemstone.gemfire.distributed.internal.DistributionMessage;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.ReplyException;
-import com.gemstone.gemfire.distributed.internal.ReplyProcessor21;
+import com.gemstone.gemfire.distributed.internal.*;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.Assert;
 import com.gemstone.gemfire.internal.NanoTimer;
@@ -78,6 +34,12 @@ import com.gemstone.gemfire.internal.cache.partitioned.QueryMessage;
 import com.gemstone.gemfire.internal.cache.partitioned.StreamingPartitionOperation;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
+import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+import org.apache.logging.log4j.Logger;
+
+import java.util.*;
+import java.util.concurrent.*;
 
 /**
  * This class sends the query on various <code>PartitionedRegion</code> data
@@ -113,7 +75,8 @@ public class PartitionedRegionQueryEvaluator extends StreamingPartitionOperation
   public interface TestHook {
     public void hook(final int spot) throws RuntimeException;
   }
-  private static final int MAX_PR_QUERY_RETRIES = Integer.getInteger("gemfire.MAX_PR_QUERY_RETRIES", 10).intValue();
+
+  private static final int MAX_PR_QUERY_RETRIES = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "MAX_PR_QUERY_RETRIES", 10).intValue();
 
   private final PartitionedRegion pr;
   private volatile Map<InternalDistributedMember,List<Integer>> node2bucketIds;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
index 102d0ef..1b6ce7a 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolFactoryImpl.java
@@ -16,20 +16,6 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.DataSerializable;
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.CacheException;
@@ -40,12 +26,22 @@ import com.gemstone.gemfire.cache.client.internal.LocatorDiscoveryCallback;
 import com.gemstone.gemfire.cache.client.internal.PoolImpl;
 import com.gemstone.gemfire.cache.query.QueryService;
 import com.gemstone.gemfire.cache.wan.GatewaySender;
-import com.gemstone.gemfire.distributed.internal.DistributionConfig;
-import com.gemstone.gemfire.internal.admin.remote.DistributionLocatorId;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
 import com.gemstone.gemfire.pdx.internal.TypeRegistry;
+import org.apache.logging.log4j.Logger;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
 
 /**
  * Implementation of PoolFactory.

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolStats.java
index 6a6ae3b..c59d098 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolStats.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/PoolStats.java
@@ -16,14 +16,12 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import com.gemstone.gemfire.StatisticDescriptor;
-import com.gemstone.gemfire.Statistics;
-import com.gemstone.gemfire.StatisticsFactory;
-import com.gemstone.gemfire.StatisticsType;
-import com.gemstone.gemfire.StatisticsTypeFactory;
+import com.gemstone.gemfire.*;
 import com.gemstone.gemfire.distributed.internal.DistributionStats;
 import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
 
+import static com.gemstone.gemfire.distributed.SystemConfigurationProperties.LOCATORS;
+
 /**
  * GemFire statistics about a Pool 
  *
@@ -37,7 +35,7 @@ public class PoolStats {
   ////////////////////  Statistic "Id" Fields  ////////////////////
 
   private static final String INITIAL_CONTACTS = "initialContactCount"; // gauge
-  private static final String KNOWN_LOCATORS = "locators"; // gauge
+  private static final String KNOWN_LOCATORS = LOCATORS; // gauge
   private static final String REQUESTS_TO_LOCATOR = "locatorRequests"; // counter
   private static final String RESPONSES_FROM_LOCATOR = "locatorResponses"; // counter
   private static final String ENDPOINTS_KNOWN = "servers"; // gauge
@@ -83,7 +81,7 @@ public class PoolStats {
     _type = f.createType(statName, statName,
        new StatisticDescriptor[] {
             f.createIntGauge(INITIAL_CONTACTS, "Number of contacts initially by user", "contacts"),
-            f.createIntGauge(KNOWN_LOCATORS, "Current number of locators discovered", "locators"),
+           f.createIntGauge(KNOWN_LOCATORS, "Current number of locators discovered", LOCATORS),
             f.createIntGauge(ENDPOINTS_KNOWN, "Current number of servers discovered", "servers"),
             f.createIntGauge(SUBSCRIPTION_SERVERS, "Number of servers hosting this clients subscriptions", "servers"),
             f.createLongCounter(REQUESTS_TO_LOCATOR, "Number of requests from this connection pool to a locator", "requests"),

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionEvictorTask.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionEvictorTask.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionEvictorTask.java
index 2c0115e..e47ae91 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionEvictorTask.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/RegionEvictorTask.java
@@ -16,17 +16,17 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.Callable;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.cache.RegionDestroyedException;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.lru.HeapEvictor;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Callable;
 
 /**
  * 
@@ -46,7 +46,7 @@ public class RegionEvictorTask implements Callable<Object> {
 
   static {
     EVICTION_BURST_PAUSE_TIME_MILLIS = Integer.getInteger(
-        "gemfire.evictionBurstPauseTimeMillis", 1000);
+        DistributionConfig.GEMFIRE_PREFIX + "evictionBurstPauseTimeMillis", 1000);
   }
 
   private static volatile long lastTaskCompletionTime = 0;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java
index 6642ec6..bd19104 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/SearchLoadAndWriteProcessor.java
@@ -18,53 +18,12 @@
 package com.gemstone.gemfire.internal.cache;
 
 /* enumerate each imported class because conflict with dl.u.c.TimeoutException */
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.NotSerializableException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Lock;
-
-import org.apache.logging.log4j.Logger;
 
-import com.gemstone.gemfire.CancelCriterion;
-import com.gemstone.gemfire.CancelException;
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.GemFireException;
-import com.gemstone.gemfire.InternalGemFireException;
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.CacheEvent;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.CacheLoader;
-import com.gemstone.gemfire.cache.CacheLoaderException;
-import com.gemstone.gemfire.cache.CacheWriter;
-import com.gemstone.gemfire.cache.CacheWriterException;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.EntryEvent;
-import com.gemstone.gemfire.cache.LoaderHelper;
-import com.gemstone.gemfire.cache.Operation;
-import com.gemstone.gemfire.cache.RegionAttributes;
-import com.gemstone.gemfire.cache.RegionDestroyedException;
-import com.gemstone.gemfire.cache.RegionEvent;
-import com.gemstone.gemfire.cache.Scope;
-import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.cache.util.ObjectSizer;
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
-import com.gemstone.gemfire.distributed.internal.DM;
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.HighPriorityDistributionMessage;
-import com.gemstone.gemfire.distributed.internal.MembershipListener;
-import com.gemstone.gemfire.distributed.internal.PooledDistributionMessage;
-import com.gemstone.gemfire.distributed.internal.ProcessorKeeper21;
-import com.gemstone.gemfire.distributed.internal.ReplyProcessor21;
-import com.gemstone.gemfire.distributed.internal.SerialDistributionMessage;
+import com.gemstone.gemfire.distributed.internal.*;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.Assert;
 import com.gemstone.gemfire.internal.InternalDataSerializer;
@@ -76,6 +35,16 @@ import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
 import com.gemstone.gemfire.internal.offheap.annotations.Released;
 import com.gemstone.gemfire.internal.offheap.annotations.Retained;
+import org.apache.logging.log4j.Logger;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.util.*;
+import java.util.concurrent.RejectedExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
 
 
 /**
@@ -97,7 +66,7 @@ public class SearchLoadAndWriteProcessor implements MembershipListener {
   public static final int SMALL_BLOB_SIZE =
      Integer.getInteger("DistributionManager.OptimizedUpdateByteLimit", 2000).intValue();
 
-  static final long RETRY_TIME = Long.getLong("gemfire.search-retry-interval", 2000).longValue();
+  static final long RETRY_TIME = Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "search-retry-interval", 2000).longValue();
 
 
   private InternalDistributedMember selectedNode;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXEntryState.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXEntryState.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXEntryState.java
index ccc2fc4..f392f04 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXEntryState.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXEntryState.java
@@ -17,36 +17,14 @@
 
 package com.gemstone.gemfire.internal.cache;
 
-import static com.gemstone.gemfire.internal.offheap.annotations.OffHeapIdentifier.TX_ENTRY_STATE;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.cache.CacheRuntimeException;
-import com.gemstone.gemfire.cache.CacheWriter;
-import com.gemstone.gemfire.cache.CacheWriterException;
-import com.gemstone.gemfire.cache.CommitConflictException;
-import com.gemstone.gemfire.cache.DataPolicy;
-import com.gemstone.gemfire.cache.EntryDestroyedException;
-import com.gemstone.gemfire.cache.EntryEvent;
-import com.gemstone.gemfire.cache.EntryNotFoundException;
-import com.gemstone.gemfire.cache.Operation;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionDestroyedException;
-import com.gemstone.gemfire.cache.TimeoutException;
+import com.gemstone.gemfire.cache.*;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.Assert;
 import com.gemstone.gemfire.internal.DataSerializableFixedID;
 import com.gemstone.gemfire.internal.Version;
 import com.gemstone.gemfire.internal.cache.delta.Delta;
-import com.gemstone.gemfire.internal.cache.versions.RegionVersionVector;
 import com.gemstone.gemfire.internal.cache.versions.VersionTag;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.lang.StringUtils;
@@ -58,6 +36,16 @@ import com.gemstone.gemfire.internal.offheap.annotations.Released;
 import com.gemstone.gemfire.internal.offheap.annotations.Retained;
 import com.gemstone.gemfire.internal.offheap.annotations.Unretained;
 import com.gemstone.gemfire.pdx.PdxSerializationException;
+import org.apache.logging.log4j.Logger;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import static com.gemstone.gemfire.internal.offheap.annotations.OffHeapIdentifier.TX_ENTRY_STATE;
 
 /**
  * TXEntryState is the entity that tracks transactional changes, except for
@@ -188,7 +176,7 @@ public class TXEntryState implements Releasable
    * Benefits of read conflict detection are at:
    * https://wiki.gemstone.com/display/PR/Read+conflict+detection
    */
-  private static final boolean DETECT_READ_CONFLICTS = Boolean.getBoolean("gemfire.detectReadConflicts");
+  private static final boolean DETECT_READ_CONFLICTS = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "detectReadConflicts");
 
   // @todo darrel: optimize footprint by having this field on a subclass
   //      that is only created by TXRegionState when it knows its region needs refCounts.
@@ -246,7 +234,7 @@ public class TXEntryState implements Releasable
   /**
    * Use this system property if you need to display/log string values in conflict messages
    */
-  private static final boolean VERBOSE_CONFLICT_STRING = Boolean.getBoolean("gemfire.verboseConflictString");
+  private static final boolean VERBOSE_CONFLICT_STRING = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "verboseConflictString");
 
   /**
    * This constructor is used to create a singleton used by LocalRegion to

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
index 49926e6..df0176d 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TXManagerImpl.java
@@ -17,50 +17,13 @@
 
 package com.gemstone.gemfire.internal.cache;
 
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Queue;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
-import java.util.concurrent.locks.LockSupport;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.GemFireException;
 import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.CacheTransactionManager;
-import com.gemstone.gemfire.cache.CommitConflictException;
-import com.gemstone.gemfire.cache.TransactionDataRebalancedException;
-import com.gemstone.gemfire.cache.TransactionId;
-import com.gemstone.gemfire.cache.TransactionInDoubtException;
-import com.gemstone.gemfire.cache.TransactionListener;
-import com.gemstone.gemfire.cache.TransactionWriter;
-import com.gemstone.gemfire.cache.UnsupportedOperationInTransactionException;
+import com.gemstone.gemfire.cache.*;
 import com.gemstone.gemfire.distributed.TXManagerCancelledException;
-import com.gemstone.gemfire.distributed.internal.DM;
-import com.gemstone.gemfire.distributed.internal.DistributionManager;
-import com.gemstone.gemfire.distributed.internal.HighPriorityDistributionMessage;
-import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
-import com.gemstone.gemfire.distributed.internal.MembershipListener;
+import com.gemstone.gemfire.distributed.internal.*;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.SystemTimer.SystemTimerTask;
 import com.gemstone.gemfire.internal.cache.tier.sockets.Message;
@@ -70,6 +33,20 @@ import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
 import com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap;
 import com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap.HashEntry;
 import com.gemstone.gemfire.internal.util.concurrent.CustomEntryConcurrentHashMap.MapCallback;
+import org.apache.logging.log4j.Logger;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.*;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
+import java.util.concurrent.locks.LockSupport;
 
 /** <p>The internal implementation of the {@link CacheTransactionManager}
  * interface returned by {@link GemFireCacheImpl#getCacheTransactionManager}.
@@ -120,7 +97,7 @@ public class TXManagerImpl implements CacheTransactionManager,
   /**
    * the number of client initiated transactions to store for client failover
    */
-  public final static int FAILOVER_TX_MAP_SIZE = Integer.getInteger("gemfire.transactionFailoverMapSize", 1000);
+  public final static int FAILOVER_TX_MAP_SIZE = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "transactionFailoverMapSize", 1000);
   
   /**
    * used to store TXCommitMessages for client initiated transactions, so that when a client failsover,
@@ -142,7 +119,7 @@ public class TXManagerImpl implements CacheTransactionManager,
   /**
    * A flag to allow persistent transactions. public for testing.
    */
-  public static boolean ALLOW_PERSISTENT_TRANSACTIONS = Boolean.getBoolean("gemfire.ALLOW_PERSISTENT_TRANSACTIONS");
+  public static boolean ALLOW_PERSISTENT_TRANSACTIONS = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "ALLOW_PERSISTENT_TRANSACTIONS");
 
   /**
    * this keeps track of all the transactions that were initiated locally.
@@ -152,7 +129,7 @@ public class TXManagerImpl implements CacheTransactionManager,
   /**
    * the time in minutes after which any suspended transaction are rolled back. default is 30 minutes
    */
-  private volatile long suspendedTXTimeout = Long.getLong("gemfire.suspendedTxTimeout", 30);
+  private volatile long suspendedTXTimeout = Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "suspendedTxTimeout", 30);
   
   /**
    * Thread-specific flag to indicate whether the transactions managed by this

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
index 44c5d58..7036d45 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/TombstoneService.java
@@ -16,37 +16,29 @@
  */
 package com.gemstone.gemfire.internal.cache;
 
-import java.util.ConcurrentModificationException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Queue;
-import java.util.Set;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.logging.log4j.Logger;
-
-import com.gemstone.gemfire.CancelException;
-import com.gemstone.gemfire.SystemFailure;
-import com.gemstone.gemfire.cache.util.ObjectSizer;
-import com.gemstone.gemfire.internal.GemFireVersion;
-import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
-import com.gemstone.gemfire.internal.cache.control.ResourceListener;
-import com.gemstone.gemfire.internal.cache.versions.CompactVersionHolder;
-import com.gemstone.gemfire.internal.cache.versions.VersionSource;
-import com.gemstone.gemfire.internal.cache.versions.VersionTag;
-import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
-import com.gemstone.gemfire.internal.logging.LogService;
-import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
-import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
-import com.gemstone.gemfire.internal.logging.log4j.LogMarker;
-import com.gemstone.gemfire.internal.size.ReflectionSingleObjectSizer;
-import com.gemstone.gemfire.internal.util.concurrent.StoppableReentrantLock;
+import com.gemstone.gemfire.CancelException;
+import com.gemstone.gemfire.SystemFailure;
+import com.gemstone.gemfire.cache.util.ObjectSizer;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
+import com.gemstone.gemfire.internal.cache.control.MemoryEvent;
+import com.gemstone.gemfire.internal.cache.control.ResourceListener;
+import com.gemstone.gemfire.internal.cache.versions.CompactVersionHolder;
+import com.gemstone.gemfire.internal.cache.versions.VersionSource;
+import com.gemstone.gemfire.internal.cache.versions.VersionTag;
+import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
+import com.gemstone.gemfire.internal.logging.LogService;
+import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
+import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import com.gemstone.gemfire.internal.logging.log4j.LogMarker;
+import com.gemstone.gemfire.internal.size.ReflectionSingleObjectSizer;
+import com.gemstone.gemfire.internal.util.concurrent.StoppableReentrantLock;
+import org.apache.logging.log4j.Logger;
+
+import java.util.*;
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * Tombstones are region entries that have been destroyed but are held
@@ -58,8 +50,8 @@ import com.gemstone.gemfire.internal.util.concurrent.StoppableReentrantLock;
  * and timing out tombstones.
  * 
  */
-public class TombstoneService  implements ResourceListener<MemoryEvent> {
-  private static final Logger logger = LogService.getLogger();
+public class TombstoneService  implements ResourceListener<MemoryEvent> {
+  private static final Logger logger = LogService.getLogger();
   
   /**
    * The default tombstone expiration period, in milliseconds for replicated
@@ -71,7 +63,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
    * The default is 600,000 milliseconds (10 minutes).
    */
   public static long REPLICATED_TOMBSTONE_TIMEOUT = Long.getLong(
-      "gemfire.tombstone-timeout", 600000L).longValue();
+      DistributionConfig.GEMFIRE_PREFIX + "tombstone-timeout", 600000L).longValue();
   
   /**
    * The default tombstone expiration period in millis for non-replicated
@@ -83,33 +75,34 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
    * The default is 480,000 milliseconds (8 minutes)
    */
   public static long CLIENT_TOMBSTONE_TIMEOUT = Long.getLong(
-      "gemfire.non-replicated-tombstone-timeout", 480000);
+      DistributionConfig.GEMFIRE_PREFIX + "non-replicated-tombstone-timeout", 480000);
   
   /**
    * The max number of tombstones in an expired batch.  This covers
    * all replicated regions, including PR buckets.  The default is
    * 100,000 expired tombstones.
    */
-  public static long EXPIRED_TOMBSTONE_LIMIT = Long.getLong("gemfire.tombstone-gc-threshold", 100000);
+  public static long EXPIRED_TOMBSTONE_LIMIT = Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "tombstone-gc-threshold", 100000);
   
   /**
    * The interval to scan for expired tombstones in the queues
    */
-  public static long DEFUNCT_TOMBSTONE_SCAN_INTERVAL = Long.getLong("gemfire.tombstone-scan-interval", 60000);
+  public static long DEFUNCT_TOMBSTONE_SCAN_INTERVAL = Long.getLong(DistributionConfig.GEMFIRE_PREFIX + "tombstone-scan-interval", 60000);
   
   /**
    * The threshold percentage of free max memory that will trigger tombstone GCs.
    * The default percentage is somewhat less than the LRU Heap evictor so that
    * we evict tombstones before we start evicting cache data.
    */
-  public static double GC_MEMORY_THRESHOLD = Integer.getInteger("gemfire.tombstone-gc-memory-threshold",
+  public static double GC_MEMORY_THRESHOLD = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "tombstone-gc-memory-threshold",
       30 /*100-HeapLRUCapacityController.DEFAULT_HEAP_PERCENTAGE*/) * 0.01;
   
   /** this is a test hook for causing the tombstone service to act as though free memory is low */
   public static boolean FORCE_GC_MEMORY_EVENTS = false;
 
   public final static Object debugSync = new Object();
-  public final static boolean DEBUG_TOMBSTONE_COUNT = Boolean.getBoolean("gemfire.TombstoneService.DEBUG_TOMBSTONE_COUNT"); // TODO:LOG:replace TombstoneService.DEBUG_TOMBSTONE_COUNT 
+  public final static boolean DEBUG_TOMBSTONE_COUNT = Boolean
+      .getBoolean(DistributionConfig.GEMFIRE_PREFIX + "TombstoneService.DEBUG_TOMBSTONE_COUNT"); // TODO:LOG:replace TombstoneService.DEBUG_TOMBSTONE_COUNT
 
   public static boolean IDLE_EXPIRATION = false; // dunit test hook for forced batch expiration
   
@@ -274,8 +267,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
       int count = getGCBlockCount(); 
       if (count > 0) {
         // if any delta GII is on going as provider at this member, not to do tombstone GC
-        if (logger.isDebugEnabled()) {
-          logger.debug("gcTombstones skipped due to {} Delta GII on going", count);
+        if (logger.isDebugEnabled()) {
+          logger.debug("gcTombstones skipped due to {} Delta GII on going", count);
         }
         return null;
       }
@@ -285,8 +278,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
     Tombstone currentTombstone;
     StoppableReentrantLock lock = null;
     boolean locked = false;
-    if (logger.isDebugEnabled()) {
-      logger.debug("gcTombstones invoked for region {} and version map {}", r, regionGCVersions);
+    if (logger.isDebugEnabled()) {
+      logger.debug("gcTombstones invoked for region {} and version map {}", r, regionGCVersions);
     }
     Set<Tombstone> removals = new HashSet<Tombstone>();
     VersionSource myId = r.getVersionMember();
@@ -308,23 +301,23 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
         currentTombstone = this.replicatedTombstoneSweeper.currentTombstone;
       }
       if (currentTombstone != null && currentTombstone.region == r) {
-        VersionSource destroyingMember = currentTombstone.getMemberID();
+        VersionSource destroyingMember = currentTombstone.getMemberID();
         if (destroyingMember == null) {
           destroyingMember = myId;
         }
         Long maxReclaimedRV = regionGCVersions.get(destroyingMember);
-        if (maxReclaimedRV != null && currentTombstone.getRegionVersion() <= maxReclaimedRV.longValue()) {
+        if (maxReclaimedRV != null && currentTombstone.getRegionVersion() <= maxReclaimedRV.longValue()) {
           removals.add(currentTombstone);
         }
       }
       for (Tombstone t: queue) {
         if (t.region == r) {
-          VersionSource destroyingMember = t.getMemberID();
+          VersionSource destroyingMember = t.getMemberID();
           if (destroyingMember == null) {
             destroyingMember = myId;
           }
           Long maxReclaimedRV = regionGCVersions.get(destroyingMember);
-          if (maxReclaimedRV != null && t.getRegionVersion() <= maxReclaimedRV.longValue()) {
+          if (maxReclaimedRV != null && t.getRegionVersion() <= maxReclaimedRV.longValue()) {
             removals.add(t);
             removalSize += t.getSize();
           }
@@ -362,7 +355,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
     
     Set<Object> removedKeys = new HashSet();
     for (Tombstone t: removals) {
-      if (t.region.getRegionMap().removeTombstone(t.entry, t, false, true) && isBucket) {
+      if (t.region.getRegionMap().removeTombstone(t.entry, t, false, true) && isBucket) {
         removedKeys.add(t.entry.getKey());
       }
     }
@@ -388,11 +381,11 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
       Tombstone currentTombstone = this.nonReplicatedTombstoneSweeper.currentTombstone;
       long removalSize = 0;
       VersionSource myId = r.getVersionMember();
-      if (logger.isDebugEnabled()) {
-        logger.debug("gcTombstones invoked for region {} and keys {}", r, tombstoneKeys);
+      if (logger.isDebugEnabled()) {
+        logger.debug("gcTombstones invoked for region {} and keys {}", r, tombstoneKeys);
       }
       if (currentTombstone != null && currentTombstone.region == r) {
-        VersionSource destroyingMember = currentTombstone.getMemberID();
+        VersionSource destroyingMember = currentTombstone.getMemberID();
         if (destroyingMember == null) {
           destroyingMember = myId;
         }
@@ -402,7 +395,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
       }
       for (Tombstone t: queue) {
         if (t.region == r) {
-          VersionSource destroyingMember = t.getMemberID();
+          VersionSource destroyingMember = t.getMemberID();
           if (destroyingMember == null) {
             destroyingMember = myId;
           }
@@ -424,7 +417,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
       //TODO - RVV - to support persistent client regions
       //we need to actually record this as a destroy on disk, because
       //the GCC RVV doesn't make sense on the client.
-      t.region.getRegionMap().removeTombstone(t.entry, t, false, true);
+      t.region.getRegionMap().removeTombstone(t.entry, t, false, true);
     }
   }
   
@@ -466,13 +459,13 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
     int entryVersion = entryTag.getEntryVersion();
     for (Tombstone t: queue) {
       if (t.region == r) {
-        VersionSource destroyingMember = t.getMemberID();
+        VersionSource destroyingMember = t.getMemberID();
         if (destroyingMember == null) {
           destroyingMember = myId;
         }
         if (t.region == r
             && t.entry.getKey().equals(re.getKey())
-            && t.getEntryVersion() == entryVersion) {
+            && t.getEntryVersion() == entryVersion) {
           return true;
         }
       }
@@ -490,19 +483,19 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
     + (this.replicatedTombstoneSweeper.expiredTombstones != null?
         " expired batch size = " + this.replicatedTombstoneSweeper.expiredTombstones.size() : "");
   }  
-  private static class Tombstone extends CompactVersionHolder {
-    // tombstone overhead size
+  private static class Tombstone extends CompactVersionHolder {
+    // tombstone overhead size
     public static int PER_TOMBSTONE_OVERHEAD = ReflectionSingleObjectSizer.REFERENCE_SIZE // queue's reference to the tombstone
-      + ReflectionSingleObjectSizer.REFERENCE_SIZE * 3 // entry, region, member ID
-      + ReflectionSingleObjectSizer.REFERENCE_SIZE  // region entry value (Token.TOMBSTONE)
-      + 18; // version numbers and timestamp
+      + ReflectionSingleObjectSizer.REFERENCE_SIZE * 3 // entry, region, member ID
+      + ReflectionSingleObjectSizer.REFERENCE_SIZE  // region entry value (Token.TOMBSTONE)
+      + 18; // version numbers and timestamp
     
     
     RegionEntry entry;
     LocalRegion region;
-    
+    
     Tombstone(RegionEntry entry, LocalRegion region, VersionTag destroyedVersion) {
-      super(destroyedVersion);
+      super(destroyedVersion);
       this.entry = entry;
       this.region = region;
     }
@@ -514,10 +507,10 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
     
     @Override
     public String toString() {
-      String v = super.toString();
+      String v = super.toString();
       StringBuilder sb = new StringBuilder();
       sb.append("(").append(entry.getKey()).append("; ")
-        .append(region.getName()).append("; ").append(v)
+        .append(region.getName()).append("; ").append(v)
         .append(")");
       return sb.toString();
     }
@@ -652,7 +645,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
           for (Tombstone t: this.expiredTombstones) {
             if (t.region == r
                 && t.entry.getKey().equals(re.getKey())
-                && t.getEntryVersion() == entryVersion) {
+                && t.getEntryVersion() == entryVersion) {
               return true;
             }
           }
@@ -677,8 +670,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
         int count = cache.getTombstoneService().getGCBlockCount();
         if (count > 0) {
           // if any delta GII is on going as provider at this member, not to do tombstone GC
-          if (logger.isDebugEnabled()) {
-            logger.debug("expireBatch skipped due to {} Delta GII on going", count);
+          if (logger.isDebugEnabled()) {
+            logger.debug("expireBatch skipped due to {} Delta GII on going", count);
           }
           return;
         }
@@ -698,7 +691,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
         //We need to do this so that we can persist the GC RVV before
         //we start removing entries from the map.
         for (Tombstone t: expired) {
-          t.region.getVersionVector().recordGCVersion(t.getMemberID(), t.getRegionVersion());
+          t.region.getVersionVector().recordGCVersion(t.getMemberID(), t.getRegionVersion());
           regionsAffected.add((DistributedRegion)t.region);
         }
         
@@ -721,7 +714,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
         for (Tombstone t: expired) {
           // for PR buckets we have to keep track of the keys removed because clients have
           // them all lumped in a single non-PR region
-          if (t.region.getRegionMap().removeTombstone(t.entry, t, false, true) && t.region.isUsedForPartitionedRegionBucket()) {
+          if (t.region.getRegionMap().removeTombstone(t.entry, t, false, true) && t.region.isUsedForPartitionedRegionBucket()) {
             Set<Object> keys = reapedKeys.get(t.region);
             if (keys == null) {
               keys = new HashSet<Object>();
@@ -769,8 +762,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
     public void run() {
       long minimumRetentionMs = this.expiryTime / 10; // forceExpiration will not work on something younger than this
       long maximumSleepTime = 10000;
-      if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-        logger.trace(LogMarker.TOMBSTONE, "Destroyed entries sweeper starting with default sleep interval={}", this.expiryTime);
+      if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+        logger.trace(LogMarker.TOMBSTONE, "Destroyed entries sweeper starting with default sleep interval={}", this.expiryTime);
       }
       currentTombstone = null;
       // millis we need to run a scan of queue and batch set for resurrected tombstones
@@ -807,8 +800,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
                 forceBatchExpiration = !this.batchExpirationInProgress &&
                        this.expiredTombstones.size() > (EXPIRED_TOMBSTONE_LIMIT / 4);
                 if (forceBatchExpiration) {
-                  if (logger.isDebugEnabled()) {
-                    logger.debug("forcing batch expiration due to low memory conditions");
+                  if (logger.isDebugEnabled()) {
+                    logger.debug("forcing batch expiration due to low memory conditions");
                   }
                 }
                 // forcing expiration of tombstones that have not timed out can cause inconsistencies
@@ -830,13 +823,13 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
               } finally {
                 currentTombstoneLock.unlock();
               }
-              if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                logger.trace(LogMarker.TOMBSTONE, "current tombstone is {}", currentTombstone);
+              if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                logger.trace(LogMarker.TOMBSTONE, "current tombstone is {}", currentTombstone);
               }
             } catch (NoSuchElementException e) {
               // expected
-              if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                logger.trace(LogMarker.TOMBSTONE, "queue is empty - will sleep");
+              if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                logger.trace(LogMarker.TOMBSTONE, "queue is empty - will sleep");
               }
               forceExpirationCount = 0;
             }
@@ -844,8 +837,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
           long sleepTime;
           if (currentTombstone == null) {
             sleepTime = expiryTime;
-          } else if (currentTombstone.getVersionTimeStamp()+expiryTime > now && (forceExpirationCount <= 0 || (currentTombstone.getVersionTimeStamp() + expiryTime - now) <= minimumRetentionMs)) {
-            sleepTime = currentTombstone.getVersionTimeStamp()+expiryTime - now;
+          } else if (currentTombstone.getVersionTimeStamp()+expiryTime > now && (forceExpirationCount <= 0 || (currentTombstone.getVersionTimeStamp() + expiryTime - now) <= minimumRetentionMs)) {
+            sleepTime = currentTombstone.getVersionTimeStamp()+expiryTime - now;
           } else {
             if (forceExpirationCount > 0) {
               forceExpirationCount--;
@@ -853,16 +846,16 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
             sleepTime = 0;
             try {
               if (batchMode) {
-                if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                  logger.trace(LogMarker.TOMBSTONE, "expiring tombstone {}", currentTombstone);
+                if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                  logger.trace(LogMarker.TOMBSTONE, "expiring tombstone {}", currentTombstone);
                 }
                 expiredTombstones.add(currentTombstone);
               } else {
-                if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                  logger.trace(LogMarker.TOMBSTONE, "removing expired tombstone {}", currentTombstone);
+                if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                  logger.trace(LogMarker.TOMBSTONE, "removing expired tombstone {}", currentTombstone);
                 }
                 queueSize.addAndGet(-currentTombstone.getSize());
-                currentTombstone.region.getRegionMap().removeTombstone(currentTombstone.entry, currentTombstone, false, true);
+                currentTombstone.region.getRegionMap().removeTombstone(currentTombstone.entry, currentTombstone, false, true);
               }
               currentTombstoneLock.lock();
               try {
@@ -893,7 +886,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
               for (Iterator<Tombstone> it = tombstones.iterator(); it.hasNext(); ) {
                 Tombstone test = it.next();
                 if (it.hasNext()) {
-                  if (test.region.getRegionMap().isTombstoneNotNeeded(test.entry, test.getEntryVersion())) {
+                  if (test.region.getRegionMap().isTombstoneNotNeeded(test.entry, test.getEntryVersion())) {
                     it.remove();
                     this.queueSize.addAndGet(-test.getSize());
                     if (test == currentTombstone) {
@@ -905,11 +898,11 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
                       }
                       sleepTime = 0;
                     }
-                  } else if (batchMode && test != currentTombstone && (test.getVersionTimeStamp()+expiryTime) <= now) {
+                  } else if (batchMode && test != currentTombstone && (test.getVersionTimeStamp()+expiryTime) <= now) {
                     it.remove();
                     this.queueSize.addAndGet(-test.getSize());
-                    if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                      logger.trace(LogMarker.TOMBSTONE, "expiring tombstone {}", currentTombstone);
+                    if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                      logger.trace(LogMarker.TOMBSTONE, "expiring tombstone {}", currentTombstone);
                     }
                     expiredTombstones.add(test);
                     sleepTime = 0;
@@ -920,9 +913,9 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
               if (batchMode) {
                 for (Iterator<Tombstone> it = expiredTombstones.iterator(); it.hasNext(); ) {
                   Tombstone test = it.next();
-                  if (test.region.getRegionMap().isTombstoneNotNeeded(test.entry, test.getEntryVersion())) {
-                    if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                      logger.trace(LogMarker.TOMBSTONE, "removing obsolete tombstone: {}", test);
+                  if (test.region.getRegionMap().isTombstoneNotNeeded(test.entry, test.getEntryVersion())) {
+                    if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                      logger.trace(LogMarker.TOMBSTONE, "removing obsolete tombstone: {}", test);
                     }
                     it.remove();
                     this.queueSize.addAndGet(-test.getSize());
@@ -957,8 +950,8 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
             if (sleepTime > 0) {
               try {
                 sleepTime = Math.min(sleepTime, maximumSleepTime);
-                if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
-                  logger.trace(LogMarker.TOMBSTONE, "sleeping for {}", sleepTime);
+                if (logger.isTraceEnabled(LogMarker.TOMBSTONE)) {
+                  logger.trace(LogMarker.TOMBSTONE, "sleeping for {}", sleepTime);
                 }
                 synchronized(this) {
                   if(isStopped) {
@@ -996,7 +989,7 @@ public class TombstoneService  implements ResourceListener<MemoryEvent> {
   @Override
   public void onEvent(MemoryEvent event) {
     if (event.isLocal()) {
-      if (event.getState().isEviction() && !event.getPreviousState().isEviction()) {
+      if (event.getState().isEviction() && !event.getPreviousState().isEviction()) {
         this.replicatedTombstoneSweeper.forceBatchExpiration();
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
index 3de03e2..90a26cb 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/HeapMemoryMonitor.java
@@ -16,29 +16,11 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import java.lang.management.ManagementFactory;
-import java.lang.management.MemoryMXBean;
-import java.lang.management.MemoryPoolMXBean;
-import java.lang.management.MemoryType;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.Executors;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.Notification;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationListener;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.CancelException;
 import com.gemstone.gemfire.SystemFailure;
 import com.gemstone.gemfire.cache.CacheClosedException;
 import com.gemstone.gemfire.cache.query.internal.QueryMonitor;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember;
 import com.gemstone.gemfire.internal.GemFireStatSampler;
 import com.gemstone.gemfire.internal.LocalStatListener;
@@ -52,6 +34,19 @@ import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.Notification;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationListener;
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.MemoryType;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.*;
 
 /**
  * Allows for the setting of eviction and critical thresholds. These thresholds
@@ -67,10 +62,10 @@ public class HeapMemoryMonitor implements NotificationListener, ResourceMonitor
   private static final Logger logger = LogService.getLogger();
   
   // Allow for an unknown heap pool for VMs we may support in the future.
-  private static final String HEAP_POOL = System.getProperty("gemfire.ResourceManager.HEAP_POOL");
+  private static final String HEAP_POOL = System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "ResourceManager.HEAP_POOL");
   
   // Property for setting the JVM polling interval (below)
-  public static final String POLLER_INTERVAL_PROP = "gemfire.heapPollerInterval";
+  public static final String POLLER_INTERVAL_PROP = DistributionConfig.GEMFIRE_PREFIX + "heapPollerInterval";
   
    // Internal for polling the JVM for changes in heap memory usage.
   private static final int POLLER_INTERVAL = Integer.getInteger(POLLER_INTERVAL_PROP, 500).intValue();
@@ -82,29 +77,6 @@ public class HeapMemoryMonitor implements NotificationListener, ResourceMonitor
   
   // Listener for heap memory usage as reported by the Cache stats.
   private final LocalStatListener statListener = new LocalHeapStatListener();
-  
-  private volatile MemoryThresholds thresholds = new MemoryThresholds(tenuredPoolMaxMemory);
-  private volatile MemoryEvent mostRecentEvent = new MemoryEvent(ResourceType.HEAP_MEMORY, MemoryState.DISABLED,
-      MemoryState.DISABLED, null, 0L, true, this.thresholds);
-  private volatile MemoryState currentState = MemoryState.DISABLED;
-
-  //Set when startMonitoring() and stopMonitoring() are called
-  private Boolean started = false;
-  
-  // Set to true when setEvictionThreshold(...) is called.
-  private boolean hasEvictionThreshold = false;
-  
-   // Only change state when these counters exceed {@link HeapMemoryMonitor#memoryStateChangeTolerance}
-  private int criticalToleranceCounter;
-  private int evictionToleranceCounter;
-  
-  private final InternalResourceManager resourceManager;
-  private final ResourceAdvisor resourceAdvisor;
-  private final GemFireCacheImpl cache;
-  private final ResourceManagerStats stats;
-  
-  private static boolean testDisableMemoryUpdates = false;
-  private static long testBytesUsedForThresholdSet = -1;
 
   /*
    * Number of eviction or critical state changes that have to occur before the
@@ -115,9 +87,9 @@ public class HeapMemoryMonitor implements NotificationListener, ResourceMonitor
   static {
     String vendor = System.getProperty("java.vendor");
     if (vendor.contains("Sun") || vendor.contains("Oracle")) {
-      memoryStateChangeTolerance = Integer.getInteger("gemfire.memoryEventTolerance",1);
+      memoryStateChangeTolerance = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance", 1);
     } else {
-      memoryStateChangeTolerance = Integer.getInteger("gemfire.memoryEventTolerance",5);
+      memoryStateChangeTolerance = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "memoryEventTolerance", 5);
     }
   }
 
@@ -131,36 +103,63 @@ public class HeapMemoryMonitor implements NotificationListener, ResourceMonitor
         break;
       }
     }
-    
+
     tenuredMemoryPoolMXBean = matchingMemoryPoolMXBean;
 
     if (tenuredMemoryPoolMXBean == null) {
       logger.error(LocalizedMessage.create(LocalizedStrings.HeapMemoryMonitor_NO_POOL_FOUND_POOLS_0, getAllMemoryPoolNames()));
     }
   }
-  
 
- // Calculated value for the amount of JVM tenured heap memory available.
- private static final long tenuredPoolMaxMemory;
+  // Calculated value for the amount of JVM tenured heap memory available.
+  private static final long tenuredPoolMaxMemory;
   /*
    * Calculates the max memory for the tenured pool. Works around JDK bug:
    * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7078465 by getting max
    * memory from runtime and subtracting all other heap pools from it.
    */
- static {
-   if (tenuredMemoryPoolMXBean != null && tenuredMemoryPoolMXBean.getUsage().getMax() != -1) {
-     tenuredPoolMaxMemory = tenuredMemoryPoolMXBean.getUsage().getMax();
-   } else {
-     long calculatedMaxMemory = Runtime.getRuntime().maxMemory();
-     List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
-     for (MemoryPoolMXBean p : pools) {
-       if (p.getType() == MemoryType.HEAP && p.getUsage().getMax() != -1) {
-         calculatedMaxMemory -= p.getUsage().getMax();
-       }
-     }
-     tenuredPoolMaxMemory = calculatedMaxMemory;
-   }
- }
+  static {
+    if (tenuredMemoryPoolMXBean != null && tenuredMemoryPoolMXBean.getUsage().getMax() != -1) {
+      tenuredPoolMaxMemory = tenuredMemoryPoolMXBean.getUsage().getMax();
+    } else {
+      long calculatedMaxMemory = Runtime.getRuntime().maxMemory();
+      List<MemoryPoolMXBean> pools = ManagementFactory.getMemoryPoolMXBeans();
+      for (MemoryPoolMXBean p : pools) {
+        if (p.getType() == MemoryType.HEAP && p.getUsage().getMax() != -1) {
+          calculatedMaxMemory -= p.getUsage().getMax();
+        }
+      }
+      tenuredPoolMaxMemory = calculatedMaxMemory;
+    }
+  }
+
+  private volatile MemoryThresholds thresholds = new MemoryThresholds(tenuredPoolMaxMemory);
+  private volatile MemoryEvent mostRecentEvent = new MemoryEvent(ResourceType.HEAP_MEMORY, MemoryState.DISABLED,
+      MemoryState.DISABLED, null, 0L, true, this.thresholds);
+  private volatile MemoryState currentState = MemoryState.DISABLED;
+
+  //Set when startMonitoring() and stopMonitoring() are called
+  private Boolean started = false;
+
+  // Set to true when setEvictionThreshold(...) is called.
+  private boolean hasEvictionThreshold = false;
+
+  // Only change state when these counters exceed {@link HeapMemoryMonitor#memoryStateChangeTolerance}
+  private int criticalToleranceCounter;
+  private int evictionToleranceCounter;
+
+  private final InternalResourceManager resourceManager;
+  private final ResourceAdvisor resourceAdvisor;
+  private final GemFireCacheImpl cache;
+  private final ResourceManagerStats stats;
+
+  private static boolean testDisableMemoryUpdates = false;
+  private static long testBytesUsedForThresholdSet = -1;
+
+
+
+
+
  
   /**
    * Determines if the name of the memory pool MXBean provided matches a list of

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/InternalResourceManager.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/InternalResourceManager.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/InternalResourceManager.java
index 9d242aa..4547d4a 100755
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/InternalResourceManager.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/InternalResourceManager.java
@@ -16,23 +16,6 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.CancelCriterion;
 import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.cache.Cache;
@@ -42,6 +25,7 @@ import com.gemstone.gemfire.cache.control.RebalanceOperation;
 import com.gemstone.gemfire.cache.control.ResourceManager;
 import com.gemstone.gemfire.distributed.DistributedMember;
 import com.gemstone.gemfire.distributed.internal.DistributionAdvisor.Profile;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.OverflowQueueWithDMStats;
 import com.gemstone.gemfire.distributed.internal.SerialQueuedExecutorWithDMStats;
 import com.gemstone.gemfire.internal.ClassPathLoader;
@@ -54,6 +38,11 @@ import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 import com.gemstone.gemfire.internal.logging.LogService;
 import com.gemstone.gemfire.internal.logging.LoggingThreadGroup;
 import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
+import org.apache.logging.log4j.Logger;
+
+import java.util.*;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * Implementation of ResourceManager with additional internal-only methods.
@@ -63,7 +52,7 @@ import com.gemstone.gemfire.internal.logging.log4j.LocalizedMessage;
 public class InternalResourceManager implements ResourceManager {
   private static final Logger logger = LogService.getLogger();
 
-  final int MAX_RESOURCE_MANAGER_EXE_THREADS = Integer.getInteger("gemfire.resource.manager.threads", 1);
+  final int MAX_RESOURCE_MANAGER_EXE_THREADS = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "resource.manager.threads", 1);
   
   public enum ResourceType {
     HEAP_MEMORY(0x1), OFFHEAP_MEMORY(0x2), MEMORY(0x3), ALL(0xFFFFFFFF);
@@ -96,7 +85,7 @@ public class InternalResourceManager implements ResourceManager {
   private static ResourceObserver observer = new ResourceObserverAdapter();
   
   private static String PR_LOAD_PROBE_CLASS = System.getProperty(
-      "gemfire.ResourceManager.PR_LOAD_PROBE_CLASS", SizedBasedLoadProbe.class
+      DistributionConfig.GEMFIRE_PREFIX + "ResourceManager.PR_LOAD_PROBE_CLASS", SizedBasedLoadProbe.class
           .getName());
   
   public static InternalResourceManager getInternalResourceManager(Cache cache) {
@@ -350,7 +339,7 @@ public class InternalResourceManager implements ResourceManager {
       return;
     }
     executor.shutdown();
-    final int secToWait = Integer.getInteger("gemfire.prrecovery-close-timeout", 120).intValue();
+    final int secToWait = Integer.getInteger(DistributionConfig.GEMFIRE_PREFIX + "prrecovery-close-timeout", 120).intValue();
     try {
       executor.awaitTermination(secToWait, TimeUnit.SECONDS);
     }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/MemoryThresholds.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/MemoryThresholds.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/MemoryThresholds.java
index 75ce637..3da07f7 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/MemoryThresholds.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/MemoryThresholds.java
@@ -16,15 +16,16 @@
  */
 package com.gemstone.gemfire.internal.cache.control;
 
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
 import com.gemstone.gemfire.DataSerializer;
 import com.gemstone.gemfire.cache.LowMemoryException;
 import com.gemstone.gemfire.cache.control.ResourceManager;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
 
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
 /**
  * Stores eviction and critical thresholds for memory as well as the logic for
  * determining how memory transitions between states.
@@ -77,7 +78,7 @@ public class MemoryThresholds {
    * When this property is set to true, a {@link LowMemoryException} is not
    * thrown, even when usage crosses the critical threshold.
    */
-  private static final boolean DISABLE_LOW_MEM_EXCEPTION = Boolean.getBoolean("gemfire.disableLowMemoryException");
+  private static final boolean DISABLE_LOW_MEM_EXCEPTION = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "disableLowMemoryException");
   
   /**
    * The default percent of memory at which the VM is considered in a
@@ -98,7 +99,7 @@ public class MemoryThresholds {
    * Memory usage must fall below THRESHOLD-THRESHOLD_THICKNESS before we deliver
    * a down event
    */
-  private static final double THRESHOLD_THICKNESS = Double.parseDouble(System.getProperty("gemfire.thresholdThickness",
+  private static final double THRESHOLD_THICKNESS = Double.parseDouble(System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "thresholdThickness",
       "2.00"));
 
   /**
@@ -106,7 +107,7 @@ public class MemoryThresholds {
    * deliver an eviction down event
    */
   private static final double THRESHOLD_THICKNESS_EVICT = Double.parseDouble(System.getProperty(
-      "gemfire.eviction-thresholdThickness", Double.toString(THRESHOLD_THICKNESS)));
+      DistributionConfig.GEMFIRE_PREFIX + "eviction-thresholdThickness", Double.toString(THRESHOLD_THICKNESS)));
 
   private final long maxMemoryBytes;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationImpl.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationImpl.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationImpl.java
index 789c07b..9ff95fc 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationImpl.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/control/RebalanceOperationImpl.java
@@ -17,22 +17,6 @@
 
 package com.gemstone.gemfire.internal.cache.control;
 
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.CancellationException;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.logging.log4j.Logger;
-
 import com.gemstone.gemfire.GemFireException;
 import com.gemstone.gemfire.InternalGemFireError;
 import com.gemstone.gemfire.SystemFailure;
@@ -40,11 +24,19 @@ import com.gemstone.gemfire.cache.RegionDestroyedException;
 import com.gemstone.gemfire.cache.control.RebalanceOperation;
 import com.gemstone.gemfire.cache.control.RebalanceResults;
 import com.gemstone.gemfire.cache.partition.PartitionRebalanceInfo;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
 import com.gemstone.gemfire.internal.cache.PartitionedRegion;
 import com.gemstone.gemfire.internal.cache.partitioned.PartitionedRegionRebalanceOp;
 import com.gemstone.gemfire.internal.cache.partitioned.rebalance.CompositeDirector;
 import com.gemstone.gemfire.internal.logging.LogService;
+import org.apache.logging.log4j.Logger;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.*;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 /**
  * Implements <code>RebalanceOperation</code> for rebalancing Cache resources.
@@ -92,7 +84,7 @@ public class RebalanceOperationImpl implements RebalanceOperation {
           if (region.getColocatedWith() == null && filter.include(region)) {
             
             if (region.isFixedPartitionedRegion()) {
-              if (Boolean.getBoolean("gemfire.DISABLE_MOVE_PRIMARIES_ON_STARTUP")) {
+              if (Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "DISABLE_MOVE_PRIMARIES_ON_STARTUP")) {
                 PartitionedRegionRebalanceOp prOp = new PartitionedRegionRebalanceOp(
                     region, simulation, new CompositeDirector(false, false, false, true), true, true, cancelled,
                     stats);

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/FunctionStats.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/FunctionStats.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/FunctionStats.java
index a5689f1..756cfdd 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/FunctionStats.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/FunctionStats.java
@@ -16,11 +16,8 @@
  */
 package com.gemstone.gemfire.internal.cache.execute;
 
-import com.gemstone.gemfire.StatisticDescriptor;
-import com.gemstone.gemfire.Statistics;
-import com.gemstone.gemfire.StatisticsFactory;
-import com.gemstone.gemfire.StatisticsType;
-import com.gemstone.gemfire.StatisticsTypeFactory;
+import com.gemstone.gemfire.*;
+import com.gemstone.gemfire.distributed.internal.DistributionConfig;
 import com.gemstone.gemfire.distributed.internal.DistributionStats;
 import com.gemstone.gemfire.distributed.internal.InternalDistributedSystem;
 import com.gemstone.gemfire.internal.StatisticsTypeFactoryImpl;
@@ -518,7 +515,7 @@ public class FunctionStats {
   
   public static FunctionStats getFunctionStats(String functionID,
       InternalDistributedSystem ds) {
-    boolean statsDisabled = Boolean.getBoolean("gemfire.statsDisabled");
+    boolean statsDisabled = Boolean.getBoolean(DistributionConfig.GEMFIRE_PREFIX + "statsDisabled");
     if (statsDisabled) {
       if(disabledStats == null){
         disabledStats = new FunctionStats();

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/70612010/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/util/FindRestEnabledServersFunction.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/util/FindRestEnabledServersFunction.java b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/util/FindRestEnabledServersFunction.java
index 0836331..99a1d6c 100644
--- a/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/util/FindRestEnabledServersFunction.java
+++ b/geode-core/src/main/java/com/gemstone/gemfire/internal/cache/execute/util/FindRestEnabledServersFunction.java
@@ -16,7 +16,6 @@
  */
 package com.gemstone.gemfire.internal.cache.execute.util;
 
-
 import com.gemstone.gemfire.cache.CacheClosedException;
 import com.gemstone.gemfire.cache.CacheFactory;
 import com.gemstone.gemfire.cache.execute.FunctionAdapter;


Mime
View raw message