Skip to content

Commit 83b5bca

Browse files
committed
IGNITE-4563 .NET: Fix ICache.LoadCache failures on non-primitive arguments
1 parent f1fca3a commit 83b5bca

File tree

8 files changed

+294
-144
lines changed

8 files changed

+294
-144
lines changed

modules/core/src/main/java/org/apache/ignite/internal/processors/platform/cache/PlatformCache.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,16 @@ private void loadCache0(BinaryRawReaderEx reader, boolean loc, IgniteCache cache
816816
if (pred != null)
817817
filter = platformCtx.createCacheEntryFilter(pred, 0);
818818

819-
Object[] args = reader.readObjectArray();
819+
Object[] args = null;
820+
821+
int argCnt = reader.readInt();
822+
823+
if (argCnt > 0) {
824+
args = new Object[argCnt];
825+
826+
for (int i = 0; i < argCnt; i++)
827+
args[i] = reader.readObjectDetached();
828+
}
820829

821830
if (loc)
822831
cache.localLoadCache(filter, args);

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Apache.Ignite.Core.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
<Compile Include="Cache\Query\CacheDmlQueriesTest.cs" />
8282
<Compile Include="Cache\CacheAbstractTransactionalTest.cs" />
8383
<Compile Include="Cache\Store\CacheStoreAdapterTest.cs" />
84+
<Compile Include="Cache\Store\NamedNodeCacheStoreTest.cs" />
8485
<Compile Include="Collections\MultiValueDictionaryTest.cs" />
8586
<Compile Include="Collections\ReadOnlyCollectionTest.cs" />
8687
<Compile Include="Collections\ReadOnlyDictionaryTest.cs" />

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheParallelLoadStoreTest.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
2525
/// <summary>
2626
/// Tests for GridCacheParallelLoadStoreAdapter.
2727
/// </summary>
28-
public class CacheParallelLoadStoreTest
28+
public sealed class CacheParallelLoadStoreTest
2929
{
3030
// object store name
3131
private const string ObjectStoreCacheName = "object_store_parallel";
@@ -34,11 +34,8 @@ public class CacheParallelLoadStoreTest
3434
/// Set up test class.
3535
/// </summary>
3636
[TestFixtureSetUp]
37-
public virtual void BeforeTests()
37+
public void BeforeTests()
3838
{
39-
TestUtils.KillProcesses();
40-
TestUtils.JvmDebug = true;
41-
4239
Ignition.Start(new IgniteConfiguration
4340
{
4441
JvmClasspath = TestUtils.CreateTestClasspath(),
@@ -55,7 +52,7 @@ public virtual void BeforeTests()
5552
/// Tear down test class.
5653
/// </summary>
5754
[TestFixtureTearDown]
58-
public virtual void AfterTests()
55+
public void AfterTests()
5956
{
6057
Ignition.StopAll(true);
6158
}

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Store/CacheStoreSessionTest.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ namespace Apache.Ignite.Core.Tests.Cache.Store
2222
using System.Collections.Generic;
2323
using System.Linq;
2424
using Apache.Ignite.Core.Cache.Store;
25-
using Apache.Ignite.Core.Impl;
2625
using Apache.Ignite.Core.Resource;
2726
using NUnit.Framework;
2827

2928
/// <summary>
3029
/// Tests for store session.
3130
/// </summary>
32-
public class CacheStoreSessionTest
31+
public sealed class CacheStoreSessionTest
3332
{
3433
/** Grid name. */
3534
private const string IgniteName = "grid";
@@ -47,7 +46,7 @@ public class CacheStoreSessionTest
4746
/// Set up routine.
4847
/// </summary>
4948
[TestFixtureSetUp]
50-
public virtual void BeforeTests()
49+
public void BeforeTests()
5150
{
5251
//TestUtils.JVM_DEBUG = true;
5352

@@ -71,7 +70,7 @@ public virtual void BeforeTests()
7170
/// Tear down routine.
7271
/// </summary>
7372
[TestFixtureTearDown]
74-
public virtual void AfterTests()
73+
public void AfterTests()
7574
{
7675
Ignition.StopAll(true);
7776
}
@@ -147,14 +146,15 @@ public void TestSession()
147146
/// Dump operations.
148147
/// </summary>
149148
/// <param name="dump">Dump.</param>
150-
internal static void DumpOperations(ICollection<Operation> dump)
149+
private static void DumpOperations(ICollection<Operation> dump)
151150
{
152151
_dumps.Add(dump);
153152
}
154153

155154
/// <summary>
156155
/// Test store implementation.
157156
/// </summary>
157+
// ReSharper disable once UnusedMember.Global
158158
public class Store : CacheStoreAdapter
159159
{
160160
/** Store session. */
@@ -215,7 +215,7 @@ private ICollection<Operation> GetOperations()
215215
/// <summary>
216216
/// Logged operation.
217217
/// </summary>
218-
internal class Operation
218+
private class Operation
219219
{
220220
/// <summary>
221221
/// Constructor.
@@ -244,22 +244,22 @@ public Operation(string cacheName, OperationType type, int key, int val) : this(
244244
/// <summary>
245245
/// Cache name.
246246
/// </summary>
247-
public string CacheName { get; set; }
247+
public string CacheName { get; private set; }
248248

249249
/// <summary>
250250
/// Operation type.
251251
/// </summary>
252-
public OperationType Type { get; set; }
252+
public OperationType Type { get; private set; }
253253

254254
/// <summary>
255255
/// Key.
256256
/// </summary>
257-
public int Key { get; set; }
257+
public int Key { get; private set; }
258258

259259
/// <summary>
260260
/// Value.
261261
/// </summary>
262-
public int Value { get; set; }
262+
public int Value { get; private set; }
263263

264264
/// <summary>
265265
/// Commit flag.
@@ -270,7 +270,7 @@ public Operation(string cacheName, OperationType type, int key, int val) : this(
270270
/// <summary>
271271
/// Operation types.
272272
/// </summary>
273-
internal enum OperationType
273+
private enum OperationType
274274
{
275275
/** Write. */
276276
Write,

0 commit comments

Comments
 (0)