ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [10/14] ignite git commit: IGNITE-6667 wip.
Date Wed, 25 Oct 2017 14:01:31 GMT
IGNITE-6667 wip.


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

Branch: refs/heads/ignite-6667
Commit: 92d00c36c53813ecebb6164ca72da0154d9de8c1
Parents: d6fe138
Author: Aleksei Scherbakov <alexey.scherbakoff@gmail.com>
Authored: Tue Oct 24 15:04:20 2017 +0300
Committer: Aleksei Scherbakov <alexey.scherbakoff@gmail.com>
Committed: Tue Oct 24 15:04:20 2017 +0300

----------------------------------------------------------------------
 .../internal/managers/discovery/DiscoCache.java |  6 +-
 .../discovery/DiscoveryCustomMessage.java       | 13 ++--
 .../discovery/GridDiscoveryManager.java         | 70 +++++++++++++++-----
 .../discovery/ReuseDiscoCacheStrategy.java      | 65 ------------------
 .../cache/CacheAffinityChangeMessage.java       | 15 ++---
 .../ClientCacheChangeDiscoveryMessage.java      | 15 ++---
 .../ClientCacheChangeDummyDiscoveryMessage.java | 15 ++---
 .../cache/DynamicCacheChangeBatch.java          | 15 ++---
 .../binary/MetadataUpdateAcceptedMessage.java   | 15 ++---
 .../binary/MetadataUpdateProposedMessage.java   | 15 ++---
 .../cluster/ChangeGlobalStateFinishMessage.java | 15 ++---
 .../cluster/ChangeGlobalStateMessage.java       | 15 ++---
 .../continuous/AbstractContinuousMessage.java   | 15 ++---
 .../marshaller/MappingAcceptedMessage.java      | 15 ++---
 .../marshaller/MappingProposedMessage.java      | 15 ++---
 .../message/SchemaAbstractDiscoveryMessage.java | 15 ++---
 16 files changed, 114 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
