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/17 22:24:10 UTC

[13/15] 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/CacheClientReconnectDiscoveryData.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
#	modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java


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

Branch: refs/heads/ignite-5075
Commit: a7bc895111f1a9ed3868c83f55490fb64dc4eac8
Parents: 9c7f9f2 d20b76c
Author: sboikov <sb...@gridgain.com>
Authored: Wed May 17 23:12:36 2017 +0300
Committer: sboikov <sb...@gridgain.com>
Committed: Wed May 17 23:12:36 2017 +0300

----------------------------------------------------------------------
 assembly/LICENSE_FABRIC                         |  2 +-
 assembly/LICENSE_HADOOP                         |  2 +-
 .../managers/communication/GridIoManager.java   | 68 ++++++++++++----
 .../cache/CacheAffinitySharedManager.java       | 30 +++----
 .../CacheClientReconnectDiscoveryData.java      |  7 +-
 .../processors/cache/ClusterCachesInfo.java     | 18 +++--
 .../cache/DynamicCacheDescriptor.java           | 25 +++++-
 .../processors/cache/ExchangeActions.java       | 25 ++++--
 .../processors/cache/GridCacheProcessor.java    | 30 +++----
 .../continuous/CacheContinuousQueryHandler.java | 37 +++++----
 .../processors/hadoop/HadoopClasspathUtils.java |  3 +-
 .../CacheDiscoveryDataConcurrentJoinTest.java   | 13 ++-
 .../testsuites/IgniteCacheTestSuite4.java       | 16 +++-
 modules/hadoop/pom.xml                          |  2 +-
 .../ignite/impl/binary/binary_type_manager.h    |  6 +-
 .../src/impl/binary/binary_type_manager.cpp     | 83 +++++++++-----------
 .../cpp/core-test/src/cache_query_test.cpp      | 22 ++++++
 .../core/include/ignite/cache/query/query_sql.h |  8 ++
 .../ignite/cache/query/query_sql_fields.h       | 10 ++-
 .../query-example/src/query_example.cpp         |  6 +-
 .../Cache/MemoryMetricsTest.cs                  | 14 ++--
 .../frontend/gulpfile.babel.js/tasks/bundle.js  |  2 +-
 .../webpack/environments/development.js         |  5 +-
 23 files changed, 275 insertions(+), 159 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a7bc8951/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoManager.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7bc8951/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 37c17df,f53ff07..49b765f
--- 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
@@@ -453,25 -455,24 +452,25 @@@ public class CacheAffinitySharedManager
              }
          }
  
