Repository: ignite Updated Branches: refs/heads/ignite-zk 09ab8649d -> 70bc10ba2
zk Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/913a5373 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/913a5373 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/913a5373 Branch: refs/heads/ignite-zk Commit: 913a5373d80a9c9d674e303ad9b50d0deb27d15a Parents: 4e8516d Author: sboikov <sboi...@gridgain.com> Authored: Tue Dec 26 13:00:39 2017 +0300 Committer: sboikov <sboi...@gridgain.com> Committed: Tue Dec 26 13:08:01 2017 +0300 ---------------------------------------------------------------------- .../internal/managers/discovery/IgniteDiscoverySpi.java | 6 ++++++ .../processors/continuous/GridContinuousProcessor.java | 10 ++++++++-- .../apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 5 +++++ .../ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java | 5 +++++ .../spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java | 2 ++ 5 files changed, 26 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/913a5373/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java index bf117f1..2e2b9af 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/IgniteDiscoverySpi.java @@ -20,6 +20,7 @@ package org.apache.ignite.internal.managers.discovery; import java.util.UUID; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.spi.discovery.DiscoverySpi; +import org.apache.ignite.spi.discovery.DiscoverySpiCustomMessage; /** * @@ -64,4 +65,9 @@ public interface IgniteDiscoverySpi extends DiscoverySpi { * @param err Connection error. */ public void resolveCommunicationError(ClusterNode node, Exception err); + + /** + * @return {@code True} if mutable {@link DiscoverySpiCustomMessage}s are supported. + */ + public boolean supportsMutableCustomEvents(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/913a5373/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 dbcea4c..eb7966e 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 @@ -55,6 +55,7 @@ import org.apache.ignite.internal.managers.deployment.GridDeployment; import org.apache.ignite.internal.managers.deployment.GridDeploymentInfo; import org.apache.ignite.internal.managers.deployment.GridDeploymentInfoBean; import org.apache.ignite.internal.managers.discovery.CustomEventListener; +import org.apache.ignite.internal.managers.discovery.IgniteDiscoverySpi; import org.apache.ignite.internal.managers.eventstorage.GridLocalEventListener; import org.apache.ignite.internal.managers.eventstorage.HighPriorityListener; import org.apache.ignite.internal.processors.GridProcessorAdapter; @@ -84,7 +85,7 @@ import org.apache.ignite.plugin.extensions.communication.Message; import org.apache.ignite.spi.discovery.DiscoveryDataBag; import org.apache.ignite.spi.discovery.DiscoveryDataBag.GridDiscoveryData; import org.apache.ignite.spi.discovery.DiscoveryDataBag.JoiningNodeDiscoveryData; -import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; +import org.apache.ignite.spi.discovery.DiscoverySpi; import org.apache.ignite.thread.IgniteThread; import org.jetbrains.annotations.Nullable; import org.jsr166.ConcurrentHashMap8; @@ -164,7 +165,12 @@ public class GridContinuousProcessor extends GridProcessorAdapter { /** {@inheritDoc} */ @Override public void start() throws IgniteCheckedException { - discoProtoVer = ctx.config().getDiscoverySpi() instanceof TcpDiscoverySpi ? 1 : 2; + DiscoverySpi discoSpi = ctx.config().getDiscoverySpi(); + + boolean nonMutableCustomEvts = (discoSpi instanceof IgniteDiscoverySpi) && + !((IgniteDiscoverySpi)discoSpi).supportsMutableCustomEvents(); + + discoProtoVer = nonMutableCustomEvts ? 2 : 1; if (ctx.config().isDaemon()) return; http://git-wip-us.apache.org/repos/asf/ignite/blob/913a5373/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 9d7dce3..781272c 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 @@ -2111,6 +2111,11 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements IgniteDiscovery } /** {@inheritDoc} */ + @Override public boolean supportsMutableCustomEvents() { + return true; + } + + /** {@inheritDoc} */ @Override public void resolveCommunicationError(ClusterNode node, Exception err) { throw new UnsupportedOperationException(); } http://git-wip-us.apache.org/repos/asf/ignite/blob/913a5373/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java index c4370cf..ebb667f 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/ZookeeperDiscoverySpi.java @@ -246,6 +246,11 @@ public class ZookeeperDiscoverySpi extends IgniteSpiAdapter implements Discovery } /** {@inheritDoc} */ + @Override public boolean supportsMutableCustomEvents() { + return false; + } + + /** {@inheritDoc} */ @Override public void resolveCommunicationError(ClusterNode node, Exception err) { impl.resolveCommunicationError(node, err); } http://git-wip-us.apache.org/repos/asf/ignite/blob/913a5373/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java index b8cfcfb..04bf113 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/zk/internal/ZookeeperDiscoveryImpl.java @@ -3061,6 +3061,8 @@ public class ZookeeperDiscoveryImpl { */ @SuppressWarnings("unchecked") private void notifyCustomEvent(final ZkDiscoveryCustomEventData evtData, final DiscoverySpiCustomMessage msg) { + assert !(msg instanceof ZkInternalMessage) : msg; + if (log.isDebugEnabled()) log.debug(" [topVer=" + evtData.topologyVersion() + ", msg=" + msg + ']');