index 0578c57..32aa23b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoCache.java
@@ -319,11 +319,13 @@ public class DiscoCache {
      * Returns copy of discovery cache suitable for further reuse.
      *
      * @param ver Version.
+     * @param st State.
+     *
      * @return Copy.
      */
-    public DiscoCache copy(@Nullable AffinityTopologyVersion ver, @Nullable DiscoveryDataClusterState
st) {
+    public DiscoCache copy(AffinityTopologyVersion ver, @Nullable DiscoveryDataClusterState
st) {
         return new DiscoCache(
-            ver == null ? topVer : ver,
+            ver,
             st == null ? state : st,
             loc,
             rmtNodes,

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryCustomMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryCustomMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryCustomMessage.java
index 660e883..ae238a0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryCustomMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/DiscoveryCustomMessage.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.internal.managers.discovery;
 
 import java.io.Serializable;
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.lang.IgniteUuid;
 import org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryNodeAddFinishedMessage;
@@ -92,12 +93,14 @@ public interface DiscoveryCustomMessage extends Serializable {
     public boolean isMutable();
 
     /**
-     * Creates new discovery cache in most efficient way for current message type on topology
change.
+     * Reuses current discovery cache in most efficient way for given message type.
      *
-     * @param stgy Current cache.
+     * @param ctx Context.
      * @param topVer New topology version.
-     * @param discoCache @return New cache or null if not applicable.
+     * @param discoCache @return Reused discovery cache.
+     *
+     * @throws UnsupportedOperationException If message doesn't support discovery cache reuse.
      */
-    public @Nullable DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy, AffinityTopologyVersion
topVer,
-        DiscoCache discoCache);
+    public DiscoCache reuseDiscoCache(GridKernalContext ctx, AffinityTopologyVersion topVer,
+        DiscoCache discoCache) throws UnsupportedOperationException;
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/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 a6e9e56..d91d7d0 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
@@ -161,7 +161,7 @@ import static org.apache.ignite.plugin.segmentation.SegmentationPolicy.NOOP;
 /**
  * Discovery SPI manager.
  */
-public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> implements
ReuseDiscoCacheStrategy {
+public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
     /** Metrics update frequency. */
     private static final long METRICS_UPDATE_FREQ = 3000;
 
@@ -660,14 +660,12 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
imple
                             discoCache());
                     }
                     else if (customMsg instanceof ChangeGlobalStateFinishMessage) {
-                        ctx.state().onStateFinishMessage((ChangeGlobalStateFinishMessage)customMsg);
+                        final ChangeGlobalStateFinishMessage finishMsg = (ChangeGlobalStateFinishMessage)customMsg;
 
-                        discoCache = createDiscoCache(snapshot.topVer,
-                            ctx.state().clusterState(),
-                            locNode,
-                            topSnapshot);
+                        ctx.state().onStateFinishMessage(finishMsg);
 
-                        topSnap.set(new Snapshot(snapshot.topVer, discoCache));
+                        topSnap.set(new Snapshot(snapshot.topVer, (discoCache =
+                            finishMsg.reuseDiscoCache(ctx, snapshot.topVer, snapshot.discoCache))));
                     }
                     else {
                         incMinorTopVer = ctx.cache().onCustomEvent(
@@ -712,7 +710,7 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
imple
                 if (verChanged) {
                     if (discoCache == null) {
                         discoCache = incMinorTopVer ?
-                            customMsg.reuseDiscoCache(GridDiscoveryManager.this, nextTopVer,
snapshot.discoCache) :
+                            customMsg.reuseDiscoCache(ctx, nextTopVer, snapshot.discoCache)
:
                             createDiscoCache(nextTopVer,
                                 ctx.state().clusterState(),
                                 locNode,
@@ -3071,8 +3069,15 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
imple
         }
     }
 
-    /** {@inheritDoc} */
-    @Override public DiscoCache apply(DynamicCacheChangeBatch msg, AffinityTopologyVersion
topVer, DiscoCache discoCache) {
+    /**
+     * Reuses discovery cache for {@link DynamicCacheChangeBatch}
+     *
+     * @param msg Message.
+     * @param topVer Topology version.
+     * @param discoCache Disco cache.
+     */
+    public DiscoCache reuseDiscoCache(DynamicCacheChangeBatch msg, AffinityTopologyVersion
topVer,
+        DiscoCache discoCache) {
         List<ClusterNode> allNodes = discoCache.allNodes();
         Map<Integer, List<ClusterNode>> allCacheNodes = U.newHashMap(allNodes.size());
         Map<Integer, List<ClusterNode>> cacheGrpAffNodes = U.newHashMap(allNodes.size());
@@ -3096,18 +3101,51 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi>
imple
             discoCache.minimumNodeVersion());
     }
 
-    /** {@inheritDoc} */
-    @Override public DiscoCache apply(CacheAffinityChangeMessage msg, AffinityTopologyVersion
topVer, DiscoCache discoCache) {
+    /**
+     * Reuses discovery cache for {@link CacheAffinityChangeMessage}
+     *
+     * @param msg Message.
+     * @param topVer Topology version.
+     * @param discoCache Disco cache.
+     */
+    public DiscoCache reuseDiscoCache(CacheAffinityChangeMessage msg, AffinityTopologyVersion
topVer,
+        DiscoCache discoCache) {
         return discoCache.copy(topVer, null);
     }
 
-    /** {@inheritDoc} */
-    @Override public DiscoCache apply(SnapshotDiscoveryMessage msg, AffinityTopologyVersion
topVer, DiscoCache discoCache) {
+    /**
+     * Reuses discovery cache for {@link SnapshotDiscoveryMessage}
+     *
+     * @param msg Message.
+     * @param topVer Topology version.
+     * @param discoCache Disco cache.
+     */
+    public DiscoCache reuseDiscoCache(SnapshotDiscoveryMessage msg, AffinityTopologyVersion
topVer,
+        DiscoCache discoCache) {
         return discoCache.copy(topVer, null);
     }
 
-    /** {@inheritDoc} */
-    @Override public DiscoCache apply(ChangeGlobalStateMessage msg, AffinityTopologyVersion
topVer, DiscoCache discoCache) {
+    /**
+     * Reuses discovery cache for {@link ChangeGlobalStateMessage}
+     *
+     * @param msg Message.
+     * @param topVer Topology version.
+     * @param discoCache Disco cache.
+     */
+    public DiscoCache reuseDiscoCache(ChangeGlobalStateMessage msg, AffinityTopologyVersion
topVer,
+        DiscoCache discoCache) {
+        return discoCache.copy(topVer, ctx.state().clusterState());
+    }
+
+    /**
+     * Reuses discovery cache for {@link ChangeGlobalStateFinishMessage}
+     *
+     * @param msg Message.
+     * @param topVer Topology version.
+     * @param discoCache Disco cache.
+     */
+    public DiscoCache reuseDiscoCache(ChangeGlobalStateFinishMessage msg, AffinityTopologyVersion
topVer,
+        DiscoCache discoCache) {
         return discoCache.copy(topVer, ctx.state().clusterState());
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/ReuseDiscoCacheStrategy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/ReuseDiscoCacheStrategy.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/ReuseDiscoCacheStrategy.java
deleted file mode 100644
index 7c5652b..0000000
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/ReuseDiscoCacheStrategy.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.internal.managers.discovery;
-
-import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
-import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
-import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
-import org.apache.ignite.internal.processors.cache.persistence.snapshot.SnapshotDiscoveryMessage;
-import org.apache.ignite.internal.processors.cluster.ChangeGlobalStateMessage;
-
-/**
- * Defines messages which are willing to reuse discovery cache for efficiency reasons.
- */
-public interface ReuseDiscoCacheStrategy {
-    /**
-     * Create discovery cache for {@link DynamicCacheChangeBatch} message.
-     *
-     * @param msg Message.
-     * @param topVer Topology version.
-     * @param discoCache Disco cache.
-     */
-    public DiscoCache apply(DynamicCacheChangeBatch msg, AffinityTopologyVersion topVer,
DiscoCache discoCache);
-
-    /**
-     * Create discovery cache for {@link CacheAffinityChangeMessage} message.
-     *
-     * @param msg Message.
-     * @param topVer Topology version.
-     * @param discoCache Disco cache.
-     */
-    public DiscoCache apply(CacheAffinityChangeMessage msg, AffinityTopologyVersion topVer,
DiscoCache discoCache);
-
-    /**
-     * Create discovery cache for {@link SnapshotDiscoveryMessage} message.
-     *
-     * @param msg Message.
-     * @param topVer Topology version.
-     * @param discoCache Disco cache.
-     */
-    public DiscoCache apply(SnapshotDiscoveryMessage msg, AffinityTopologyVersion topVer,
DiscoCache discoCache);
-
-    /**
-     * Create discovery cache for {@link ChangeGlobalStateMessage} message.
-     *
-     * @param msg Message.
-     * @param topVer Topology version.
-     * @param discoCache Disco cache.
-     */
-    public DiscoCache apply(ChangeGlobalStateMessage msg, AffinityTopologyVersion topVer,
DiscoCache discoCache);
-}

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinityChangeMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinityChangeMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinityChangeMessage.java
index 8be4a5c..2897c55 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinityChangeMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinityChangeMessage.java
@@ -21,9 +21,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionExchangeId;
 import org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage;
@@ -156,17 +156,10 @@ public class CacheAffinityChangeMessage implements DiscoveryCustomMessage
{
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return stgy.apply(this, topVer, discoCache);
+        return ctx.discovery().reuseDiscoCache(this, topVer, discoCache);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDiscoveryMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDiscoveryMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDiscoveryMessage.java
index 1be8fcd..22e40c8 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDiscoveryMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDiscoveryMessage.java
@@ -23,9 +23,9 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -173,17 +173,10 @@ public class ClientCacheChangeDiscoveryMessage implements DiscoveryCustomMessage
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDummyDiscoveryMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDummyDiscoveryMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDummyDiscoveryMessage.java
index a9180c0..afa2081 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDummyDiscoveryMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClientCacheChangeDummyDiscoveryMessage.java
@@ -21,9 +21,9 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -105,17 +105,10 @@ public class ClientCacheChangeDummyDiscoveryMessage implements DiscoveryCustomMe
         throw new UnsupportedOperationException();
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
index f01857e..d266262 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheChangeBatch.java
@@ -20,9 +20,9 @@ package org.apache.ignite.internal.processors.cache;
 import java.util.Collection;
 import java.util.Set;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.F;
@@ -77,17 +77,10 @@ public class DynamicCacheChangeBatch implements DiscoveryCustomMessage
{
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return stgy.apply(this, topVer, discoCache);
+        return ctx.discovery().reuseDiscoCache(this, topVer, discoCache);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateAcceptedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateAcceptedMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateAcceptedMessage.java
index c195731..8a78657 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateAcceptedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateAcceptedMessage.java
@@ -16,9 +16,9 @@
  */
 package org.apache.ignite.internal.processors.cache.binary;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
@@ -70,17 +70,10 @@ public class MetadataUpdateAcceptedMessage implements DiscoveryCustomMessage
{
         return true;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java
index 160faf3..50c9628 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/binary/MetadataUpdateProposedMessage.java
@@ -18,11 +18,11 @@ package org.apache.ignite.internal.processors.cache.binary;
 
 import java.util.UUID;
 import org.apache.ignite.binary.BinaryObjectException;
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.binary.BinaryMetadata;
 import org.apache.ignite.internal.binary.BinaryMetadataHandler;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
@@ -133,17 +133,10 @@ public final class MetadataUpdateProposedMessage implements DiscoveryCustomMessa
         return true;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
index 79342cf..7f094c7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateFinishMessage.java
@@ -19,9 +19,9 @@ package org.apache.ignite.internal.processors.cluster;
 
 import java.util.UUID;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
@@ -83,17 +83,10 @@ public class ChangeGlobalStateFinishMessage implements DiscoveryCustomMessage
{
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        return ctx.discovery().reuseDiscoCache(this, topVer, discoCache);
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
index eed04fc..2507ec9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cluster/ChangeGlobalStateMessage.java
@@ -20,9 +20,9 @@ package org.apache.ignite.internal.processors.cluster;
 import java.util.List;
 import java.util.UUID;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.cache.ExchangeActions;
 import org.apache.ignite.internal.processors.cache.StoredCacheData;
@@ -116,17 +116,10 @@ public class ChangeGlobalStateMessage implements DiscoveryCustomMessage
{
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return stgy.apply(this, topVer, discoCache);
+        return ctx.discovery().reuseDiscoCache(this, topVer, discoCache);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
index 8279b07..cdf3c1d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/continuous/AbstractContinuousMessage.java
@@ -19,9 +19,9 @@ package org.apache.ignite.internal.processors.continuous;
 
 import java.util.UUID;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.lang.IgniteUuid;
 import org.jetbrains.annotations.Nullable;
@@ -63,16 +63,9 @@ public abstract class AbstractContinuousMessage implements DiscoveryCustomMessag
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingAcceptedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingAcceptedMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingAcceptedMessage.java
index 52eac25..c47aa27 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingAcceptedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingAcceptedMessage.java
@@ -17,9 +17,9 @@
 
 package org.apache.ignite.internal.processors.marshaller;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.lang.IgniteUuid;
@@ -62,17 +62,10 @@ public class MappingAcceptedMessage implements DiscoveryCustomMessage
{
         return false;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingProposedMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingProposedMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingProposedMessage.java
index 8c2abaa..8cf8e61 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingProposedMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/marshaller/MappingProposedMessage.java
@@ -19,9 +19,9 @@ package org.apache.ignite.internal.processors.marshaller;
 
 import java.util.UUID;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.S;
@@ -98,17 +98,10 @@ public class MappingProposedMessage implements DiscoveryCustomMessage
{
         return true;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /** */

http://git-wip-us.apache.org/repos/asf/ignite/blob/92d00c36/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/message/SchemaAbstractDiscoveryMessage.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/message/SchemaAbstractDiscoveryMessage.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/message/SchemaAbstractDiscoveryMessage.java
index e055606..e567fdc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/message/SchemaAbstractDiscoveryMessage.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/message/SchemaAbstractDiscoveryMessage.java
@@ -17,9 +17,9 @@
 
 package org.apache.ignite.internal.processors.query.schema.message;
 
+import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.managers.discovery.DiscoCache;
 import org.apache.ignite.internal.managers.discovery.DiscoveryCustomMessage;
-import org.apache.ignite.internal.managers.discovery.ReuseDiscoCacheStrategy;
 import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion;
 import org.apache.ignite.internal.processors.query.schema.operation.SchemaAbstractOperation;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
@@ -55,17 +55,10 @@ public abstract class SchemaAbstractDiscoveryMessage implements DiscoveryCustomM
         return id;
     }
 
-    /**
-     * {@inheritDoc}
-     * @param stgy Reuse strategy.
-     * @param topVer New topology version.
-     * @param discoCache Discovery cache
-     *
-     * @return Reused discovery cache if possible.
-     */
-    @Nullable @Override public DiscoCache reuseDiscoCache(ReuseDiscoCacheStrategy stgy,
+    /** {@inheritDoc} */
+    @Nullable @Override public DiscoCache reuseDiscoCache(GridKernalContext ctx,
         AffinityTopologyVersion topVer, DiscoCache discoCache) {
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /**


Mime
View raw message