Merge remote-tracking branch 'remotes/origin/master' 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/ClusterCachesInfo.java # modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/b74b7397 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/b74b7397 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/b74b7397 Branch: refs/heads/ignite-5075-pds Commit: b74b739755d62c3f5104bfdb65fa7d0319712e28 Parents: 3efd652 10a0a84 Author: sboikov <[email protected]> Authored: Wed May 31 10:35:08 2017 +0300 Committer: sboikov <[email protected]> Committed: Wed May 31 10:35:08 2017 +0300 ---------------------------------------------------------------------- .../jdbc2/JdbcAbstractDmlStatementSelfTest.java | 50 +- .../JdbcAbstractUpdateStatementSelfTest.java | 11 +- .../ignite/internal/jdbc2/JdbcBlobTest.java | 485 +++++++++++++++++++ .../jdbc2/JdbcInsertStatementSelfTest.java | 16 +- .../jdbc2/JdbcMergeStatementSelfTest.java | 16 +- .../jdbc2/JdbcPreparedStatementSelfTest.java | 47 ++ .../jdbc/suite/IgniteJdbcDriverTestSuite.java | 7 +- .../org/apache/ignite/internal/IgniteEx.java | 9 +- .../apache/ignite/internal/IgniteKernal.java | 19 +- .../apache/ignite/internal/jdbc2/JdbcBlob.java | 191 ++++++++ .../ignite/internal/jdbc2/JdbcConnection.java | 2 +- .../internal/jdbc2/JdbcPreparedStatement.java | 4 +- .../ignite/internal/jdbc2/JdbcResultSet.java | 8 +- .../internal/processors/cache/CacheData.java | 13 + .../cache/CacheJoinNodeDiscoveryData.java | 15 +- .../processors/cache/ClusterCachesInfo.java | 47 +- .../cache/DynamicCacheChangeRequest.java | 21 +- .../cache/DynamicCacheDescriptor.java | 13 + .../processors/cache/GridCacheAttributes.java | 14 +- .../processors/cache/GridCacheProcessor.java | 53 +- .../processors/cache/IgniteCacheProxy.java | 2 +- .../datastructures/DataStructuresProcessor.java | 1 + .../datastructures/GridCacheLockImpl.java | 10 +- .../processors/query/GridQueryProcessor.java | 6 +- .../internal/processors/query/QueryUtils.java | 14 +- .../handlers/cache/GridCacheCommandHandler.java | 2 +- .../ignite/spi/discovery/DiscoverySpi.java | 9 +- .../spi/discovery/tcp/TcpDiscoverySpi.java | 8 +- .../cache/IgniteDynamicCacheStartSelfTest.java | 4 +- .../processors/igfs/IgfsIgniteMock.java | 4 +- .../spi/discovery/tcp/TcpDiscoverySelfTest.java | 4 +- .../junits/multijvm/IgniteProcessProxy.java | 4 +- .../cache/index/H2DynamicTableSelfTest.java | 79 ++- .../query/IgniteSqlSchemaIndexingTest.java | 18 +- .../query/IgniteSqlSplitterSelfTest.java | 2 - modules/platforms/cpp/binary/Makefile.am | 67 +-- .../platforms/cpp/binary/include/Makefile.am | 55 +-- .../binary/include/ignite/binary/binary_type.h | 2 +- .../ignite/impl/binary/binary_type_impl.h | 61 +++ .../ignite/impl/binary/binary_writer_impl.h | 4 +- .../cpp/binary/project/vs/binary.vcxproj | 2 + .../binary/project/vs/binary.vcxproj.filters | 6 + .../binary/src/impl/binary/binary_type_impl.cpp | 61 +++ modules/platforms/cpp/common/Makefile.am | 54 +-- .../platforms/cpp/common/include/Makefile.am | 1 + .../common/include/ignite/common/cancelable.h | 65 +++ .../cpp/common/include/ignite/common/promise.h | 18 + .../common/include/ignite/common/shared_state.h | 51 ++ .../cpp/common/include/ignite/future.h | 60 ++- .../cpp/common/include/ignite/ignite_error.h | 3 + .../cpp/common/project/vs/common.vcxproj | 1 + .../common/project/vs/common.vcxproj.filters | 3 + modules/platforms/cpp/core-test/Makefile.am | 101 ++-- .../cpp/core-test/include/ignite/test_utils.h | 24 +- .../cpp/core-test/project/vs/core-test.vcxproj | 1 + .../project/vs/core-test.vcxproj.filters | 10 +- .../cpp/core-test/src/cache_invoke_test.cpp | 2 +- .../cpp/core-test/src/cluster_test.cpp | 2 +- .../cpp/core-test/src/compute_test.cpp | 337 +++++++++++++ .../cpp/core-test/src/continuous_query_test.cpp | 2 +- .../platforms/cpp/core-test/src/test_utils.cpp | 9 + modules/platforms/cpp/core/Makefile.am | 82 ++-- modules/platforms/cpp/core/include/Makefile.am | 107 ++-- .../cpp/core/include/ignite/cache/cache.h | 4 +- .../cpp/core/include/ignite/cache/query/query.h | 1 - .../cpp/core/include/ignite/compute/compute.h | 136 ++++++ .../core/include/ignite/compute/compute_func.h | 65 +++ .../platforms/cpp/core/include/ignite/ignite.h | 19 +- .../cpp/core/include/ignite/ignite_binding.h | 25 + .../include/ignite/ignite_binding_context.h | 2 +- .../cpp/core/include/ignite/impl/bindings.h | 24 + .../ignite/impl/cluster/cluster_group_impl.h | 31 +- .../ignite/impl/compute/cancelable_impl.h | 70 +++ .../include/ignite/impl/compute/compute_impl.h | 118 +++++ .../ignite/impl/compute/compute_job_holder.h | 139 ++++++ .../ignite/impl/compute/compute_job_result.h | 161 ++++++ .../ignite/impl/compute/compute_task_holder.h | 213 ++++++++ .../include/ignite/impl/ignite_binding_impl.h | 2 + .../include/ignite/impl/ignite_environment.h | 69 +++ .../cpp/core/include/ignite/impl/ignite_impl.h | 23 +- .../ignite/impl/interop/interop_target.h | 11 +- .../platforms/cpp/core/project/vs/core.vcxproj | 9 + .../cpp/core/project/vs/core.vcxproj.filters | 33 ++ modules/platforms/cpp/core/src/ignite.cpp | 5 + .../src/impl/cluster/cluster_group_impl.cpp | 23 +- .../core/src/impl/compute/cancelable_impl.cpp | 59 +++ .../cpp/core/src/impl/compute/compute_impl.cpp | 35 ++ .../cpp/core/src/impl/ignite_environment.cpp | 260 +++++++++- .../platforms/cpp/core/src/impl/ignite_impl.cpp | 15 +- .../core/src/impl/interop/interop_target.cpp | 20 + .../src/impl/transactions/transactions_impl.cpp | 10 - modules/platforms/cpp/examples/Makefile.am | 2 +- modules/platforms/cpp/examples/configure.ac | 2 +- .../cpp/examples/odbc-example/Makefile.am | 12 +- .../cpp/examples/project/vs/ignite-examples.sln | 12 +- .../cpp/examples/put-get-example/Makefile.am | 58 +++ .../put-get-example/config/example-cache.xml | 67 +++ .../project/vs/put-get-example.vcxproj | 110 +++++ .../project/vs/put-get-example.vcxproj.filters | 38 ++ .../put-get-example/src/put_get_example.cpp | 126 +++++ .../cpp/examples/putget-example/Makefile.am | 58 --- .../putget-example/config/example-cache.xml | 67 --- .../project/vs/putget-example.vcxproj | 110 ----- .../project/vs/putget-example.vcxproj.filters | 38 -- .../putget-example/src/putget_example.cpp | 126 ----- .../cpp/examples/query-example/Makefile.am | 12 +- .../platforms/cpp/jni/include/ignite/jni/java.h | 1 + modules/platforms/cpp/jni/src/java.cpp | 10 + .../StartupTest.cs | 78 +++ .../Apache.Ignite.Core.Tests.NuGet/TestUtil.cs | 30 ++ .../Apache.Ignite.Core.Tests.csproj | 9 + .../Binary/TypeNameParserTest.cs | 8 +- .../Compute/BinarizableClosureTaskTest.cs | 7 +- .../Compute/ClosureTaskTest.cs | 6 +- .../Compute/ComputeApiTest.cs | 20 +- .../Compute/IgniteExceptionTaskSelfTest.cs | 8 +- .../Compute/SerializableClosureTaskTest.cs | 5 +- .../Deployment/GetAddressFunc.cs | 35 ++ .../PeerAssemblyLoadingAllApisTest.cs | 167 +++++++ .../Deployment/PeerAssemblyLoadingTest.cs | 192 ++++++++ .../PeerAssemblyLoadingVersioningTest.cs | 164 +++++++ .../Deployment/ProcessNameFunc.cs | 50 ++ .../Deployment/ProcessNameTask.cs | 74 +++ .../Deployment/peer_assembly_app.config | 35 ++ .../IgniteConfigurationSerializerTest.cs | 10 +- .../Log/CustomLoggerTest.cs | 5 +- .../Process/IgniteProcess.cs | 12 +- .../Apache.Ignite.Core.csproj | 9 + .../Apache.Ignite.Core.nuspec | 7 +- .../Cache/Configuration/QueryEntity.cs | 4 +- .../Deployment/PeerAssemblyLoadingMode.cs | 55 +++ .../Apache.Ignite.Core/IgniteConfiguration.cs | 16 + .../IgniteConfigurationSection.xsd | 12 + .../dotnet/Apache.Ignite.Core/Ignition.cs | 18 +- .../Impl/Binary/BinarizableSerializer.cs | 5 +- .../Apache.Ignite.Core/Impl/Binary/Binary.cs | 1 + .../Binary/BinaryEqualityComparerSerializer.cs | 1 - .../Impl/Binary/BinaryProcessor.cs | 2 +- .../Impl/Binary/BinaryReader.cs | 66 ++- .../Impl/Binary/BinaryReflectiveActions.cs | 7 +- .../BinaryReflectiveSerializerInternal.cs | 5 +- .../Impl/Binary/BinarySystemTypeSerializer.cs | 2 +- .../Impl/Binary/BinaryWriter.cs | 24 + .../Impl/Binary/BinaryWriterExtensions.cs | 9 +- .../Impl/Binary/IBinarySerializerInternal.cs | 10 +- .../Impl/Binary/Marshaller.cs | 37 +- .../Impl/Binary/SerializableSerializer.cs | 14 +- .../Impl/Binary/TypeResolver.cs | 6 +- .../Impl/Binary/UserSerializerProxy.cs | 5 +- .../Common/CopyOnWriteConcurrentDictionary.cs | 8 - .../Apache.Ignite.Core/Impl/Common/Future.cs | 13 +- .../Impl/Common/IgniteHome.cs | 3 +- .../Impl/Common/LoadedAssembliesResolver.cs | 8 +- .../Impl/Compute/Closure/ComputeActionJob.cs | 7 +- .../Impl/Compute/Closure/ComputeFuncJob.cs | 5 +- .../Impl/Compute/ComputeFunc.cs | 5 +- .../Impl/Compute/ComputeImpl.cs | 1 - .../Impl/Compute/ComputeJob.cs | 3 +- .../Impl/Compute/ComputeOutFunc.cs | 3 +- .../Impl/Deployment/AssemblyLoader.cs | 105 ++++ .../Impl/Deployment/AssemblyRequest.cs | 68 +++ .../Impl/Deployment/AssemblyRequestResult.cs | 80 +++ .../Impl/Deployment/GetAssemblyFunc.cs | 77 +++ .../Impl/Deployment/PeerAssemblyResolver.cs | 189 ++++++++ .../Impl/Deployment/PeerLoadingExtensions.cs | 65 +++ .../Impl/Deployment/PeerLoadingObjectHolder.cs | 90 ++++ .../PeerLoadingObjectHolderSerializer.cs | 49 ++ modules/platforms/dotnet/Apache.Ignite.FxCop | 3 +- .../platforms/dotnet/Apache.Ignite/App.config | 11 + modules/spring/pom.xml | 7 + .../apache/ignite/cache/spring/SpringCache.java | 60 ++- .../ignite/cache/spring/SpringCacheManager.java | 51 +- .../GridSpringCacheManagerMultiJvmSelfTest.java | 134 +++++ .../GridSpringDynamicCacheTestService.java | 13 + .../ignite/cache/spring/SpringCacheTest.java | 2 +- .../ignite/cache/spring/spring-caching1.xml | 56 +++ .../ignite/cache/spring/spring-caching2.xml | 56 +++ 177 files changed, 6265 insertions(+), 967 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheData.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/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 287a30d,7ff5622..1978f9e --- 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 @@@ -117,9 -112,7 +117,9 @@@ class ClusterCachesInfo CacheData cacheData = gridData.caches().get(locCfg.getName()); if (cacheData != null) - checkCache(locCfg, cacheData.cacheConfiguration(), cacheData.receivedFrom()); + checkCache(locCacheInfo, cacheData, cacheData.receivedFrom()); + + validateStartCacheConfiguration(locCfg); } } @@@ -142,9 -136,9 +143,12 @@@ CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cacheMode", "Cache mode", locAttr.cacheMode(), rmtAttr.cacheMode(), true); + CU.checkAttributeMismatch(log, rmtCfg.getGroupName(), rmt, "groupName", "Cache group name", + locCfg.getGroupName(), rmtCfg.getGroupName(), true); + + CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "sql", "SQL flag", + locAttr.sql(), rmtAttr.sql(), true); + if (rmtAttr.cacheMode() != LOCAL) { CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "interceptor", "Cache Interceptor", locAttr.interceptorClassName(), rmtAttr.interceptorClassName(), true); @@@ -155,13 -149,10 +159,13 @@@ CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "cachePreloadMode", "Cache preload mode", locAttr.cacheRebalanceMode(), rmtAttr.cacheRebalanceMode(), true); + CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "topologyValidator", + "Cache topology validator", locAttr.topologyValidatorClassName(), rmtAttr.topologyValidatorClassName(), true); + ClusterNode rmtNode = ctx.discovery().node(rmt); - if (CU.affinityNode(ctx.discovery().localNode(), locCfg.getNodeFilter()) - && rmtNode != null && CU.affinityNode(rmtNode, rmtCfg.getNodeFilter())) { + if (CU.affinityNode(ctx.discovery().localNode(), locInfo.config().getNodeFilter()) + && rmtNode != null && CU.affinityNode(rmtNode, rmtData.cacheConfiguration().getNodeFilter())) { CU.checkAttributeMismatch(log, rmtAttr.cacheName(), rmt, "storeFactory", "Store factory", locAttr.storeFactoryClassName(), rmtAttr.storeFactoryClassName(), true); } @@@ -397,10 -380,28 +403,26 @@@ } } else if (req.stop()) { - assert req.stop() ^ req.close() : req; - if (desc != null) { + if (req.sql() && !desc.sql()) { + ctx.cache().completeCacheStartFuture(req, false, + new IgniteCheckedException("Only cache created with CREATE TABLE may be removed with " + + "DROP TABLE [cacheName=" + req.cacheName() + ']')); + + continue; + } + + if (!req.sql() && desc.sql()) { + ctx.cache().completeCacheStartFuture(req, false, + new IgniteCheckedException("Only cache created with cache API may be removed with " + + "direct call to destroyCache [cacheName=" + req.cacheName() + ']')); + + continue; + } + DynamicCacheDescriptor old = registeredCaches.remove(req.cacheName()); - assert old != null : "Dynamic cache map was concurrently modified [req=" + req + ']'; + assert old != null && old == desc : "Dynamic cache map was concurrently modified [req=" + req + ']'; ctx.discovery().removeCacheFilter(req.cacheName()); http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/DynamicCacheDescriptor.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java ---------------------------------------------------------------------- diff --cc modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java index a9ad353,4af2518..ed695dc --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAttributes.java @@@ -273,20 -278,13 +278,27 @@@ public class GridCacheAttributes implem } /** + * @return Node filter class name. + */ + String nodeFilterClassName() { + return className(ccfg.getNodeFilter()); + } + + /** + * @return Topology validator class name. + */ + String topologyValidatorClassName() { + return className(ccfg.getTopologyValidator()); + } + + /** + * @return SQL flag. + */ + public boolean sql() { + return sql; + } + + /** * @param obj Object to get class of. * @return Class name or {@code null}. */ http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheProcessor.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/b74b7397/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryUtils.java ----------------------------------------------------------------------