-         for (ExchangeActions.ActionData action : exchActions.stopRequests())
 -        Set<Integer> stoppedCaches = null;
 -
 -        for (ExchangeActions.ActionData action : exchActions.cacheStopRequests()) {
 -            DynamicCacheDescriptor desc = action.descriptor();
 -
++        for (ExchangeActions.ActionData action : exchActions.cacheStopRequests())
              cctx.cache().blockGateway(action.request());
  
 -            if (crd && desc.cacheConfiguration().getCacheMode() != LOCAL) {
 -                CacheHolder cache = caches.remove(desc.cacheId());
 +        Set<Integer> stoppedGrps = null;
  
 -                assert cache != null : action.request();
 +        if (crd) {
 +            for (CacheGroupDescriptor grpDesc : exchActions.cacheGroupsToStop()) {
 +                if (grpDesc.config().getCacheMode() != LOCAL) {
 +                    CacheGroupHolder cacheGrp = grpHolders.remove(grpDesc.groupId());
 +
 +                    assert cacheGrp != null : grpDesc;
  
 -                if (stoppedCaches == null)
 -                    stoppedCaches = new HashSet<>();
 +                    if (stoppedGrps == null)
 +                        stoppedGrps = new HashSet<>();
  
 -                stoppedCaches.add(cache.cacheId());
 +                    stoppedGrps.add(cacheGrp.groupId());
  
 -                cctx.io().removeHandler(desc.cacheId(), GridDhtAffinityAssignmentResponse.class);
 +                    cctx.io().removeHandler(true, cacheGrp.groupId(), GridDhtAffinityAssignmentResponse.class);
 +                }
              }
          }
  
@@@ -882,24 -869,24 +883,25 @@@
      }
  
      /**
 -     * @param desc Cache descriptor.
++     * @param desc Cache group descriptor.
       * @param aff Affinity.
       * @param fut Exchange future.
       * @return {@code True} if local node can calculate affinity on it's own for this partition map exchange.
       */
-     private boolean canCalculateAffinity(GridAffinityAssignmentCache aff, GridDhtPartitionsExchangeFuture fut) {
 -    private boolean canCalculateAffinity(DynamicCacheDescriptor desc,
++    private boolean canCalculateAffinity(CacheGroupDescriptor desc,
+         GridAffinityAssignmentCache aff,
+         GridDhtPartitionsExchangeFuture fut) {
 -        assert desc != null : aff.cacheName();
++        assert desc != null : aff.cacheOrGroupName();
+ 
          // Do not request affinity from remote nodes if affinity function is not centralized.
          if (!aff.centralizedAffinityFunction())
              return true;
  
          // If local node did not initiate exchange or local node is the only cache node in grid.
 -        Collection<ClusterNode> affNodes = cctx.discovery().cacheAffinityNodes(aff.cacheId(), fut.topologyVersion());
 +        Collection<ClusterNode> affNodes =
 +            cctx.discovery().cacheGroupAffinityNodes(aff.groupId(), fut.topologyVersion());
  
-         CacheGroupDescriptor grpDesc = registeredGrps.get(aff.groupId());
- 
-         assert grpDesc != null : aff.cacheOrGroupName();
- 
-         return fut.cacheGroupAddedOnExchange(aff.groupId(), grpDesc.receivedFrom()) ||
 -        return fut.cacheAddedOnExchange(aff.cacheId(), desc.receivedFrom()) ||
++        return fut.cacheGroupAddedOnExchange(aff.groupId(), desc.receivedFrom()) ||
              !fut.exchangeId().nodeId().equals(cctx.localNodeId()) ||
              (affNodes.size() == 1 && affNodes.contains(cctx.localNode()));
      }
@@@ -1107,14 -1089,14 +1109,14 @@@
       * @param fut Exchange future.
       * @throws IgniteCheckedException If failed.
       */
-     private void initCachesAffinity(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException {
+     private void initAffinityNoLateAssignment(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException {
          assert !lateAffAssign;
  
 -        for (GridCacheContext cacheCtx : cctx.cacheContexts()) {
 -            if (cacheCtx.isLocal())
 +        for (CacheGroupInfrastructure grp : cctx.cache().cacheGroups()) {
 +            if (grp.isLocal())
                  continue;
  
 -            initAffinity(registeredCaches.get(cacheCtx.cacheId()), cacheCtx.affinity().affinityCache(), fut, false);
 +            initAffinity(registeredGrps.get(grp.groupId()), grp.affinity(), fut, false);
          }
      }
  

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

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7bc8951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
index e824e09,28ec600..4938382
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java
@@@ -44,10 -44,8 +44,11 @@@ import org.apache.ignite.internal.util.
  import org.apache.ignite.internal.util.typedef.T2;
  import org.apache.ignite.internal.util.typedef.internal.CU;
  import org.apache.ignite.lang.IgniteInClosure;
 +import org.apache.ignite.lang.IgniteUuid;
  import org.apache.ignite.spi.discovery.DiscoveryDataBag;
+ 
 +import org.jetbrains.annotations.Nullable;
 +
  import static org.apache.ignite.cache.CacheMode.LOCAL;
  import static org.apache.ignite.cache.CacheMode.PARTITIONED;
  import static org.apache.ignite.events.EventType.EVT_NODE_JOINED;
@@@ -728,11 -629,7 +730,11 @@@ class ClusterCachesInfo 
          }
  
          for (CacheData cacheData : cachesData.caches().values()) {
 +            CacheGroupDescriptor grpDesc = registeredCacheGrps.get(cacheData.groupId());
 +
 +            assert grpDesc != null : cacheData.cacheConfiguration().getName();
 +
-             CacheConfiguration cfg = cacheData.cacheConfiguration();
+             CacheConfiguration<?, ?> cfg = cacheData.cacheConfiguration();
  
              DynamicCacheDescriptor desc = new DynamicCacheDescriptor(
                  ctx,
@@@ -882,23 -779,9 +886,23 @@@
          }
  
          for (CacheJoinNodeDiscoveryData.CacheInfo cacheInfo : joinData.caches().values()) {
-             CacheConfiguration cfg = cacheInfo.config();
+             CacheConfiguration<?, ?> cfg = cacheInfo.config();
  
              if (!registeredCaches.containsKey(cfg.getName())) {
 +                int cacheId = CU.cacheId(cfg.getName());
 +
 +                CacheGroupDescriptor grpDesc = registerCacheGroup(null,
 +                    null,
 +                    cfg,
 +                    cacheId,
 +                    nodeId,
 +                    joinData.cacheDeploymentId());
 +
 +                ctx.discovery().setCacheFilter(
 +                    grpDesc.groupId(),
 +                    cfg.getName(),
 +                    cfg.getNearConfiguration() != null);
 +
                  DynamicCacheDescriptor desc = new DynamicCacheDescriptor(ctx,
                      cfg,
                      cacheInfo.cacheType(),

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

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7bc8951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
index a765c1b,eac1120..dd4ce01
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ExchangeActions.java
@@@ -71,8 -64,8 +70,8 @@@ public class ExchangeActions 
       * @param nodeId Local node ID.
       * @return Close cache requests.
       */
-     public List<ActionData> closeRequests(UUID nodeId) {
 -    List<DynamicCacheChangeRequest> closeRequests(UUID nodeId) {
 -        List<DynamicCacheChangeRequest> res = null;
++    List<ActionData> closeRequests(UUID nodeId) {
 +        List<ActionData> res = null;
  
          if (cachesToClose != null) {
              for (ActionData req : cachesToClose.values()) {

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

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7bc8951/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/continuous/CacheContinuousQueryHandler.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/a7bc8951/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/CacheDiscoveryDataConcurrentJoinTest.java
----------------------------------------------------------------------