ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [16/19] ignite git commit: Merge branch ignite-1.7.9 into ignite-2.0
Date Tue, 21 Mar 2017 09:16:48 GMT
Merge branch ignite-1.7.9 into ignite-2.0


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

Branch: refs/heads/ignite-4680-sb
Commit: 99bb87ae97153c3d2965ef8573b9efaf8b3e639a
Parents: 67bd32c bcb1398
Author: nikolay_tikhonov <ntikhonov@gridgain.com>
Authored: Mon Mar 20 18:22:03 2017 +0300
Committer: nikolay_tikhonov <ntikhonov@gridgain.com>
Committed: Mon Mar 20 18:22:35 2017 +0300

----------------------------------------------------------------------
 .../internal/managers/GridManagerAdapter.java   |   4 +
 .../cache/DynamicCacheChangeBatch.java          |  14 ++
 .../processors/query/GridQueryProcessor.java    |   3 +
 .../service/GridServiceProcessor.java           |  50 +++--
 .../org/apache/ignite/spi/IgniteSpiAdapter.java |   5 +
 .../org/apache/ignite/spi/IgniteSpiContext.java |   6 +
 .../ignite/spi/discovery/tcp/ClientImpl.java    |  32 +++-
 .../ignite/spi/discovery/tcp/ServerImpl.java    |  19 ++
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |   5 +
 .../tcp/internal/TcpDiscoveryNode.java          |   6 +-
 .../GridServiceContinuousQueryRedeployTest.java | 167 +++++++++++++++++
 ...veryNodeAttributesUpdateOnReconnectTest.java | 110 +++++++++++
 .../TcpDiscoverySslSecuredUnsecuredTest.java    | 185 +++++++++++++++++++
 .../tcp/TestReconnectPluginProvider.java        | 111 +++++++++++
 .../discovery/tcp/TestReconnectProcessor.java   |  93 ++++++++++
 .../testframework/GridSpiTestContext.java       |   5 +
 .../testsuites/IgniteKernalSelfTestSuite.java   |   2 +
 .../IgniteSpiDiscoverySelfTestSuite.java        |   5 +
 .../org.apache.ignite.plugin.PluginProvider     |   1 +
 .../processors/query/h2/IgniteH2Indexing.java   |   1 +
 parent/pom.xml                                  |   1 +
 21 files changed, 795 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/internal/managers/GridManagerAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index a58ca53,0a0d166..47341da
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@@ -29,8 -42,11 +29,11 @@@ import java.util.concurrent.ConcurrentM
  import javax.cache.Cache;
  import javax.cache.CacheException;
  import org.apache.ignite.IgniteCheckedException;
 +import org.apache.ignite.IgniteDataStreamer;
  import org.apache.ignite.IgniteException;
+ import org.apache.ignite.binary.BinaryField;
+ import org.apache.ignite.binary.BinaryObject;
+ import org.apache.ignite.binary.BinaryType;
  import org.apache.ignite.binary.Binarylizable;
  import org.apache.ignite.cache.CacheTypeMetadata;
  import org.apache.ignite.cache.QueryEntity;

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index a680a88,4eeafed..84fb8e3
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@@ -65,12 -65,12 +65,14 @@@ import org.apache.ignite.internal.proce
  import org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage;
  import org.apache.ignite.internal.processors.cache.CacheEntryImpl;
  import org.apache.ignite.internal.processors.cache.CacheIteratorConverter;
+ import org.apache.ignite.internal.processors.cache.DynamicCacheChangeBatch;
  import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 +import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
  import org.apache.ignite.internal.processors.cache.query.CacheQuery;
  import org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager;
 -import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
 +import org.apache.ignite.internal.processors.marshaller.MappingAcceptedMessage;
 +import org.apache.ignite.internal.processors.marshaller.MappingProposedMessage;
+ import org.apache.ignite.internal.processors.continuous.AbstractContinuousMessage;
  import org.apache.ignite.internal.processors.task.GridInternal;
  import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
  import org.apache.ignite.internal.util.GridEmptyIterator;
@@@ -1586,21 -1576,19 +1576,24 @@@ public class GridServiceProcessor exten
                          if (!((CacheAffinityChangeMessage)msg).exchangeNeeded())
                              return;
                      }
