Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EE3CE200C56 for ; Fri, 14 Apr 2017 13:44:18 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ECBD8160B8C; Fri, 14 Apr 2017 11:44:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id ECE88160B80 for ; Fri, 14 Apr 2017 13:44:16 +0200 (CEST) Received: (qmail 60572 invoked by uid 500); 14 Apr 2017 11:44:16 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 60562 invoked by uid 99); 14 Apr 2017 11:44:16 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Apr 2017 11:44:16 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 040D7DFDAC; Fri, 14 Apr 2017 11:44:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: ptupitsyn@apache.org To: commits@ignite.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: ignite git commit: IGNITE-4983 .NET: Remove .NET-only cache plugins Date: Fri, 14 Apr 2017 11:44:15 +0000 (UTC) archived-at: Fri, 14 Apr 2017 11:44:19 -0000 Repository: ignite Updated Branches: refs/heads/master 4e6de2a38 -> 44a8f9389 IGNITE-4983 .NET: Remove .NET-only cache plugins Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/44a8f938 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/44a8f938 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/44a8f938 Branch: refs/heads/master Commit: 44a8f93892fd44aef934e6cbb7bf5e9f616df42c Parents: 4e6de2a Author: Pavel Tupitsyn Authored: Fri Apr 14 14:44:08 2017 +0300 Committer: Pavel Tupitsyn Committed: Fri Apr 14 14:44:08 2017 +0300 ---------------------------------------------------------------------- .../callback/PlatformCallbackGateway.java | 68 ------ .../cache/PlatformCachePluginProvider.java | 121 ---------- .../Apache.Ignite.Core.Tests.csproj | 3 - .../Cache/CacheConfigurationTest.cs | 2 +- .../IgniteConfigurationSerializerTest.cs | 8 +- .../Plugin/Cache/CachePlugin.cs | 127 ----------- .../Plugin/Cache/CachePluginConfiguration.cs | 64 ------ .../Plugin/Cache/CachePluginTest.cs | 218 ------------------- .../Apache.Ignite.Core.csproj | 7 - .../Impl/Plugin/Cache/CachePluginContext.cs | 82 ------- .../Impl/Plugin/Cache/CachePluginProcessor.cs | 77 ------- .../Plugin/Cache/CachePluginProviderProxy.cs | 75 ------- .../Plugin/Cache/ICachePluginProviderProxy.cs | 52 ----- .../Impl/Unmanaged/UnmanagedCallbackOp.cs | 4 - .../Impl/Unmanaged/UnmanagedCallbacks.cs | 56 +---- .../Cache/CachePluginProviderTypeAttribute.cs | 52 ----- .../Plugin/Cache/ICachePluginConfiguration.cs | 21 -- .../Plugin/Cache/ICachePluginContext.cs | 47 ---- .../Plugin/Cache/ICachePluginProvider.cs | 52 ----- 19 files changed, 6 insertions(+), 1130 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java index f195c02..7a5c0a4 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/callback/PlatformCallbackGateway.java @@ -1156,74 +1156,6 @@ public class PlatformCallbackGateway { } /** - * Create cache plugin. - * - * @param memPtr Memory pointer. - * @return Pointer. - */ - public long cachePluginCreate(long memPtr) { - enter(); - - try { - return PlatformCallbackUtils.inLongOutLong(envPtr, PlatformCallbackOp.CachePluginCreate, memPtr); - } - finally { - leave(); - } - } - - /** - * Notify cache plugin on ignite start. - * - * @param objPtr Object pointer. - */ - public void cachePluginIgniteStart(long objPtr) { - enter(); - - try { - PlatformCallbackUtils.inLongOutLong(envPtr, PlatformCallbackOp.CachePluginIgniteStart, objPtr); - } - finally { - leave(); - } - } - - /** - * Notify cache plugin on ignite start. - * - * @param objPtr Object pointer. - */ - public void cachePluginIgniteStop(long objPtr, boolean cancel) { - enter(); - - try { - PlatformCallbackUtils.inLongLongLongObjectOutLong(envPtr, PlatformCallbackOp.CachePluginIgniteStop, objPtr, - cancel ? 1 : 0, 0, null); - } - finally { - leave(); - } - } - - /** - * Destroy cache plugin. - * - * @param objPtr Object pointer. - */ - public void cachePluginDestroy(long objPtr, boolean cancel) { - if (!lock.enterBusy()) - return; // no need to destroy plugins on grid stop - - try { - PlatformCallbackUtils.inLongLongLongObjectOutLong(envPtr, PlatformCallbackOp.CachePluginDestroy, - objPtr, cancel ? 1 : 0, 0, null); - } - finally { - leave(); - } - } - - /** * Invoke plugin callback by id. * * @param callbackId Id of a callback registered in Platform. http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/plugin/cache/PlatformCachePluginProvider.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/plugin/cache/PlatformCachePluginProvider.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/plugin/cache/PlatformCachePluginProvider.java deleted file mode 100644 index 3e3b223..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/plugin/cache/PlatformCachePluginProvider.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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.platform.plugin.cache; - -import javax.cache.Cache; -import org.apache.ignite.IgniteCheckedException; -import org.apache.ignite.cluster.ClusterNode; -import org.apache.ignite.configuration.CacheConfiguration; -import org.apache.ignite.internal.binary.BinaryRawWriterEx; -import org.apache.ignite.internal.processors.platform.PlatformContext; -import org.apache.ignite.internal.processors.platform.memory.PlatformMemory; -import org.apache.ignite.internal.processors.platform.memory.PlatformOutputStream; -import org.apache.ignite.internal.processors.platform.utils.PlatformConfigurationUtils; -import org.apache.ignite.internal.processors.platform.utils.PlatformUtils; -import org.apache.ignite.plugin.CachePluginContext; -import org.apache.ignite.plugin.CachePluginProvider; -import org.jetbrains.annotations.Nullable; - -/** - * Platform cache plugin provider. - */ -class PlatformCachePluginProvider implements CachePluginProvider { - /** Context. */ - private final CachePluginContext ctx; - - /** Native config. */ - private final Object nativeCfg; - - /** Pointer to native plugin. */ - protected long ptr; - - /** - * Ctor. - * - * @param ctx Context. - */ - PlatformCachePluginProvider(CachePluginContext ctx, Object nativeCfg) { - assert ctx != null; - assert nativeCfg != null; - - this.ctx = ctx; - this.nativeCfg = nativeCfg; - } - - /** {@inheritDoc} */ - @Override public void start() throws IgniteCheckedException { - PlatformContext platformCtx = PlatformUtils.platformContext(ctx.grid()); - - try (PlatformMemory mem = platformCtx.memory().allocate()) { - PlatformOutputStream out = mem.output(); - - BinaryRawWriterEx writer = platformCtx.writer(out); - - writer.writeObjectDetached(nativeCfg); - - PlatformConfigurationUtils.writeIgniteConfiguration(writer, ctx.igniteConfiguration()); - PlatformConfigurationUtils.writeCacheConfiguration(writer, ctx.igniteCacheConfiguration()); - - out.synchronize(); - - ptr = platformCtx.gateway().cachePluginCreate(mem.pointer()); - } - } - - /** {@inheritDoc} */ - @Override public void stop(boolean cancel) { - PlatformContext platformCtx = PlatformUtils.platformContext(ctx.grid()); - - platformCtx.gateway().cachePluginDestroy(ptr, cancel); - } - - /** {@inheritDoc} */ - @Override public void onIgniteStart() throws IgniteCheckedException { - PlatformContext platformCtx = PlatformUtils.platformContext(ctx.grid()); - - platformCtx.gateway().cachePluginIgniteStart(ptr); - } - - /** {@inheritDoc} */ - @Override public void onIgniteStop(boolean cancel) { - PlatformContext platformCtx = PlatformUtils.platformContext(ctx.grid()); - - platformCtx.gateway().cachePluginIgniteStop(ptr, cancel); - } - - /** {@inheritDoc} */ - @Override public void validate() throws IgniteCheckedException { - // No-op. - } - - /** {@inheritDoc} */ - @Override public void validateRemote(CacheConfiguration locCfg, CacheConfiguration rmtCfg, ClusterNode rmtNode) - throws IgniteCheckedException { - // No-op. - } - - /** {@inheritDoc} */ - @Nullable @Override public Object unwrapCacheEntry(Cache.Entry entry, Class cls) { - return null; - } - - /** {@inheritDoc} */ - @Nullable @Override public Object createComponent(Class cls) { - return null; - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj index 2e81781..838a1e0 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj @@ -104,9 +104,6 @@ - - - http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs index e63e203..1fd7d05 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs @@ -547,7 +547,7 @@ namespace Apache.Ignite.Core.Tests.Cache }, ExpiryPolicyFactory = new ExpiryFactory(), EnableStatistics = true, - PluginConfigurations = new[] { new CachePluginConfiguration() } + PluginConfigurations = new[] { new CacheJavaPluginConfiguration() } }; } /// http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs index 96858f7..b22b78d 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs @@ -114,7 +114,7 @@ namespace Apache.Ignite.Core.Tests - + @@ -241,8 +241,8 @@ namespace Apache.Ignite.Core.Tests Assert.IsNotNull(plugins); Assert.IsNotNull(plugins.Cast().SingleOrDefault()); - var cachePlugCfg = cacheCfg.PluginConfigurations.Cast().Single(); - Assert.AreEqual("baz", cachePlugCfg.TestProperty); + var cachePlugCfg = cacheCfg.PluginConfigurations.Cast().Single(); + Assert.AreEqual("baz", cachePlugCfg.Foo); var eventStorage = cfg.EventStorageSpi as MemoryEventStorageSpi; Assert.IsNotNull(eventStorage); @@ -678,7 +678,7 @@ namespace Apache.Ignite.Core.Tests EnableStatistics = true, PluginConfigurations = new[] { - new CachePluginConfiguration() + new CacheJavaPluginConfiguration() } } }, http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePlugin.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePlugin.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePlugin.cs deleted file mode 100644 index dcc53ca..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePlugin.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Tests.Plugin.Cache -{ - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.IO; - using Apache.Ignite.Core.Plugin.Cache; - using NUnit.Framework; - - /// - /// Test cache plugin. - /// - public class CachePlugin : ICachePluginProvider - { - /** */ - private static readonly ConcurrentDictionary Instances = - new ConcurrentDictionary(); - - /// - /// Gets the instances. - /// - public static IEnumerable GetInstances() - { - return Instances.Keys; - } - - /// - /// Initializes a new instance of the class. - /// - public CachePlugin() - { - Assert.IsTrue(Instances.TryAdd(this, null)); - } - - /** */ - public void Start(ICachePluginContext cachePluginContext) - { - Context = cachePluginContext; - Started = true; - - Assert.IsNotNull(Context); - Assert.IsNotNull(Context.IgniteConfiguration); - Assert.IsNotNull(Context.CachePluginConfiguration); - Assert.IsNotNull(Context.CacheConfiguration); - Assert.IsNotNull(Context.Ignite); - - // Check that Ignite is operational. - Assert.GreaterOrEqual(2, Context.Ignite.GetCluster().GetNodes().Count); - - Throw(); - } - - /** */ - public void Stop(bool cancel) - { - Stopped = cancel; - - object unused; - Assert.IsTrue(Instances.TryRemove(this, out unused)); - } - - /** */ - public void OnIgniteStart() - { - // Check that Ignite is operational. - Assert.GreaterOrEqual(2, Context.Ignite.GetCluster().GetNodes().Count); - - IgniteStarted = true; - } - - /** */ - public void OnIgniteStop(bool cancel) - { - IgniteStopped = cancel; - } - - /// - /// Gets or sets a value indicating whether this is started. - /// - public bool Started { get; private set; } - - /// - /// Gets or sets a value indicating whether this is started. - /// - public bool IgniteStarted { get; private set; } - - /// - /// Gets or sets a value indicating whether this is stopped. - /// - public bool? Stopped { get; private set; } - - /// - /// Gets or sets a value indicating whether this is stopped. - /// - public bool? IgniteStopped { get; private set; } - - /// - /// Gets the context. - /// - public ICachePluginContext Context { get; private set; } - - /// - /// Throws an error when configured. - /// - private void Throw() - { - if (Context.CachePluginConfiguration.ThrowError) - throw new IOException("Failure in cache plugin provider"); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginConfiguration.cs deleted file mode 100644 index 72220ff..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginConfiguration.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Tests.Plugin.Cache -{ - using System; - using Apache.Ignite.Core.Binary; - using Apache.Ignite.Core.Plugin.Cache; - using NUnit.Framework; - - /// - /// Cache plugin config. - /// - [Serializable] - [CachePluginProviderType(typeof(CachePlugin))] - public class CachePluginConfiguration : ICachePluginConfiguration - { - /// - /// Gets or sets the test property. - /// - public string TestProperty { get; set; } - - /// - /// Gets or sets a value indicating whether the plugin should throw an error. - /// - // ReSharper disable once UnusedAutoPropertyAccessor.Global - public bool ThrowError { get; set; } - - /// - /// Gets the id to locate PlatformCachePluginConfigurationClosureFactory on Java side - /// and read the data written by - /// method. - /// - public int? CachePluginConfigurationClosureFactoryId - { - get { return null; } - } - - /// - /// Writes this instance to a raw writer. - /// This method will be called when - /// is not null to propagate configuration to the Java side. - /// - /// The writer. - public void WriteBinary(IBinaryRawWriter writer) - { - Assert.Fail("Should not be called"); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginTest.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginTest.cs deleted file mode 100644 index 2ef8bb2..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Plugin/Cache/CachePluginTest.cs +++ /dev/null @@ -1,218 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Tests.Plugin.Cache -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Apache.Ignite.Core.Binary; - using Apache.Ignite.Core.Cache; - using Apache.Ignite.Core.Cache.Configuration; - using Apache.Ignite.Core.Plugin.Cache; - using NUnit.Framework; - - /// - /// Tests for cache plugins. - /// - public class CachePluginTest - { - /** */ - private const string CacheName = "staticCache"; - - /** */ - private const string DynCacheName = "dynamicCache"; - - /** */ - private IIgnite _grid1; - - /** */ - private IIgnite _grid2; - - /** */ - private readonly List _plugins = new List(); - - /// - /// Fixture set up. - /// - [TestFixtureSetUp] - public void FixtureSetUp() - { - _plugins.Clear(); - - _grid1 = Ignition.Start(GetConfig("grid1")); - _grid2 = Ignition.Start(GetConfig("grid2")); - } - - /// - /// Fixture tear down. - /// - [TestFixtureTearDown] - public void FixtureTearDown() - { - // One plugin is expected in registry. - TestUtils.AssertHandleRegistryHasItems(10, 1, _grid1, _grid2); - - Ignition.StopAll(true); - - // Check IgniteStop callbacks. - foreach (var plugin in _plugins) - { - Assert.AreEqual(true, plugin.IgniteStopped); - } - } - - /// - /// Tests with static cache. - /// - [Test] - public void TestStaticCache() - { - foreach (var ignite in new[] {_grid1, _grid2}) - { - var plugin = CheckCachePlugin(ignite, CacheName, "foo"); - - _plugins.Add(plugin); - } - } - - /// - /// Tests with dynamic cache. - /// - [Test] - public void TestDynamicCache() - { - var cacheConfig = new CacheConfiguration(DynCacheName) - { - PluginConfigurations = new[] {new CachePluginConfiguration {TestProperty = "bar"}} - }; - - _grid1.CreateCache(cacheConfig); - - var plugins = new List(); - - foreach (var ignite in new[] { _grid1, _grid2 }) - { - var plugin = CheckCachePlugin(ignite, DynCacheName, "bar"); - - plugins.Add(plugin); - } - - // Destroy cache to remove plugin from handle registry. - _grid1.DestroyCache(DynCacheName); - - foreach (var plugin in plugins) - { - Assert.AreEqual(true, plugin.Stopped); - Assert.AreEqual(true, plugin.IgniteStopped); // This is weird, but correct from Java logic POV. - } - } - - /// - /// Non-serializable plugin config results in a meaningful exception. - /// - [Test] - public void TestNonSerializablePlugin() - { - var ex = Assert.Throws(() => _grid1.CreateCache(new CacheConfiguration - { - PluginConfigurations = new[] {new NonSerializableCachePluginConfig()} - })); - - Assert.AreEqual("Invalid cache configuration: ICachePluginConfiguration should be Serializable.", - ex.Message); - } - - /// - /// Errors in plugin configuration result in meaningful exception. - /// - [Test] - [Ignore("IGNITE-4474 Ignite.createCache hangs on exception in CachePluginConfiguration.createProvider")] - public void TestErrorInPlugin() - { - // Throws exception. - var cacheEx = Assert.Throws(() => _grid1.CreateCache(new CacheConfiguration - { - PluginConfigurations = new[] { new ThrowCachePluginConfig() } - })); - - Assert.AreEqual("hi!", cacheEx.Message); - } - - /// - /// Checks the cache plugin. - /// - private static CachePlugin CheckCachePlugin(IIgnite ignite, string cacheName, string propValue) - { - // Check config. - var plugCfg = ignite.GetCache(cacheName).GetConfiguration() - .PluginConfigurations.Cast().Single(); - Assert.AreEqual(propValue, plugCfg.TestProperty); - - // Check started plugin. - var plugin = CachePlugin.GetInstances().Single(x => x.Context.Ignite == ignite && - x.Context.CacheConfiguration.Name == cacheName); - Assert.IsTrue(plugin.Started); - Assert.IsTrue(plugin.IgniteStarted); - Assert.IsNull(plugin.Stopped); - Assert.IsNull(plugin.IgniteStopped); - - var ctx = plugin.Context; - Assert.AreEqual(ignite.Name, ctx.IgniteConfiguration.IgniteInstanceName); - Assert.AreEqual(cacheName, ctx.CacheConfiguration.Name); - Assert.AreEqual(propValue, ctx.CachePluginConfiguration.TestProperty); - - return plugin; - } - - /// - /// Gets the configuration. - /// - private static IgniteConfiguration GetConfig(string name) - { - return new IgniteConfiguration(TestUtils.GetTestConfiguration()) - { - IgniteInstanceName = name, - CacheConfiguration = new[] - { - new CacheConfiguration(CacheName) - { - PluginConfigurations = new[] - { - new CachePluginConfiguration {TestProperty = "foo"} - } - } - } - }; - } - - [CachePluginProviderType(typeof(CachePlugin))] - private class NonSerializableCachePluginConfig : ICachePluginConfiguration - { - public int? CachePluginConfigurationClosureFactoryId { get { return null; } } - public void WriteBinary(IBinaryRawWriter writer) { /* No-op. */ } - } - - [Serializable] - [CachePluginProviderType(typeof(string))] - private class ThrowCachePluginConfig : ICachePluginConfiguration - { - public int? CachePluginConfigurationClosureFactoryId { get { return null; } } - public void WriteBinary(IBinaryRawWriter writer) { /* No-op. */ } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj index 908a192..e8e9329 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Apache.Ignite.Core.csproj @@ -420,14 +420,10 @@ - - - - @@ -484,7 +480,6 @@ - @@ -492,8 +487,6 @@ - - http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginContext.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginContext.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginContext.cs deleted file mode 100644 index ffc74c0..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginContext.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Impl.Plugin.Cache -{ - using System.Diagnostics; - using Apache.Ignite.Core.Cache.Configuration; - using Apache.Ignite.Core.Plugin.Cache; - - /// - /// Cache plugin context. - /// - internal class CachePluginContext : ICachePluginContext where T : ICachePluginConfiguration - { - /** */ - private readonly IgniteConfiguration _igniteConfiguration; - - /** */ - private readonly CacheConfiguration _cacheConfiguration; - - /** */ - private readonly T _cachePluginConfiguration; - - /** */ - private readonly IIgnite _ignite; - - /// - /// Initializes a new instance of the class. - /// - public CachePluginContext(IgniteConfiguration igniteConfiguration, CacheConfiguration cacheConfiguration, - T cachePluginConfiguration, IIgnite ignite) - { - Debug.Assert(igniteConfiguration != null); - Debug.Assert(cacheConfiguration != null); - Debug.Assert(cachePluginConfiguration != null); - Debug.Assert(ignite != null); - - _igniteConfiguration = igniteConfiguration; - _cacheConfiguration = cacheConfiguration; - _cachePluginConfiguration = cachePluginConfiguration; - _ignite = ignite; - } - - /** */ - public IgniteConfiguration IgniteConfiguration - { - get { return _igniteConfiguration; } - } - - /** */ - public CacheConfiguration CacheConfiguration - { - get { return _cacheConfiguration; } - } - - /** */ - public T CachePluginConfiguration - { - get { return _cachePluginConfiguration; } - } - - /** */ - public IIgnite Ignite - { - get { return _ignite; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProcessor.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProcessor.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProcessor.cs deleted file mode 100644 index 2d88d73..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProcessor.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Impl.Plugin.Cache -{ - using System; - using System.Diagnostics; - using System.Linq; - using Apache.Ignite.Core.Common; - using Apache.Ignite.Core.Plugin; - using Apache.Ignite.Core.Plugin.Cache; - - /// - /// Cache plugin processor. - /// - internal static class CachePluginProcessor - { - /// - /// Creates the provider proxy. - /// - public static ICachePluginProviderProxy CreateProviderProxy(ICachePluginConfiguration pluginConfiguration) - { - Debug.Assert(pluginConfiguration != null); - - var cfgType = pluginConfiguration.GetType(); - - var attributes = cfgType.GetCustomAttributes(true).OfType().ToArray(); - - if (attributes.Length == 0) - { - throw new IgniteException(string.Format("{0} of type {1} has no {2}", - typeof(IPluginConfiguration), cfgType, typeof(CachePluginProviderTypeAttribute))); - - } - - if (attributes.Length > 1) - { - throw new IgniteException(string.Format("{0} of type {1} has more than one {2}", - typeof(IPluginConfiguration), cfgType, typeof(CachePluginProviderTypeAttribute))); - } - - var providerType = attributes[0].CachePluginProviderType; - - var iface = providerType.GetInterfaces() - .SingleOrDefault(i => i.IsGenericType && - i.GetGenericTypeDefinition() == typeof(ICachePluginProvider<>) && - i.GetGenericArguments()[0] == cfgType); - - if (iface == null) - { - throw new IgniteException(string.Format("{0} does not implement {1}", - providerType, typeof(ICachePluginProvider<>).MakeGenericType(cfgType))); - } - - var pluginProvider = Activator.CreateInstance(providerType); - - var providerProxyType = typeof(CachePluginProviderProxy<>).MakeGenericType(cfgType); - - return (ICachePluginProviderProxy)Activator.CreateInstance( - providerProxyType, pluginConfiguration, pluginProvider); - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProviderProxy.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProviderProxy.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProviderProxy.cs deleted file mode 100644 index 5dc7366..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/CachePluginProviderProxy.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Impl.Plugin.Cache -{ - using System.Diagnostics; - using Apache.Ignite.Core.Cache.Configuration; - using Apache.Ignite.Core.Plugin.Cache; - - /// - /// Wraps user-defined generic . - /// - internal class CachePluginProviderProxy : ICachePluginProviderProxy where T : ICachePluginConfiguration - { - /** */ - private readonly T _cachePluginConfiguration; - - /** */ - private readonly ICachePluginProvider _pluginProvider; - - /// - /// Initializes a new instance of the class. - /// - /// The cache plugin configuration. - /// The plugin provider. - public CachePluginProviderProxy(T cachePluginConfiguration, ICachePluginProvider pluginProvider) - { - Debug.Assert(cachePluginConfiguration != null); - Debug.Assert(pluginProvider != null); - - _cachePluginConfiguration = cachePluginConfiguration; - _pluginProvider = pluginProvider; - } - - /** */ - public void Start(IgniteConfiguration igniteConfiguration, CacheConfiguration cacheConfiguration, - IIgnite ignite) - { - _pluginProvider.Start(new CachePluginContext(igniteConfiguration, - cacheConfiguration, _cachePluginConfiguration, ignite)); - } - - /** */ - public void Stop(bool cancel) - { - _pluginProvider.Stop(cancel); - } - - /** */ - public void OnIgniteStart() - { - _pluginProvider.OnIgniteStart(); - } - - /** */ - public void OnIgniteStop(bool cancel) - { - _pluginProvider.OnIgniteStop(cancel); - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/ICachePluginProviderProxy.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/ICachePluginProviderProxy.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/ICachePluginProviderProxy.cs deleted file mode 100644 index e2bffde..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Plugin/Cache/ICachePluginProviderProxy.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Impl.Plugin.Cache -{ - using Apache.Ignite.Core.Cache.Configuration; - using Apache.Ignite.Core.Plugin.Cache; - - /// - /// Wraps user-defined generic . - /// - internal interface ICachePluginProviderProxy - { - /// - /// Starts the plugin provider. - /// - void Start(IgniteConfiguration igniteConfiguration, CacheConfiguration cacheConfiguration, IIgnite ignite); - - /// - /// Stops the plugin provider. - /// - /// if set to true, all ongoing operations should be canceled. - void Stop(bool cancel); - - /// - /// Called when Ignite has been started and is fully functional. - /// - /// Use and to track shutdown process. - /// - void OnIgniteStart(); - - /// - /// Callback to notify that Ignite is about to stop. - /// - /// if set to true, all ongoing operations should be canceled. - void OnIgniteStop(bool cancel); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbackOp.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbackOp.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbackOp.cs index 91df822..e16c3c1 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbackOp.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbackOp.cs @@ -84,10 +84,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged ComputeJobExecuteLocal = 61, PluginProcessorStop = 62, PluginProcessorIgniteStop = 63, - CachePluginCreate = 64, - CachePluginDestroy = 65, - CachePluginIgniteStart = 66, - CachePluginIgniteStop = 67, PluginCallbackInLongLongOutLong = 68 } } http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs index 3028f08..fe0f9e6 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Unmanaged/UnmanagedCallbacks.cs @@ -26,7 +26,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged using System.Runtime.InteropServices; using System.Threading; using Apache.Ignite.Core.Cache.Affinity; - using Apache.Ignite.Core.Cache.Configuration; using Apache.Ignite.Core.Cluster; using Apache.Ignite.Core.Common; using Apache.Ignite.Core.Impl.Binary; @@ -43,12 +42,10 @@ namespace Apache.Ignite.Core.Impl.Unmanaged using Apache.Ignite.Core.Impl.Log; using Apache.Ignite.Core.Impl.Memory; using Apache.Ignite.Core.Impl.Messaging; - using Apache.Ignite.Core.Impl.Plugin.Cache; using Apache.Ignite.Core.Impl.Resource; using Apache.Ignite.Core.Impl.Services; using Apache.Ignite.Core.Lifecycle; using Apache.Ignite.Core.Log; - using Apache.Ignite.Core.Plugin.Cache; using Apache.Ignite.Core.Services; using UU = UnmanagedUtils; @@ -242,10 +239,6 @@ namespace Apache.Ignite.Core.Impl.Unmanaged AddHandler(UnmanagedCallbackOp.ComputeJobExecuteLocal, ComputeJobExecuteLocal); AddHandler(UnmanagedCallbackOp.PluginProcessorStop, PluginProcessorStop); AddHandler(UnmanagedCallbackOp.PluginProcessorIgniteStop, PluginProcessorIgniteStop); - AddHandler(UnmanagedCallbackOp.CachePluginCreate, CachePluginCreate); - AddHandler(UnmanagedCallbackOp.CachePluginDestroy, CachePluginDestroy); - AddHandler(UnmanagedCallbackOp.CachePluginIgniteStart, CachePluginIgniteStart); - AddHandler(UnmanagedCallbackOp.CachePluginIgniteStop, CachePluginIgniteStop); AddHandler(UnmanagedCallbackOp.PluginCallbackInLongLongOutLong, PluginCallbackInLongLongOutLong); } @@ -1242,54 +1235,7 @@ namespace Apache.Ignite.Core.Impl.Unmanaged #endregion #region PLUGINS - - private long CachePluginCreate(long objPtr) - { - using (var stream = IgniteManager.Memory.Get(objPtr).GetStream()) - { - var reader = BinaryUtils.Marshaller.StartUnmarshal(stream); - - var cachePluginCfg = reader.ReadObject(); - var providerProxy = CachePluginProcessor.CreateProviderProxy(cachePluginCfg); - - var igniteCfg = new IgniteConfiguration(reader, _ignite.Configuration); - var cacheCfg = new CacheConfiguration(reader); - - providerProxy.Start(igniteCfg, cacheCfg, _ignite); - - return _handleRegistry.Allocate(providerProxy); - } - } - - private long CachePluginDestroy(long objPtr, long cancel, long unused, void* arg) - { - var pluginProvider = _handleRegistry.Get(objPtr, true); - - pluginProvider.Stop(cancel != 0); - - _ignite.HandleRegistry.Release(objPtr); - - return 0; - } - - private long CachePluginIgniteStart(long objPtr) - { - var pluginProvider = _handleRegistry.Get(objPtr, true); - - pluginProvider.OnIgniteStart(); - - return 0; - } - - private long CachePluginIgniteStop(long objPtr, long cancel, long unused, void* arg) - { - var pluginProvider = _handleRegistry.Get(objPtr, true); - - pluginProvider.OnIgniteStop(cancel != 0); - - return 0; - } - + private long PluginCallbackInLongLongOutLong(long callbackId, long inPtr, long outPtr, void* arg) { return _ignite.PluginProcessor.InvokeCallback(callbackId, inPtr, outPtr); http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/CachePluginProviderTypeAttribute.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/CachePluginProviderTypeAttribute.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/CachePluginProviderTypeAttribute.cs deleted file mode 100644 index 63b4185..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/CachePluginProviderTypeAttribute.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Plugin.Cache -{ - using System; - using Apache.Ignite.Core.Impl.Common; - - /// - /// When applied to , defines the type of - /// to instantiate. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)] - public sealed class CachePluginProviderTypeAttribute : Attribute - { - /** */ - private readonly Type _cachePluginProviderType; - - /// - /// Initializes new instance of class. - /// - /// Type of the plugin provider. - public CachePluginProviderTypeAttribute(Type cachePluginProviderType) - { - IgniteArgumentCheck.NotNull(cachePluginProviderType, "pluginProviderType"); - - _cachePluginProviderType = cachePluginProviderType; - } - - /// - /// Gets the plugin provider type. - /// - public Type CachePluginProviderType - { - get { return _cachePluginProviderType; } - } - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginConfiguration.cs index 1790357..c58cba2 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginConfiguration.cs @@ -24,24 +24,6 @@ namespace Apache.Ignite.Core.Plugin.Cache /// /// Cache plugin configuration marker interface. Starting point to extend /// and extend existing cache functionality. - /// - /// Implementations should be linked to corresponding - /// via . - /// - /// Example plugin implementation: - /// - /// [CachePluginProviderType(typeof(MyCachePluginProvider))] - /// class MyCachePluginConfig : ICachePluginConfiguration - /// { - /// int CustomProperty { get; set; } - /// } - /// - /// class MyCachePluginProvider : ICachePluginProvider<MyCachePluginConfig> - /// { - /// ... - /// } - /// - /// /// [SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces")] public interface ICachePluginConfiguration @@ -49,9 +31,6 @@ namespace Apache.Ignite.Core.Plugin.Cache /// /// Gets the id to locate PlatformCachePluginConfigurationClosureFactory on Java side /// and read the data written by method. - /// - /// When this property is not null, all cache plugin functionality is delegated to Java part. - /// won't be invoked. /// int? CachePluginConfigurationClosureFactoryId { get; } http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginContext.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginContext.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginContext.cs deleted file mode 100644 index 399db1e..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginContext.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Plugin.Cache -{ - using Apache.Ignite.Core.Cache.Configuration; - - /// - /// Cache plugin context. - /// - public interface ICachePluginContext where T : ICachePluginConfiguration - { - /// - /// Gets the Ignite configuration. - /// - IgniteConfiguration IgniteConfiguration { get; } - - /// - /// Gets the Ignite cache configuration. - /// - CacheConfiguration CacheConfiguration { get; } - - /// - /// Gets the cache plugin configuration. - /// - T CachePluginConfiguration { get; } - - /// - /// Gets the Ignite. - /// - IIgnite Ignite { get; } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/44a8f938/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginProvider.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginProvider.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginProvider.cs deleted file mode 100644 index 73439cd..0000000 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Plugin/Cache/ICachePluginProvider.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -namespace Apache.Ignite.Core.Plugin.Cache -{ - using System; - - /// - /// Cache plugin provider. - /// - /// Implementations will be passed to remote nodes and should be marked with . - /// - public interface ICachePluginProvider where TConfig : ICachePluginConfiguration - { - /// - /// Starts the plugin provider. - /// - void Start(ICachePluginContext cachePluginContext); - - /// - /// Stops the plugin provider. - /// - /// if set to true, all ongoing operations should be canceled. - void Stop(bool cancel); - - /// - /// Called when Ignite has been started and is fully functional. - /// - /// - void OnIgniteStart(); - - /// - /// Callback to notify that Ignite is about to stop. - /// - /// if set to true, all ongoing operations should be canceled. - void OnIgniteStop(bool cancel); - } -} \ No newline at end of file