ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [19/35] ignite git commit: IGNITE-6213 Removed locDepOwner flag and marked as deprecated - Fixes #2723.
Date Fri, 22 Sep 2017 11:21:58 GMT
IGNITE-6213 Removed locDepOwner flag and marked as deprecated - Fixes #2723.

Signed-off-by: Alexey Goncharuk <alexey.goncharuk@gmail.com>


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

Branch: refs/heads/ignite-3479
Commit: 1649c532f828cef65c494ad7b008d9f1a8f3d605
Parents: 5af30cf
Author: Dmitriy Govorukhin <dmitriy.govorukhin@gmail.com>
Authored: Fri Sep 22 12:11:15 2017 +0300
Committer: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Committed: Fri Sep 22 12:11:15 2017 +0300

----------------------------------------------------------------------
 .../internal/GridEventConsumeHandler.java       |  9 +++-
 .../managers/deployment/GridDeploymentInfo.java |  1 +
 .../deployment/GridDeploymentInfoBean.java      | 21 +++-----
 .../cache/GridCacheDeploymentManager.java       | 54 ++++++--------------
 .../processors/cache/GridCacheIoManager.java    |  9 +++-
 .../continuous/CacheContinuousQueryHandler.java |  9 +++-
 6 files changed, 45 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1649c532/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
