ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yzhda...@apache.org
Subject [5/5] incubator-ignite git commit: Ignite-49 review
Date Mon, 26 Jan 2015 15:37:26 GMT
Ignite-49 review


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

Branch: refs/heads/ignite-49
Commit: b8c1bcfbf85975a9c686300fd8223b0313985533
Parents: 17982e8
Author: Yakov Zhdanov <yzhdanov@gridgain.com>
Authored: Mon Jan 26 18:37:15 2015 +0300
Committer: Yakov Zhdanov <yzhdanov@gridgain.com>
Committed: Mon Jan 26 18:37:15 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/cache/CacheManager.java   | 2 +-
 .../src/main/java/org/apache/ignite/cache/CacheMetrics.java   | 4 +---
 .../src/main/java/org/apache/ignite/internal/GridKernal.java  | 1 +
 .../internal/managers/discovery/GridDiscoveryManager.java     | 2 +-
 .../java/org/apache/ignite/mxbean/CacheMetricsMXBean.java     | 7 +------
 .../apache/ignite/spi/discovery/DiscoveryMetricsHelper.java   | 2 +-
 .../apache/ignite/spi/discovery/DiscoveryMetricsProvider.java | 2 +-
 .../ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java       | 2 +-
 .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java  | 2 +-
 .../ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java   | 4 ++--
 .../ignite/testframework/junits/spi/GridSpiAbstractTest.java  | 2 +-
 11 files changed, 12 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
index b540372..de91ef8 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CacheManager.java
@@ -20,8 +20,8 @@ package org.apache.ignite.cache;
 import org.apache.ignite.*;
 import org.apache.ignite.configuration.*;
 import org.apache.ignite.internal.*;
-import org.apache.ignite.lang.*;
 import org.apache.ignite.internal.util.typedef.*;
+import org.apache.ignite.lang.*;
 
 import javax.cache.*;
 import javax.cache.configuration.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/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 5fd2844..b0a1350 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
@@ -17,8 +17,6 @@
 
 package org.apache.ignite.cache;
 
-import java.io.*;
-
 /**
  * Cache metrics used to obtain statistics on cache itself.
  * Use {@link org.apache.ignite.IgniteCache#metrics()} to obtain metrics for a cache.
@@ -29,7 +27,7 @@ public interface CacheMetrics {
      *
      * @return the number of hits
      */
-    long getCacheHits();
+    public long getCacheHits();
 
     /**
      * This is a measure of cache efficiency.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
index d3fa174..fbb4ac0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernal.java
@@ -987,6 +987,7 @@ public class GridKernal extends ClusterGroupAdapter implements GridEx,
IgniteMBe
                             cpus = metrics.getTotalCpus();
                         }
                         catch (IgniteCheckedException ignore) {
+                            // No-op.
                         }
 
                         int pubPoolActiveThreads = 0;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index fb58f25..2b568c2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -492,7 +492,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
             private final long startTime = U.currentTimeMillis();
 
             /** {@inheritDoc} */
-            @Override public ClusterMetrics getMetrics() {
+            @Override public ClusterMetrics metrics() {
                 GridJobMetrics jm = ctx.jobMetric().getJobMetrics();
 
                 DiscoveryMetricsAdapter nm = new DiscoveryMetricsAdapter();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java b/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
index 77c5849..1235e3f 100644
--- a/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/mxbean/CacheMetricsMXBean.java
@@ -17,13 +17,8 @@
 
 package org.apache.ignite.mxbean;
 
-import org.apache.ignite.cache.*;
-import org.apache.ignite.*;
-
-/**
- * This interface defines JMX view on {@link IgniteCache}.
- */
 import org.apache.ignite.*;
+import org.apache.ignite.cache.*;
 
 import javax.cache.management.*;
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsHelper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsHelper.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsHelper.java
index 828d640..31a5e12 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsHelper.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsHelper.java
@@ -21,7 +21,7 @@ import org.apache.ignite.cluster.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 
 /**
- * Helper class to serialize and deserialize node metrics.
+ * Helper class to serialize and deserialize cluster metrics.
  */
 public final class DiscoveryMetricsHelper {
     /** Size of serialized node metrics. */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsProvider.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsProvider.java
index faebb70..cfe8032 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsProvider.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoveryMetricsProvider.java
@@ -35,5 +35,5 @@ public interface DiscoveryMetricsProvider {
      *
      * @return Up to date metrics data about local node.
      */
-    public ClusterMetrics getMetrics();
+    public ClusterMetrics metrics();
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
index 346aaca..5fc0dd8 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java
@@ -1061,7 +1061,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements
Tcp
                     Socket sock0 = sock;
 
                     if (sock0 != null) {
-                        msg.setMetrics(ignite.configuration().getNodeId(), metricsProvider.getMetrics());
+                        msg.setMetrics(ignite.configuration().getNodeId(), metricsProvider.metrics());
 
                         try {
                             writeToSocket(sock0, msg);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index ed2f6ff..9568472 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -4350,7 +4350,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                 if ((locNodeId.equals(msg.creatorNodeId()) && msg.senderNodeId()
== null ||
                     !msg.hasMetrics(locNodeId)) && spiStateCopy() == CONNECTED) {
                     // Message is on its first ring or just created on coordinator.
-                    msg.setMetrics(locNodeId, metricsProvider.getMetrics());
+                    msg.setMetrics(locNodeId, metricsProvider.metrics());
 
                     for (Map.Entry<UUID, ClientMessageWorker> e : clientMsgWorkers.entrySet())
{
                         UUID nodeId = e.getKey();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
index d842eee..cd5dacf 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/internal/TcpDiscoveryNode.java
@@ -138,7 +138,7 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
 
         consistentId = U.consistentId(addrs, discPort);
 
-        metrics = metricsProvider.getMetrics();
+        metrics = metricsProvider.metrics();
         sockAddrs = U.toSocketAddresses(this, discPort);
     }
 
@@ -193,7 +193,7 @@ public class TcpDiscoveryNode extends GridMetadataAwareAdapter implements
Cluste
     /** {@inheritDoc} */
     @Override public ClusterMetrics metrics() {
         if (metricsProvider != null)
-            metrics = metricsProvider.getMetrics();
+            metrics = metricsProvider.metrics();
 
         return metrics;
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/b8c1bcfb/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
index cc58458..1bc4a6f 100644
--- a/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/testframework/junits/spi/GridSpiAbstractTest.java
@@ -347,7 +347,7 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends
GridAbstr
     protected DiscoveryMetricsProvider createMetricsProvider() {
         return new DiscoveryMetricsProvider() {
             /** {@inheritDoc} */
-            @Override public ClusterMetrics getMetrics() { return new DiscoveryMetricsAdapter();
}
+            @Override public ClusterMetrics metrics() { return new DiscoveryMetricsAdapter();
}
         };
     }
 


Mime
View raw message