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 BC175200C92 for ; Mon, 12 Jun 2017 17:33:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BAF4A160BEC; Mon, 12 Jun 2017 15:33:19 +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 07AB6160C06 for ; Mon, 12 Jun 2017 17:33:17 +0200 (CEST) Received: (qmail 4123 invoked by uid 500); 12 Jun 2017 15:33:17 -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 3803 invoked by uid 99); 12 Jun 2017 15:33:17 -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; Mon, 12 Jun 2017 15:33:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 66371F4A5C; Mon, 12 Jun 2017 15:33:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Mon, 12 Jun 2017 15:33:49 -0000 Message-Id: <55b405a32aec4a09afc372c2c78f3ad3@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [35/62] [abbrv] ignite git commit: IGNITE-5436 .NET: CacheConfiguration.GroupName archived-at: Mon, 12 Jun 2017 15:33:19 -0000 IGNITE-5436 .NET: CacheConfiguration.GroupName Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/5c77dab5 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/5c77dab5 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/5c77dab5 Branch: refs/heads/ignite-5239 Commit: 5c77dab546f1eded908fd74a51eaef59054e038c Parents: bd5065b Author: Pavel Tupitsyn Authored: Thu Jun 8 12:33:13 2017 +0300 Committer: Pavel Tupitsyn Committed: Thu Jun 8 12:33:13 2017 +0300 ---------------------------------------------------------------------- .../platform/utils/PlatformConfigurationUtils.java | 2 ++ .../Cache/CacheConfigurationTest.cs | 2 ++ .../IgniteConfigurationSerializerTest.cs | 6 ++++-- .../Cache/Configuration/CacheConfiguration.cs | 14 ++++++++++++++ .../Apache.Ignite.Core/IgniteConfigurationSection.xsd | 5 +++++ 5 files changed, 27 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/5c77dab5/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java index 40dafbd..176d77b 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/utils/PlatformConfigurationUtils.java @@ -178,6 +178,7 @@ public class PlatformConfigurationUtils { ccfg.setMemoryPolicyName(memoryPolicyName); ccfg.setPartitionLossPolicy(PartitionLossPolicy.fromOrdinal((byte)in.readInt())); + ccfg.setGroupName(in.readString()); Object storeFactory = in.readObjectDetached(); @@ -829,6 +830,7 @@ public class PlatformConfigurationUtils { writer.writeBoolean(ccfg.isStatisticsEnabled()); writer.writeString(ccfg.getMemoryPolicyName()); writer.writeInt(ccfg.getPartitionLossPolicy().ordinal()); + writer.writeString(ccfg.getGroupName()); if (ccfg.getCacheStoreFactory() instanceof PlatformDotNetCacheStoreFactoryNative) writer.writeObject(((PlatformDotNetCacheStoreFactoryNative)ccfg.getCacheStoreFactory()).getNativeFactory()); http://git-wip-us.apache.org/repos/asf/ignite/blob/5c77dab5/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 7935cc3..b674b0e 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheConfigurationTest.cs @@ -247,6 +247,7 @@ namespace Apache.Ignite.Core.Tests.Cache Assert.AreEqual(x.EnableStatistics, y.EnableStatistics); Assert.AreEqual(x.MemoryPolicyName, y.MemoryPolicyName); Assert.AreEqual(x.PartitionLossPolicy, y.PartitionLossPolicy); + Assert.AreEqual(x.GroupName, y.GroupName); if (x.ExpiryPolicyFactory != null) Assert.AreEqual(x.ExpiryPolicyFactory.CreateInstance().GetType(), @@ -512,6 +513,7 @@ namespace Apache.Ignite.Core.Tests.Cache ReadThrough = true, WriteThrough = true, WriteBehindCoalescing = false, + GroupName = "someGroup", QueryEntities = new[] { new QueryEntity http://git-wip-us.apache.org/repos/asf/ignite/blob/5c77dab5/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 7ba4ed2..3229de9 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/IgniteConfigurationSerializerTest.cs @@ -92,7 +92,7 @@ namespace Apache.Ignite.Core.Tests - + @@ -179,6 +179,7 @@ namespace Apache.Ignite.Core.Tests Assert.IsTrue(cacheCfg.EnableStatistics); Assert.IsFalse(cacheCfg.WriteBehindCoalescing); Assert.AreEqual(PartitionLossPolicy.ReadWriteAll, cacheCfg.PartitionLossPolicy); + Assert.AreEqual("fooGroup", cacheCfg.GroupName); var queryEntity = cacheCfg.QueryEntities.Single(); Assert.AreEqual(typeof(int), queryEntity.KeyType); @@ -725,7 +726,8 @@ namespace Apache.Ignite.Core.Tests new MyPluginConfiguration() }, MemoryPolicyName = "somePolicy", - PartitionLossPolicy = PartitionLossPolicy.ReadOnlyAll + PartitionLossPolicy = PartitionLossPolicy.ReadOnlyAll, + GroupName = "abc" } }, ClientMode = true, http://git-wip-us.apache.org/repos/asf/ignite/blob/5c77dab5/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs index 1ee7c97..04198dd 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core/Cache/Configuration/CacheConfiguration.cs @@ -236,6 +236,7 @@ namespace Apache.Ignite.Core.Cache.Configuration EnableStatistics = reader.ReadBoolean(); MemoryPolicyName = reader.ReadString(); PartitionLossPolicy = (PartitionLossPolicy) reader.ReadInt(); + GroupName = reader.ReadString(); CacheStoreFactory = reader.ReadObject>(); var count = reader.ReadInt(); @@ -293,6 +294,7 @@ namespace Apache.Ignite.Core.Cache.Configuration writer.WriteBoolean(EnableStatistics); writer.WriteString(MemoryPolicyName); writer.WriteInt((int) PartitionLossPolicy); + writer.WriteString(GroupName); writer.WriteObject(CacheStoreFactory); if (QueryEntities != null) @@ -643,5 +645,17 @@ namespace Apache.Ignite.Core.Cache.Configuration /// [DefaultValue(DefaultPartitionLossPolicy)] public PartitionLossPolicy PartitionLossPolicy { get; set; } + + /// + /// Gets or sets the cache group name. Caches with the same group name share single underlying 'physical' + /// cache (partition set), but are logically isolated. + /// + /// Since underlying cache is shared, the following configuration properties should be the same within group: + /// , , , + /// + /// + /// Grouping caches reduces overall overhead, since internal data structures are shared. + /// + public string GroupName { get;set; } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/5c77dab5/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd ---------------------------------------------------------------------- diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd index 0cd58ed..f0b7f44 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd +++ b/modules/platforms/dotnet/Apache.Ignite.Core/IgniteConfigurationSection.xsd @@ -743,6 +743,11 @@ Partition loss policy defines how Ignite will react to a situation when all nodes for some partition leave the cluster. + + + Cache group name. Caches with the same group name share single underlying 'physical' cache (partition set), but are logically isolated. + +