Skip to content

Commit 20a510b

Browse files
ivandaschptupitsyn
authored andcommitted
IGNITE-9998 .NET: Add Partition Preload API implementation (apache#6011)
1 parent 10a9447 commit 20a510b

File tree

10 files changed

+424
-5
lines changed

10 files changed

+424
-5
lines changed

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,15 @@ public class PlatformCache extends PlatformAbstractTarget {
335335
/** */
336336
public static final int OP_RESET_QUERY_METRICS = 86;
337337

338+
/** */
339+
public static final int OP_PRELOAD_PARTITION = 87;
340+
341+
/** */
342+
public static final int OP_PRELOAD_PARTITION_ASYNC = 88;
343+
344+
/** */
345+
public static final int OP_LOCAL_PRELOAD_PARTITION = 89;
346+
338347
/** Underlying JCache in binary mode. */
339348
private final IgniteCacheProxy cache;
340349

@@ -760,6 +769,14 @@ public IgniteCache rawCache() {
760769
PlatformCacheExtension ext = extension(reader.readInt());
761770

762771
return ext.processInOutStreamLong(this, reader.readInt(), reader, mem);
772+
773+
case OP_PRELOAD_PARTITION_ASYNC:
774+
readAndListenFuture(reader, cache.preloadPartitionAsync(reader.readInt()));
775+
776+
return TRUE;
777+
778+
case OP_LOCAL_PRELOAD_PARTITION:
779+
return cache.localPreloadPartition(reader.readInt()) ? TRUE : FALSE;
763780
}
764781
}
765782
catch (Exception e) {
@@ -1115,6 +1132,11 @@ private IgniteFuture<Void> loadCacheAsync0(BinaryRawReaderEx reader, boolean loc
11151132
case OP_RESET_QUERY_METRICS:
11161133
cache.resetQueryMetrics();
11171134

1135+
return TRUE;
1136+
1137+
case OP_PRELOAD_PARTITION:
1138+
cache.preloadPartition((int)val);
1139+
11181140
return TRUE;
11191141
}
11201142
return super.processInLongOutLong(type, val);

modules/platforms/dotnet/Apache.Ignite.AspNet.Tests/ExpiryCacheHolderTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,21 @@ public void ResetQueryMetrics()
525525
{
526526
throw new NotImplementedException();
527527
}
528+
529+
public void PreloadPartition(int partition)
530+
{
531+
throw new NotImplementedException();
532+
}
533+
534+
public Task PreloadPartitionAsync(int partition)
535+
{
536+
throw new NotImplementedException();
537+
}
538+
539+
public bool LocalPreloadPartition(int partition)
540+
{
541+
throw new NotImplementedException();
542+
}
528543
}
529544
}
530545
}

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
@@ -114,6 +114,7 @@
114114
<Compile Include="Cache\CacheTimeoutOnPmeTransactionalTest.cs" />
115115
<Compile Include="Cache\DataRegionMetricsTest.cs" />
116116
<Compile Include="Cache\DataStorageMetricsTest.cs" />
117+
<Compile Include="Cache\PartitionPreloadTest.cs" />
117118
<Compile Include="Cache\PersistenceTest.cs" />
118119
<Compile Include="Cache\PersistentStoreTestObsolete.cs" />
119120
<Compile Include="Cache\Query\CacheQueriesWithRestartServerTest.cs" />

modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/CacheParityTest.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public class CacheParityTest
5858
"localSizeLong", // IGNITE-6563
5959
"enableStatistics", // IGNITE-7276
6060
"clearStatistics", // IGNITE-9017
61-
"preloadPartition", // IGNITE-9998
62-
"preloadPartitionAsync", // IGNITE-9998
63-
"localPreloadPartition", // IGNITE-9998
6461
};
6562

6663
/// <summary>

modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheTestAsyncWrapper.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,21 @@ public void ResetQueryMetrics()
594594
{
595595
_cache.ResetQueryMetrics();
596596
}
597+
598+
public void PreloadPartition(int partition)
599+
{
600+
_cache.PreloadPartition(partition);
601+
}
602+
603+
public Task PreloadPartitionAsync(int partition)
604+
{
605+
return _cache.PreloadPartitionAsync(partition);
606+
}
607+
608+
public bool LocalPreloadPartition(int partition)
609+
{
610+
return _cache.LocalPreloadPartition(partition);
611+
}
597612
}
598613

599614
/// <summary>

0 commit comments

Comments
 (0)