You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/05/15 10:25:42 UTC

[13/14] ignite git commit: Merge remote-tracking branch 'remotes/origin/ignite-5075-cacheStart' into ignite-5075

Merge remote-tracking branch 'remotes/origin/ignite-5075-cacheStart' into ignite-5075

# Conflicts:
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java


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

Branch: refs/heads/ignite-5075
Commit: 5972cbd0d2d96b529f436a378af3c006f5f0729d
Parents: 9b850cc f5a5fa0
Author: sboikov <sb...@gridgain.com>
Authored: Mon May 15 13:23:41 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Mon May 15 13:23:41 2017 +0300

----------------------------------------------------------------------
 .../cache/CacheAffinitySharedManager.java       |  10 +-
 .../processors/cache/ClusterCachesInfo.java     |  22 +-
 .../cache/DynamicCacheDescriptor.java           |  47 +++-
 .../processors/cache/GridCacheAdapter.java      |  71 +----
 .../cache/GridCacheConcurrentMap.java           |   5 -
 .../cache/GridCacheConcurrentMapImpl.java       |  28 --
 .../processors/cache/GridCacheIoManager.java    |  13 +-
 .../processors/cache/GridCacheProxyImpl.java    |  60 ----
 .../processors/cache/GridNoStorageCacheMap.java |   5 -
 .../processors/cache/IgniteInternalCache.java   |  61 -----
 .../dht/GridCachePartitionedConcurrentMap.java  |   9 -
 .../distributed/dht/GridDhtCacheAdapter.java    | 162 -----------
 .../distributed/near/GridNearCacheAdapter.java  |  17 --
 .../GridCachePartitionedFullApiSelfTest.java    |  18 --
 .../cache/eviction/EvictionAbstractTest.java    |  13 +-
 .../hadoop/jobtracker/HadoopJobTracker.java     |  20 +-
 .../cache/hibernate/HibernateCacheProxy.java    |  25 --
 .../Apache.Ignite.Core.Tests.csproj             |   1 +
 .../Binary/BinarySelfTest.cs                    |   7 +-
 .../Binary/EnumsTest.cs                         | 274 +++++++++++++++++++
 .../Compute/ComputeApiTest.cs                   |   2 +-
 .../Impl/Binary/BinaryObject.cs                 |   2 +-
 .../Impl/Binary/BinaryReflectiveActions.cs      |   6 +-
 .../Impl/Binary/BinarySystemHandlers.cs         | 271 +++++++++---------
 .../Impl/Binary/BinaryUtils.cs                  |  30 --
 .../Impl/Binary/BinaryWriter.cs                 |  48 +++-
 modules/web-console/frontend/app/app.js         |   7 +-
 .../activities-user-dialog.tpl.pug              |  33 ++-
 .../cluster-select/cluster-select.pug           |   6 +-
 .../cluster-select/cluster-select.scss          |  30 ++
 .../app/components/cluster-select/index.js      |   1 +
 .../components/web-console-footer/component.js  |  23 ++
 .../app/components/web-console-footer/index.js  |  23 ++
 .../components/web-console-footer/style.scss    |  45 +++
 .../components/web-console-footer/template.pug  |  19 ++
 .../components/web-console-header/component.js  |  34 +++
 .../app/components/web-console-header/index.js  |  23 ++
 .../components/web-console-header/style.scss    | 127 +++++++++
 .../components/web-console-header/template.pug  |  25 ++
 .../app/modules/branding/branding.provider.js   |   2 +-
 .../modules/branding/header-title.directive.js  |   6 +-
 .../branding/powered-by-apache.directive.js     |   3 +-
 .../frontend/app/modules/states/signin.state.js |   2 +
 .../frontend/app/primitives/btn/index.scss      | 235 ++++++++++++++++
 .../frontend/app/primitives/index.js            |   2 +
 .../frontend/app/primitives/modal/index.scss    | 179 ++++++++++++
 .../frontend/app/primitives/table/index.scss    |  91 ++++++
 .../frontend/gulpfile.babel.js/paths.js         |   1 +
 .../frontend/public/images/ignite-logo.png      | Bin 1982 -> 0 bytes
 .../frontend/public/images/ignite-logo.svg      |  17 ++
 .../frontend/public/images/ignite-logo@2x.png   | Bin 3325 -> 0 bytes
 .../stylesheets/_bootstrap-variables.scss       |   4 +-
 .../frontend/public/stylesheets/style.scss      | 167 ++---------
 .../frontend/public/stylesheets/variables.scss  |   6 +
 modules/web-console/frontend/views/403.tpl.pug  |   8 +-
 modules/web-console/frontend/views/404.tpl.pug  |   8 +-
 modules/web-console/frontend/views/base.pug     |   8 +-
 modules/web-console/frontend/views/base2.pug    |   8 +-
 .../frontend/views/includes/footer.pug          |  23 --
 .../frontend/views/includes/header-left.pug     |  64 +++++
 .../frontend/views/includes/header-right.pug    |  40 +++
 .../frontend/views/includes/header.pug          |  57 ----
 modules/web-console/frontend/views/index.pug    |   2 +-
 .../web-console/frontend/views/reset.tpl.pug    |  12 +-
 .../web-console/frontend/views/signin.tpl.pug   |  14 +-
 parent/pom.xml                                  |   3 +-
 66 files changed, 1619 insertions(+), 966 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
