ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [03/26] incubator-ignite git commit: # GG-9466 Pass node id to PluginProvider.receiveDiscoveryData
Date Wed, 18 Feb 2015 17:36:19 GMT
# GG-9466 Pass node id to PluginProvider.receiveDiscoveryData


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

Branch: refs/heads/ignite-217
Commit: 65d819c0596027e58516384227d488d185f3ab38
Parents: 3021ef8
Author: sevdokimov <sevdokimov@gridgain.com>
Authored: Tue Feb 17 19:33:30 2015 +0300
Committer: sevdokimov <sevdokimov@gridgain.com>
Committed: Tue Feb 17 19:33:30 2015 +0300

----------------------------------------------------------------------
 .../src/main/java/org/apache/ignite/internal/GridComponent.java  | 4 ++--
 .../java/org/apache/ignite/internal/GridPluginComponent.java     | 2 +-
 .../org/apache/ignite/internal/managers/GridManagerAdapter.java  | 2 +-
 .../ignite/internal/managers/discovery/GridDiscoveryManager.java | 4 ++--
 .../apache/ignite/internal/processors/GridProcessorAdapter.java  | 2 +-
 .../internal/processors/continuous/GridContinuousProcessor.java  | 2 +-
 .../ignite/internal/processors/plugin/IgnitePluginProcessor.java | 4 ++--
 .../src/main/java/org/apache/ignite/plugin/PluginProvider.java   | 3 ++-
 .../apache/ignite/spi/discovery/DiscoverySpiDataExchange.java    | 3 ++-
 .../apache/ignite/spi/discovery/tcp/TcpClientDiscoverySpi.java   | 4 ++--
 .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java     | 4 ++--
 .../apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java   | 4 ++--
 .../spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java      | 2 +-
 .../ignite/testframework/junits/spi/GridSpiAbstractTest.java     | 2 +-
 14 files changed, 22 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