- 
-                     if (msg instanceof MappingProposedMessage || msg instanceof MappingAcceptedMessage)
+                     else if (msg instanceof DynamicCacheChangeBatch) {
+                         if (!((DynamicCacheChangeBatch)msg).exchangeNeeded())
+                             return;
+                     }
+                     else
                          return;
 +
 +                    topVer = ((DiscoveryCustomEvent)evt).affinityTopologyVersion();
                  }
                  else
 -                    topVer = new AffinityTopologyVersion(((DiscoveryEvent)evt).topologyVersion(),
0);
 +                    topVer = new AffinityTopologyVersion((evt).topologyVersion(), 0);
  
 -                depExe.submit(new BusyRunnable() {
 +                depExe.execute(new BusyRunnable() {
                      @Override public void run0() {
 -                        ClusterNode oldest = ctx.discovery().oldestAliveCacheServerNode(topVer);
 +                        // In case the cache instance isn't tracked by DiscoveryManager
anymore.
 +                        discoCache.updateAlives(ctx.discovery());
 +
 +                        ClusterNode oldest = discoCache.oldestAliveServerNodeWithCache();
  
                          if (oldest != null && oldest.isLocal()) {
                              final Collection<GridServiceDeployment> retries = new
ConcurrentLinkedQueue<>();

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiAdapter.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
----------------------------------------------------------------------
diff --cc modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
index 5c13449,95e2cda..04b076d
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ClientImpl.java
@@@ -629,11 -632,9 +633,11 @@@ class ClientImpl extends TcpDiscoveryIm
                      TcpDiscoveryNode node = locNode;
  
                      if (locNode.order() > 0)
-                         node = locNode.clientReconnectNode();
+                         node = locNode.clientReconnectNode(spi.spiCtx.nodeAttributes());
  
 -                    msg = new TcpDiscoveryJoinRequestMessage(node, spi.collectExchangeData(getLocalNodeId()));
 +                    msg = new TcpDiscoveryJoinRequestMessage(
 +                            node,
 +                            spi.collectExchangeData(new DiscoveryDataPacket(getLocalNodeId())));
                  }
                  else
                      msg = new TcpDiscoveryClientReconnectMessage(getLocalNodeId(), rmtNodeId,
lastMsgId);

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java
index 0000000,0000000..2437b47
new file mode 100644
--- /dev/null
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/service/GridServiceContinuousQueryRedeployTest.java
@@@ -1,0 -1,0 +1,167 @@@
++/*
++ * 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.processors.service;
++
++import java.util.ArrayList;
++import java.util.Collections;
++import java.util.List;
++import java.util.UUID;
++import java.util.concurrent.Callable;
++import javax.cache.event.CacheEntryEvent;
++import javax.cache.event.CacheEntryListenerException;
++import javax.cache.event.CacheEntryUpdatedListener;
++import org.apache.ignite.Ignite;
++import org.apache.ignite.IgniteCache;
++import org.apache.ignite.cache.query.ContinuousQuery;
++import org.apache.ignite.cache.query.QueryCursor;
++import org.apache.ignite.cluster.ClusterNode;
++import org.apache.ignite.internal.IgniteInternalFuture;
++import org.apache.ignite.internal.util.typedef.internal.U;
++import org.apache.ignite.lang.IgnitePredicate;
++import org.apache.ignite.resources.IgniteInstanceResource;
++import org.apache.ignite.services.Service;
++import org.apache.ignite.services.ServiceConfiguration;
++import org.apache.ignite.services.ServiceContext;
++import org.apache.ignite.testframework.GridTestUtils;
++import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
++
++/**
++ * Tests whether concurrent service cancel and registering ContinuousQuery doesn't causes
++ * service redeployment.
++ */
++public class GridServiceContinuousQueryRedeployTest extends GridCommonAbstractTest {
++    /** */
++    private static final String CACHE_NAME = "TEST_CACHE";
++
++    /** */
++    private static final String TEST_KEY = "TEST_KEY";
++
++    /** */
++    private static final String SERVICE_NAME = "service1";
++
++    /** {@inheritDoc} */
++    @Override protected void afterTest() throws Exception {
++        stopAllGrids();
++    }
++
++    /**
++     * @throws Exception If failed.
++     */
++    public void testServiceRedeploymentAfterCancel() throws Exception {
++        final Ignite ignite = startGrid(0);
++
++        final IgniteCache<Object, Object> managementCache = ignite.getOrCreateCache(CACHE_NAME);
++
++        final ContinuousQuery<Object, Object> qry = new ContinuousQuery<>();
++        final List<Object> evts = Collections.synchronizedList(new ArrayList<>());
++
++        qry.setLocalListener(new CacheEntryUpdatedListener<Object, Object>() {
++            @Override public void onUpdated(
++                Iterable<CacheEntryEvent<?, ?>> iterable) throws CacheEntryListenerException
{
++                for (CacheEntryEvent<?, ?> event : iterable)
++                    evts.add(event);
++            }
++        });
++
++        int iterations = 100;
++
++        while (iterations-- > 0) {
++            QueryCursor quorumCursor = managementCache.query(qry);
++
++            IgniteInternalFuture<?> fut1 = GridTestUtils.runAsync(new Callable<Object>()
{
++                @Override public Object call() throws Exception {
++                    System.out.println("Deploy " + SERVICE_NAME);
++                    deployService(ignite);
++
++                    return null;
++                }
++            });
++
++            IgniteInternalFuture<?> fut2 = GridTestUtils.runAsync(new Callable<Object>()
{
++                @Override public Object call() throws Exception {
++                    System.out.println("Undeploy " + SERVICE_NAME);
++                    ignite.services().cancel(SERVICE_NAME);
++
++                    return null;
++                }
++            });
++
++            fut1.get();
++            fut2.get();
++
++            U.sleep(100);
++
++            assert evts.size() <= 1 : evts.size();
++
++            ignite.services().cancel("service1");
++
++            evts.clear();
++
++            quorumCursor.close();
++        }
++
++    }
++
++    /**
++     * @param ignite Ignite.
++     */
++    private void deployService(final Ignite ignite) {
++        ServiceConfiguration svcCfg = new ServiceConfiguration();
++
++        svcCfg.setService(new ManagementService());
++        svcCfg.setName(SERVICE_NAME);
++        svcCfg.setTotalCount(1);
++        svcCfg.setMaxPerNodeCount(1);
++        svcCfg.setNodeFilter(new IgnitePredicate<ClusterNode>() {
++            @Override public boolean apply(ClusterNode node) {
++                return !node.isClient();
++            }
++        });
++
++        ignite.services().deploy(svcCfg);
++    }
++
++    /**
++     *
++     */
++    public static class ManagementService implements Service {
++        /** */
++        private final String name = UUID.randomUUID().toString();
++
++        /** */
++        @IgniteInstanceResource
++        private Ignite ignite;
++
++        /** {@inheritDoc} */
++        @Override public void cancel(ServiceContext ctx) {
++            System.out.println(name + " shutdown.");
++        }
++
++        /** {@inheritDoc} */
++        @Override public synchronized void init(ServiceContext ctx) throws Exception {
++            System.out.println(name + " initializing.");
++
++            ignite.cache(CACHE_NAME).put(TEST_KEY, name + " init");
++        }
++
++        /** {@inheritDoc} */
++        @Override public void execute(ServiceContext ctx) throws Exception {
++            // No-op
++        }
++    }
++}

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/test/java/org/apache/ignite/testframework/GridSpiTestContext.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
----------------------------------------------------------------------
diff --cc modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
index 41035ec,5977702..a0d37e9
--- a/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
+++ b/modules/core/src/test/java/org/apache/ignite/testsuites/IgniteKernalSelfTestSuite.java
@@@ -49,6 -50,7 +49,7 @@@ import org.apache.ignite.internal.proce
  import org.apache.ignite.internal.processors.cluster.GridUpdateNotifierSelfTest;
  import org.apache.ignite.internal.processors.port.GridPortProcessorSelfTest;
  import org.apache.ignite.internal.processors.service.GridServiceClientNodeTest;
 -import org.apache.ignite.internal.processors.service.GridServiceContinuousQueryRedeploy;
++import org.apache.ignite.internal.processors.service.GridServiceContinuousQueryRedeployTest;
  import org.apache.ignite.internal.processors.service.GridServicePackagePrivateSelfTest;
  import org.apache.ignite.internal.processors.service.GridServiceProcessorMultiNodeConfigSelfTest;
  import org.apache.ignite.internal.processors.service.GridServiceProcessorMultiNodeSelfTest;
@@@ -141,7 -144,7 +142,8 @@@ public class IgniteKernalSelfTestSuite 
          suite.addTestSuite(GridServiceProxyClientReconnectSelfTest.class);
          suite.addTestSuite(IgniteServiceReassignmentTest.class);
          suite.addTestSuite(IgniteServiceProxyTimeoutInitializedTest.class);
 -        suite.addTestSuite(GridServiceContinuousQueryRedeploy.class);
 +        suite.addTestSuite(IgniteServiceDynamicCachesSelfTest.class);
++        suite.addTestSuite(GridServiceContinuousQueryRedeployTest.class);
  
          suite.addTestSuite(IgniteServiceDeploymentClassLoadingDefaultMarshallerTest.class);
          suite.addTestSuite(IgniteServiceDeploymentClassLoadingOptimizedMarshallerTest.class);

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
diff --cc modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 6e75fd2,62b47b8..b0d3850
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@@ -84,9 -80,7 +84,10 @@@ import org.apache.ignite.internal.proce
  import org.apache.ignite.internal.processors.cache.QueryCursorImpl;
  import org.apache.ignite.internal.processors.cache.query.GridCacheQueryMarshallable;
  import org.apache.ignite.internal.processors.cache.query.GridCacheTwoStepQuery;
 +import org.apache.ignite.internal.processors.cache.query.IgniteQueryErrorCode;
 +import org.apache.ignite.internal.processors.query.GridQueryCacheObjectsIterator;
 +import org.apache.ignite.internal.processors.query.GridRunningQueryInfo;
+ import org.apache.ignite.internal.processors.query.GridRunningQueryInfo;
  import org.apache.ignite.internal.processors.query.GridQueryCancel;
  import org.apache.ignite.internal.processors.query.GridQueryFieldMetadata;
  import org.apache.ignite.internal.processors.query.GridQueryFieldsResult;

http://git-wip-us.apache.org/repos/asf/ignite/blob/99bb87ae/parent/pom.xml
----------------------------------------------------------------------


Mime
View raw message