index 54e3d7f..ac568f0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/GridEventConsumeHandler.java
@@ -321,8 +321,13 @@ class GridEventConsumeHandler implements GridContinuousHandler {
                     GridDeploymentInfo depInfo = wrapper.depInfo;
 
                     if (depInfo != null) {
-                        depMgr.p2pContext(nodeId, depInfo.classLoaderId(), depInfo.userVersion(),
depInfo.deployMode(),
-                            depInfo.participants(), depInfo.localDeploymentOwner());
+                        depMgr.p2pContext(
+                            nodeId,
+                            depInfo.classLoaderId(),
+                            depInfo.userVersion(),
+                            depInfo.deployMode(),
+                            depInfo.participants()
+                        );
                     }
 
                     ldr = depMgr.globalLoader();

http://git-wip-us.apache.org/repos/asf/ignite/blob/1649c532/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfo.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfo.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfo.java
index b14fcce..3396d82 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfo.java
@@ -49,6 +49,7 @@ public interface GridDeploymentInfo {
     /**
      * @return Local deployment ownership flag.
      */
+    @Deprecated
     public boolean localDeploymentOwner();
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1649c532/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
index 68f45da..7f58ce3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentInfoBean.java
@@ -52,6 +52,7 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo,
Exte
     private String userVer;
 
     /** */
+    @Deprecated // Left for backward compatibility only.
     private boolean locDepOwner;
 
     /** Node class loader participant map. */
@@ -71,15 +72,17 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo,
Exte
      * @param userVer User version.
      * @param depMode Deployment mode.
      * @param participants Participants.
-     * @param locDepOwner Local deployment owner flag.
      */
-    public GridDeploymentInfoBean(IgniteUuid clsLdrId, String userVer, DeploymentMode depMode,
-        Map<UUID, IgniteUuid> participants, boolean locDepOwner) {
+    public GridDeploymentInfoBean(
+        IgniteUuid clsLdrId,
+        String userVer,
+        DeploymentMode depMode,
+        Map<UUID, IgniteUuid> participants
+    ) {
         this.clsLdrId = clsLdrId;
         this.depMode = depMode;
         this.userVer = userVer;
         this.participants = participants;
-        this.locDepOwner = locDepOwner;
     }
 
     /**
@@ -89,7 +92,6 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo,
Exte
         clsLdrId = dep.classLoaderId();
         depMode = dep.deployMode();
         userVer = dep.userVersion();
-        locDepOwner = dep.localDeploymentOwner();
         participants = dep.participants();
     }
 
@@ -123,15 +125,6 @@ public class GridDeploymentInfoBean implements Message, GridDeploymentInfo,
Exte
         return participants;
     }
 
-    /**
-     * Sets local deployment ownership flag.
-     *
-     * @param locDepOwner Local deployment ownership flag.
-     */
-    public void localDeploymentOwner(boolean locDepOwner) {
-        this.locDepOwner = locDepOwner;
-    }
-
     /** {@inheritDoc} */
     @Override public void onAckReceived() {
         // No-op.

http://git-wip-us.apache.org/repos/asf/ignite/blob/1649c532/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
index a1eb706..c40ed98 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheDeploymentManager.java
@@ -82,9 +82,6 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
     /** Local deployment. */
     private final AtomicReference<GridDeployment> locDep = new AtomicReference<>();
 
-    /** Local deployment ownership flag. */
-    private volatile boolean locDepOwner;
-
     /** */
     private final ThreadLocal<Boolean> ignoreOwnership = new ThreadLocal<Boolean>()
{
         @Override protected Boolean initialValue() {
@@ -150,7 +147,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
 
     /**
      * Gets distributed class loader. Note that
-     * {@link #p2pContext(UUID, IgniteUuid, String, DeploymentMode, Map, boolean)} must be
+     * {@link #p2pContext(UUID, IgniteUuid, String, DeploymentMode, Map)} must be
      * called from the same thread prior to using this class loader, or the
      * loading may happen for the wrong node or context.
      *
@@ -164,16 +161,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
      * Callback on method enter.
      */
     public void onEnter() {
-        if (depEnabled && !locDepOwner && !ignoreOwnership.get()
-            && !cctx.kernalContext().job().internal()) {
-            ClassLoader ldr = Thread.currentThread().getContextClassLoader();
-
-            // We mark node as deployment owner if accessing cache not from p2p deployed
job
-            // and not from internal job.
-            if (!U.p2pLoader(ldr))
-                // If not deployment class loader, classes can be loaded from this node.
-                locDepOwner = true;
-        }
+        // No-op.
     }
 
     /**
@@ -369,10 +357,14 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
      * @param userVer User version.
      * @param mode Deployment mode.
      * @param participants Node participants.
-     * @param locDepOwner {@code True} if local deployment owner.
      */
-    public void p2pContext(UUID sndId, IgniteUuid ldrId, String userVer, DeploymentMode mode,
-        Map<UUID, IgniteUuid> participants, boolean locDepOwner) {
+    public void p2pContext(
+        UUID sndId,
+        IgniteUuid ldrId,
+        String userVer,
+        DeploymentMode mode,
+        Map<UUID, IgniteUuid> participants
+    ) {
         assert depEnabled;
 
         if (mode == PRIVATE || mode == ISOLATED) {
@@ -414,7 +406,7 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
         if (log.isDebugEnabled())
             log.debug("Setting p2p context [sndId=" + sndId + ", ldrId=" +  ldrId + ", userVer="
+ userVer +
                 ", seqNum=" + ldrId.localId() + ", mode=" + mode + ", participants=" + participants
+
-                ", locDepOwner=" + locDepOwner + ']');
+                ", locDepOwner=false]");
 
         CachedDeploymentInfo<K, V> depInfo;
 
@@ -443,18 +435,10 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
             break;
         }
 
-        Map<UUID, IgniteUuid> added = null;
-
-        if (locDepOwner)
-            added = addGlobalParticipants(sndId, ldrId, participants, locDepOwner);
-
         if (cctx.discovery().node(sndId) == null) {
             // Sender has left.
             deps.remove(ldrId, depInfo);
 
-            if (added != null)
-                added.remove(sndId);
-
             allParticipants.remove(sndId);
         }
 
@@ -464,16 +448,11 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
                     if (depInfo.removeParticipant(id))
                         deps.remove(ldrId, depInfo);
 
-                    if (added != null)
-                        added.remove(id);
 
                     allParticipants.remove(id);
                 }
             }
         }
-
-        if (added != null && !added.isEmpty())
-            cctx.gridDeploy().addCacheParticipants(allParticipants, added);
     }
 
     /**
@@ -690,8 +669,6 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
                 if (locDep0 != null) {
                     // Will copy sequence number to bean.
                     dep = new GridDeploymentInfoBean(locDep0);
-
-                    dep.localDeploymentOwner(locDepOwner);
                 }
             }
 
@@ -709,9 +686,6 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
     @Nullable public GridDeploymentInfoBean globalDeploymentInfo() {
         assert depEnabled;
 
-        if (locDepOwner)
-            return null;
-
         // Do not return info if mode is CONTINUOUS.
         // In this case deployment info will be set by GridCacheMessage.prepareObject().
         if (cctx.gridConfig().getDeploymentMode() == CONTINUOUS)
@@ -729,8 +703,12 @@ public class GridCacheDeploymentManager<K, V> extends GridCacheSharedManagerAdap
                 for (UUID id : participants.keySet()) {
                     if (cctx.discovery().node(id) != null) {
                         // At least 1 participant is still in the grid.
-                        return new GridDeploymentInfoBean(d.loaderId(), d.userVersion(),
d.mode(),
-                            participants, locDepOwner);
+                        return new GridDeploymentInfoBean(
+                            d.loaderId(),
+                            d.userVersion(),
+                            d.mode(),
+                            participants
+                        );
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/ignite/blob/1649c532/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 6529795..e6e40e2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -1510,8 +1510,13 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter
{
             assert depEnabled : "Received deployment info while peer class loading is disabled
[nodeId=" + nodeId +
                 ", msg=" + cacheMsg + ']';
 
-            cctx.deploy().p2pContext(nodeId, bean.classLoaderId(), bean.userVersion(),
-                bean.deployMode(), bean.participants(), bean.localDeploymentOwner());
+            cctx.deploy().p2pContext(
+                nodeId,
+                bean.classLoaderId(),
+                bean.userVersion(),
+                bean.deployMode(),
+                bean.participants()
+            );
 
             if (log.isDebugEnabled())
                 log.debug("Set P2P context [senderId=" + nodeId + ", msg=" + cacheMsg + ']');

http://git-wip-us.apache.org/repos/asf/ignite/blob/1649c532/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
index 2b696a5..59b2a68 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
@@ -726,8 +726,13 @@ public class CacheContinuousQueryHandler<K, V> implements GridContinuousHandler
                 GridDeploymentInfo depInfo = e.deployInfo();
 
                 if (depInfo != null) {
-                    depMgr.p2pContext(nodeId, depInfo.classLoaderId(), depInfo.userVersion(),
depInfo.deployMode(),
-                        depInfo.participants(), depInfo.localDeploymentOwner());
+                    depMgr.p2pContext(
+                        nodeId,
+                        depInfo.classLoaderId(),
+                        depInfo.userVersion(),
+                        depInfo.deployMode(),
+                        depInfo.participants()
+                    );
                 }
             }
 


Mime
View raw message