ptupitsyn commented on a change in pull request #8866:
URL: https://github.com/apache/ignite/pull/8866#discussion_r591528126
##########
File path:
modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Affinity/AffinityTest.cs
##########
@@ -121,6 +121,45 @@ public void TestAffinityKeyMappedWithQueryEntitySpringXml()
}
}
+ /// <summary>
+ /// Tests that <see cref="AffinityKey"/> works when used as <see
cref="QueryEntity.KeyType"/>.
+ /// </summary>
+ [Test]
+ public void TestAffinityKeyWithQueryEntity()
+ {
+ var cacheCfg = new CacheConfiguration(TestUtils.TestName)
+ {
+ QueryEntities = new List<QueryEntity>
+ {
+ new QueryEntity(typeof(AffinityKey),
typeof(QueryEntityValue))
+ }
+ };
+
+ var ignite = Ignition.GetIgnite("grid-0");
+ var cache = ignite.GetOrCreateCache<AffinityKey,
QueryEntityValue>(cacheCfg);
+ var aff = ignite.GetAffinity(cache.Name);
+
+ var ignite2 = Ignition.GetIgnite("grid-1");
+ var cache2 = ignite2.GetOrCreateCache<AffinityKey,
QueryEntityValue>(cacheCfg);
+ var aff2 = ignite2.GetAffinity(cache2.Name);
+
+ // Check mapping.
+ for (var i = 0; i < 100; i++)
+ {
+ Assert.AreEqual(aff.GetPartition(i), aff.GetPartition(new
AffinityKey("foo", i)));
Review comment:
Fixed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]