ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [08/15] ignite git commit: IGNITE-6583 Proper getters for rebalance metrics were added; ignite-style getters (without get) were deprecated
Date Tue, 10 Oct 2017 12:44:12 GMT
IGNITE-6583 Proper getters for rebalance metrics were added; ignite-style getters (without
get) were deprecated

Signed-off-by: Andrey Gura <agura@apache.org>


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

Branch: refs/heads/ignite-5937
Commit: 2e556829386eda34fb1ac78a39d1a4b4c4af4ce2
Parents: a8ac443
Author: Sergey Chugunov <sergey.chugunov@gmail.com>
Authored: Mon Oct 9 18:35:11 2017 +0300
Committer: Andrey Gura <agura@apache.org>
Committed: Mon Oct 9 18:35:11 2017 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/cache/CacheMetrics.java   | 20 ++++++++++++++++++++
 .../cache/CacheClusterMetricsMXBeanImpl.java    | 10 ++++++++++
 .../cache/CacheLocalMetricsMXBeanImpl.java      | 10 ++++++++++
 .../processors/cache/CacheMetricsImpl.java      | 12 +++++++++++-
 .../processors/cache/CacheMetricsSnapshot.java  | 10 ++++++++++
 .../cache/CacheGroupsMetricsRebalanceTest.java  |  6 +++---
 .../platform/PlatformCacheWriteMetricsTask.java | 10 ++++++++++
 7 files changed, 74 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
index 20ea692..fe789ca 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheMetrics.java
@@ -506,16 +506,36 @@ public interface CacheMetrics {
     public long getRebalancingBytesRate();
 
     /**
+     * This method is deprecated and will be deleted in future major release.
+     *
+     * Use {@link #getEstimatedRebalancingFinishTime()} instead.
+     *
      * @return Estimated rebalancing finished time.
      */
+    @Deprecated
     public long estimateRebalancingFinishTime();
 
     /**
+     * This method is deprecated and will be deleted in future major release.
+     *
+     * Use {@link #getRebalancingStartTime()} instead.
+     *
      * @return Rebalancing start time.
      */
+    @Deprecated
     public long rebalancingStartTime();
 
     /**
+     * @return Estimated rebalancing finish time.
+     */
+    public long getEstimatedRebalancingFinishTime();
+
+    /**
+     * @return Rebalancing start time.
+     */
+    public long getRebalancingStartTime();
+
+    /**
      * Checks whether statistics collection is enabled in this cache.
      * <p>
      * The default value is {@code false}.

http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
index df4a6ab..1611840 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheClusterMetricsMXBeanImpl.java
@@ -392,4 +392,14 @@ class CacheClusterMetricsMXBeanImpl implements CacheMetricsMXBean {
     @Override public long rebalancingStartTime() {
         return cache.clusterMetrics().rebalancingStartTime();
     }
+
+    /** {@inheritDoc} */
+    @Override public long getEstimatedRebalancingFinishTime() {
+        return cache.clusterMetrics().getEstimatedRebalancingFinishTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getRebalancingStartTime() {
+        return cache.clusterMetrics().getRebalancingStartTime();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
index a767193..4a8c25c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheLocalMetricsMXBeanImpl.java
@@ -392,4 +392,14 @@ class CacheLocalMetricsMXBeanImpl implements CacheMetricsMXBean {
     @Override public long rebalancingStartTime() {
         return cache.metrics0().rebalancingStartTime();
     }
+
+    /** {@inheritDoc} */
+    @Override public long getEstimatedRebalancingFinishTime() {
+        return cache.metrics0().getEstimatedRebalancingFinishTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getRebalancingStartTime() {
+        return cache.metrics0().getRebalancingStartTime();
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
index 7d9cda8..c98d51f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsImpl.java
@@ -808,6 +808,16 @@ public class CacheMetricsImpl implements CacheMetrics {
 
     /** {@inheritDoc} */
     @Override public long estimateRebalancingFinishTime() {
+        return getEstimatedRebalancingFinishTime();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long rebalancingStartTime() {
+        return rebalanceStartTime.get();
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getEstimatedRebalancingFinishTime() {
         long rate = rebalancingKeysRate.getRate();
 
         return rate <= 0 ? -1L :
@@ -815,7 +825,7 @@ public class CacheMetricsImpl implements CacheMetrics {
     }
 
     /** {@inheritDoc} */
-    @Override public long rebalancingStartTime() {
+    @Override public long getRebalancingStartTime() {
         return rebalanceStartTime.get();
     }
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
index 2d38db8..9590c88 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheMetricsSnapshot.java
@@ -734,6 +734,16 @@ public class CacheMetricsSnapshot implements CacheMetrics, Externalizable
{
     }
 
     /** {@inheritDoc} */
+    @Override public long getEstimatedRebalancingFinishTime() {
+        return rebalanceFinishTime;
+    }
+
+    /** {@inheritDoc} */
+    @Override public long getRebalancingStartTime() {
+        return rebalanceStartTime;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean isWriteBehindEnabled() {
         return isWriteBehindEnabled;
     }

http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java
index a49ce61..eb7c3a8 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/CacheGroupsMetricsRebalanceTest.java
@@ -189,13 +189,13 @@ public class CacheGroupsMetricsRebalanceTest extends GridCommonAbstractTest
{
 
         waitForCondition(new PA() {
             @Override public boolean apply() {
-                return ig2.cache(CACHE1).localMetrics().rebalancingStartTime() != -1L;
+                return ig2.cache(CACHE1).localMetrics().getRebalancingStartTime() != -1L;
             }
         }, 5_000);
 
         CacheMetrics metrics = ig2.cache(CACHE1).localMetrics();
 
-        long startTime = metrics.rebalancingStartTime();
+        long startTime = metrics.getRebalancingStartTime();
 
         assertTrue(startTime > 0);
         assertTrue((U.currentTimeMillis() - startTime) < 5000);
@@ -235,7 +235,7 @@ public class CacheGroupsMetricsRebalanceTest extends GridCommonAbstractTest
{
 
         latch.await();
 
-        long finishTime = ig2.cache(CACHE1).localMetrics().estimateRebalancingFinishTime();
+        long finishTime = ig2.cache(CACHE1).localMetrics().getEstimatedRebalancingFinishTime();
 
         assertTrue(finishTime > 0);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/2e556829/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
b/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
index 64ff0bc..e7404fa 100644
--- a/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
+++ b/modules/core/src/test/java/org/apache/ignite/platform/PlatformCacheWriteMetricsTask.java
@@ -443,6 +443,16 @@ public class PlatformCacheWriteMetricsTask extends ComputeTaskAdapter<Long,
Obje
         @Override public long rebalancingStartTime() {
             return 61;
         }
+
+        /** {@inheritDoc} */
+        @Override public long getEstimatedRebalancingFinishTime() {
+            return 62;
+        }
+
+        /** {@inheritDoc} */
+        @Override public long getRebalancingStartTime() {
+            return 63;
+        }
     }
 }
 


Mime
View raw message