geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jinmeil...@apache.org
Subject [22/50] [abbrv] incubator-geode git commit: GEODE-1096: HeapMemoryMonitor to consider testBytesUsedForThresholdSet
Date Tue, 29 Mar 2016 22:25:52 GMT
GEODE-1096: HeapMemoryMonitor to consider testBytesUsedForThresholdSet

   HeapMemoryMonitor facilitates to instrument used bytes for testing,
   but updateStateAndSendEvent ignores the instrudmented value.
   Fix is to consider testBytesUsedForThresholdSet (if it is set)
   while sending a new memory event.


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

Branch: refs/heads/feature/GEODE-17-3
Commit: d8f28d23ebcae788a9390fc428310c37a9ef7744
Parents: f4b2037
Author: Sai Boorlagadda <sboorlagadda@pivotal.io>
Authored: Mon Mar 14 14:42:27 2016 -0700
Committer: Sai Boorlagadda <sboorlagadda@pivotal.io>
Committed: Wed Mar 16 14:24:05 2016 -0700

----------------------------------------------------------------------
 .../internal/cache/control/HeapMemoryMonitor.java     | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d8f28d23/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 27a6dff..ffd940e 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
@@ -385,11 +385,7 @@ public void stopMonitoring() {
       this.thresholds = new MemoryThresholds(this.thresholds.getMaxMemoryBytes(), criticalThreshold,
this.thresholds
           .getEvictionThreshold());
 
-      if (testBytesUsedForThresholdSet != -1) {
-        updateStateAndSendEvent(testBytesUsedForThresholdSet);
-      } else {
-        updateStateAndSendEvent(getBytesUsed());
-      }
+      updateStateAndSendEvent();
       
       // Start or stop monitoring based upon whether a threshold has been set
       if (this.thresholds.isEvictionThresholdEnabled() || this.thresholds.isCriticalThresholdEnabled())
{
@@ -437,11 +433,7 @@ public void stopMonitoring() {
       this.thresholds = new MemoryThresholds(this.thresholds.getMaxMemoryBytes(), this.thresholds.getCriticalThreshold(),
           evictionThreshold);
 
-      if (testBytesUsedForThresholdSet != -1) {
-        updateStateAndSendEvent(testBytesUsedForThresholdSet);
-      } else {
-        updateStateAndSendEvent(getBytesUsed());
-      }
+      updateStateAndSendEvent();
 
       // Start or stop monitoring based upon whether a threshold has been set
       if (this.thresholds.isEvictionThresholdEnabled() || this.thresholds.isCriticalThresholdEnabled())
{
@@ -463,7 +455,7 @@ public void stopMonitoring() {
    * If necessary, change the state and send an event for the state change.
    */
   public void updateStateAndSendEvent() {
-    updateStateAndSendEvent(getBytesUsed());
+    updateStateAndSendEvent(testBytesUsedForThresholdSet != -1 ? testBytesUsedForThresholdSet
: getBytesUsed());
   }
   
   /**


Mime
View raw message