index 06e173a..d496c9a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridComponent.java
@@ -84,10 +84,10 @@ public interface GridComponent {
      * Receives discovery data object from remote nodes (called
      * on new node during discovery process).
      *
+     * @param nodeId Remote node ID.
      * @param data Discovery data object or {@code null} if nothing was
-     *      sent for this component.
      */
-    public void onDiscoveryDataReceived(Object data);
+    public void onDiscoveryDataReceived(UUID nodeId, Object data);
 
     /**
      * Prints memory statistics (sizes of internal structures, etc.).

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
index d8995d1..915eda6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridPluginComponent.java
@@ -78,7 +78,7 @@ public class GridPluginComponent implements GridComponent {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(Object data) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
index d85f25e..283cd36 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
@@ -585,7 +585,7 @@ public abstract class GridManagerAdapter<T extends IgniteSpi> implements
GridMan
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(Object data) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/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 06ba35b..ab3ea07 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
@@ -326,7 +326,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
                 return data;
             }
 
-            @Override public void onExchange(Map<Integer, Object> data) {
+            @Override public void onExchange(UUID nodeId, Map<Integer, Object> data)
{
                 for (Map.Entry<Integer, Object> e : data.entrySet()) {
                     GridComponent comp = null;
 
@@ -339,7 +339,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
{
                     }
 
                     if (comp != null)
-                        comp.onDiscoveryDataReceived(e.getValue());
+                        comp.onDiscoveryDataReceived(nodeId, e.getValue());
                     else
                         U.warn(log, "Received discovery data for unknown component: " + e.getKey());
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
index d91802a..f3d0a81 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/GridProcessorAdapter.java
@@ -71,7 +71,7 @@ public abstract class GridProcessorAdapter implements GridProcessor {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(Object data) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
         // No-op.
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
index bf24a85..eed273d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/GridContinuousProcessor.java
@@ -347,7 +347,7 @@ public class GridContinuousProcessor extends GridProcessorAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(Object obj) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, Object obj) {
         DiscoveryData data = (DiscoveryData)obj;
 
         if (!ctx.isDaemon() && data != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
index 320c5f2..51432e7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/plugin/IgnitePluginProcessor.java
@@ -196,7 +196,7 @@ public class IgnitePluginProcessor extends GridProcessorAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public void onDiscoveryDataReceived(Object data) {
+    @Override public void onDiscoveryDataReceived(UUID nodeId, Object data) {
         Map<String, Object> discData = (Map<String, Object>)data;
 
         if (discData != null) {
@@ -204,7 +204,7 @@ public class IgnitePluginProcessor extends GridProcessorAdapter {
                 PluginProvider provider = plugins.get(e.getKey());
 
                 if (provider != null)
-                    provider.receiveDiscoveryData(e.getValue());
+                    provider.receiveDiscoveryData(nodeId, e.getValue());
                 else
                     U.warn(log, "Received discovery data for unknown plugin: " + e.getKey());
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java b/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
index a926a40..41b7216 100644
--- a/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
+++ b/modules/core/src/main/java/org/apache/ignite/plugin/PluginProvider.java
@@ -106,10 +106,11 @@ public interface PluginProvider<C extends PluginConfiguration>
{
      * on new node during discovery process). This data is provided by
      * {@link #provideDiscoveryData(UUID)} method on the other nodes.
      *
+     * @param nodeId Remote node ID.
      * @param data Discovery data object or {@code null} if nothing was
      *      sent for this component.
      */
-    public void receiveDiscoveryData(Object data);
+    public void receiveDiscoveryData(UUID nodeId, Object data);
 
     /**
      * Validates that new node can join grid topology, this method is called on coordinator

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
index aea57ee..788dc40 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/DiscoverySpiDataExchange.java
@@ -38,7 +38,8 @@ public interface DiscoverySpiDataExchange {
     /**
      * Notifies discovery manager about data received from remote node.
      *
+     * @param nodeId Remote node ID.
      * @param data Collection of discovery data objects from different components.
      */
-    public void onExchange(Map<Integer, Object> data);
+    public void onExchange(UUID nodeId, Map<Integer, Object> data);
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/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 4e3bc90..51df9db 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
@@ -892,7 +892,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements
Tcp
 
                         if (dataList != null) {
                             for (Map<Integer, Object> discoData : dataList)
-                                exchange.onExchange(discoData);
+                                exchange.onExchange(newNodeId, discoData);
                         }
 
                         locNode.setAttributes(node.attributes());
@@ -915,7 +915,7 @@ public class TcpClientDiscoverySpi extends TcpDiscoverySpiAdapter implements
Tcp
                     Map<Integer, Object> data = msg.newNodeDiscoveryData();
 
                     if (data != null)
-                        exchange.onExchange(data);
+                        exchange.onExchange(newNodeId, data);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/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 0df53f9..aef8259 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
@@ -3564,7 +3564,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                     Map<Integer, Object> data = msg.newNodeDiscoveryData();
 
                     if (data != null)
-                        exchange.onExchange(data);
+                        exchange.onExchange(node.id(), data);
 
                     msg.addDiscoveryData(exchange.collect(node.id()));
                 }
@@ -3636,7 +3636,7 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements
TcpDiscov
                 // Notify outside of synchronized block.
                 if (dataList != null) {
                     for (Map<Integer, Object> discoData : dataList)
-                        exchange.onExchange(discoData);
+                        exchange.onExchange(node.id(), discoData);
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
index f3b1036..14154ab 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/AbstractDiscoverySelfTest.java
@@ -381,10 +381,10 @@ public abstract class AbstractDiscoverySelfTest<T extends IgniteSpi>
extends Gri
 
                 spi.setDataExchange(new DiscoverySpiDataExchange() {
                     @Override public Map<Integer, Object> collect(UUID nodeId) {
-                        return new HashMap<Integer, Object>();
+                        return new HashMap<>();
                     }
 
-                    @Override public void onExchange(Map<Integer, Object> data) {
+                    @Override public void onExchange(UUID nodeId, Map<Integer, Object>
data) {
                         // No-op.
                     }
                 });

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
index c7ef480..18737aa 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpiStartStopSelfTest.java
@@ -51,7 +51,7 @@ public class TcpDiscoverySpiStartStopSelfTest extends GridSpiStartStopAbstractTe
                 return null;
             }
 
-            @Override public void onExchange(Map<Integer, Object> data) {
+            @Override public void onExchange(UUID nodeId, Map<Integer, Object> data)
{
                 // No-op.
             }
         };

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/65d819c0/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 f5a8c11..4e7b17a 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
@@ -219,7 +219,7 @@ public abstract class GridSpiAbstractTest<T extends IgniteSpi> extends
GridAbstr
                     return new HashMap<>();
                 }
 
-                @Override public void onExchange(Map<Integer, Object> data) {
+                @Override public void onExchange(UUID nodeId, Map<Integer, Object>
data) {
                 }
             });
 


Mime
View raw message