index c3fc575,e10d385..0dab5ab
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheAffinitySharedManager.java
@@@ -383,71 -396,60 +383,72 @@@ public class CacheAffinitySharedManager
                      CU.affinityNode(cctx.localNode(), req.startCacheConfiguration().getNodeFilter());
              }
  
-             if (startCache)
+             if (startCache) {
                  cctx.cache().prepareCacheStart(cacheDesc, nearCfg, fut.topologyVersion());
  
-             if (fut.cacheAddedOnExchange(cacheDesc.cacheId(), cacheDesc.receivedFrom())) {
-                 if (fut.discoCache().cacheGroupAffinityNodes(cacheDesc.groupDescriptor().groupId()).isEmpty())
-                     U.quietAndWarn(log, "No server nodes found for cache client: " + req.cacheName());
+                 if (fut.cacheAddedOnExchange(cacheDesc.cacheId(), cacheDesc.receivedFrom())) {
 -                    if (fut.discoCache().cacheAffinityNodes(req.cacheName()).isEmpty())
++                    if (fut.discoCache().cacheGroupAffinityNodes(cacheDesc.groupDescriptor().groupId()).isEmpty())
+                         U.quietAndWarn(log, "No server nodes found for cache client: " + req.cacheName());
+                 }
              }
 +        }
  
 -            if (!crd || !lateAffAssign) {
 -                GridCacheContext cacheCtx = cctx.cacheContext(cacheDesc.cacheId());
 +        for (CacheGroupInfrastructure grp : cctx.cache().cacheGroups()) {
 +            if (grp.affinity().lastVersion().equals(AffinityTopologyVersion.NONE))
 +                initAffinity(registeredGrps.get(grp.groupId()), grp.affinity(), fut, false);
 +        }
  
 -                if (cacheCtx != null && !cacheCtx.isLocal()) {
 -                    boolean clientCacheStarted =
 -                        req.clientStartOnly() && req.initiatingNodeId().equals(cctx.localNodeId());
 +        if (crd) {
 +            for (ExchangeActions.ActionData action : exchActions.newAndClientCachesStartRequests())
 +                initStartedGroupOnCoordinator(fut, action.descriptor().groupDescriptor());
 +        }
  
 -                    if (clientCacheStarted)
 -                        initAffinity(cacheDesc, cacheCtx.affinity().affinityCache(), fut, lateAffAssign);
 -                    else if (!req.clientStartOnly()) {
 -                        GridAffinityAssignmentCache aff = cacheCtx.affinity().affinityCache();
 +        List<ExchangeActions.ActionData> closeReqs = exchActions.closeRequests(cctx.localNodeId());
  
 -                        assert aff.lastVersion().equals(AffinityTopologyVersion.NONE) : aff.lastVersion();
 +        for (ExchangeActions.ActionData req : closeReqs) {
 +            cctx.cache().blockGateway(req.request());
  
 -                        List<List<ClusterNode>> assignment = aff.calculate(fut.topologyVersion(),
 -                            fut.discoveryEvent(), fut.discoCache());
 +            if (crd) {
 +                CacheGroupInfrastructure grp = cctx.cache().cacheGroup(req.descriptor().groupDescriptor().groupId());
  
 -                        aff.initialize(fut.topologyVersion(), assignment);
 -                    }
 -                }
 -            }
 -            else
 -                initStartedCacheOnCoordinator(fut, cacheDesc.cacheId());
 -        }
 +                assert grp != null;
  
 -        for (DynamicCacheChangeRequest req : exchActions.closeRequests(cctx.localNodeId())) {
 -            Integer cacheId = CU.cacheId(req.cacheName());
 +                if (grp.affinityNode())
 +                    continue;
  
 -            cctx.cache().blockGateway(req);
 +                boolean grpClosed = false;
  
 -            if (crd) {
 -                GridCacheContext cacheCtx = cctx.cacheContext(cacheId);
 +                if (grp.sharedGroup()) {
 +                    boolean cacheRemaining = false;
 +
 +                    for (GridCacheContext ctx : cctx.cacheContexts()) {
 +                        if (ctx.group() == grp && !cacheClosed(ctx.cacheId(), closeReqs)) {
 +                            cacheRemaining = true;
 +
 +                            break;
 +                        }
 +                    }
 +
 +                    if (!cacheRemaining)
 +                        grpClosed = true;
 +                }
 +                else
 +                    grpClosed = true;
  
 -                // Client cache was stopped, need create 'client' CacheHolder.
 -                if (cacheCtx != null && !cacheCtx.affinityNode()) {
 -                    CacheHolder cache = caches.remove(cacheId);
 +                // All client cache groups were stopped, need create 'client' CacheGroupHolder.
 +                if (grpClosed) {
 +                    CacheGroupHolder grpHolder = grpHolders.remove(grp.groupId());
  
 -                    assert !cache.client() : cache;
 +                    if (grpHolder != null) {
 +                        assert !grpHolder.client() : grpHolder;
  
 -                    cache = CacheHolder2.create(cctx,
 -                        cctx.cache().cacheDescriptor(cacheId),
 -                        fut,
 -                        cache.affinity());
 +                        grpHolder = CacheGroupHolder2.create(cctx,
 +                            registeredGrps.get(grp.groupId()),
 +                            fut,
 +                            grp.affinity());
  
 -                    caches.put(cacheId, cache);
 +                        grpHolders.put(grp.groupId(), grpHolder);
 +                    }
                  }
              }
          }

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMap.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheConcurrentMapImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index d505825,fdd29e4..af9b99e
--- 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
@@@ -141,14 -146,19 +141,25 @@@ public class GridCacheIoManager extend
                  if (cacheMsg instanceof GridDhtAffinityAssignmentRequest) {
                      assert cacheMsg.topologyVersion() != null : cacheMsg;
  
 -                    AffinityTopologyVersion startTopVer = new AffinityTopologyVersion(cctx.localNode().order());
 +                    // TODO IGNITE-5075.
 +                    AffinityTopologyVersion waitVer = null;//cctx.affinity().localStartVersion(((GridDhtAffinityAssignmentRequest) cacheMsg).groupId());
  
 -                    DynamicCacheDescriptor cacheDesc = cctx.cache().cacheDescriptor(cacheMsg.cacheId());
 +                    if (waitVer == null)
 +                        waitVer = new AffinityTopologyVersion(cctx.localNode().order());
  
 -                    if (cacheDesc != null) {
 -                        if (cacheDesc.startTopologyVersion() != null)
 -                            startTopVer = cacheDesc.startTopologyVersion();
 -                        else if (cacheDesc.receivedFromStartVersion() != null)
 -                            startTopVer = cacheDesc.receivedFromStartVersion();
 -                    }
++//                    AffinityTopologyVersion startTopVer = new AffinityTopologyVersion(cctx.localNode().order());
++//
++//                    DynamicCacheDescriptor cacheDesc = cctx.cache().cacheDescriptor(cacheMsg.cacheId());
++//
++//                    if (cacheDesc != null) {
++//                        if (cacheDesc.startTopologyVersion() != null)
++//                            startTopVer = cacheDesc.startTopologyVersion();
++//                        else if (cacheDesc.receivedFromStartVersion() != null)
++//                            startTopVer = cacheDesc.receivedFromStartVersion();
++//                    }
+ 
                      // Need to wait for exchange to avoid race between cache start and affinity request.
-                     fut = cctx.exchange().affinityReadyFuture(waitVer);
+                     fut = cctx.exchange().affinityReadyFuture(startTopVer);
  
                      if (fut != null && !fut.isDone()) {
                          if (log.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridNoStorageCacheMap.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridCachePartitionedConcurrentMap.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtCacheAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/5972cbd0/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearCacheAdapter.java
----------------------------------------------------------------------