Skip to content

Commit 555fceb

Browse files
committed
IGNITE-6988 .NET: Thin client: OP_CACHE_DESTROY takes cacheId instead of name
1 parent f863ca0 commit 555fceb

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
* Cache destroy request.
2727
*/
2828
public class ClientCacheDestroyRequest extends ClientRequest {
29-
/** Cache name. */
30-
private final String cacheName;
29+
/** Cache ID. */
30+
private final int cacheId;
3131

3232
/**
3333
* Constructor.
@@ -37,11 +37,13 @@ public class ClientCacheDestroyRequest extends ClientRequest {
3737
public ClientCacheDestroyRequest(BinaryRawReader reader) {
3838
super(reader);
3939

40-
cacheName = reader.readString();
40+
cacheId = reader.readInt();
4141
}
4242

4343
/** {@inheritDoc} */
4444
@Override public ClientResponse process(ClientConnectionContext ctx) {
45+
String cacheName = ClientCacheRequest.cacheDescriptor(ctx, cacheId).cacheName();
46+
4547
ctx.kernalContext().grid().destroyCache(cacheName);
4648

4749
return super.process(ctx);

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,21 @@ protected IgniteCache rawCache(ClientConnectionContext ctx) {
8787
/**
8888
* Gets the cache descriptor.
8989
*
90+
* @param ctx Context.
9091
* @return Cache descriptor.
9192
*/
9293
protected DynamicCacheDescriptor cacheDescriptor(ClientConnectionContext ctx) {
94+
return cacheDescriptor(ctx, cacheId);
95+
}
96+
97+
/**
98+
* Gets the cache descriptor.
99+
*
100+
* @param ctx Context.
101+
* @param cacheId Cache id.
102+
* @return Cache descriptor.
103+
*/
104+
public static DynamicCacheDescriptor cacheDescriptor(ClientConnectionContext ctx, int cacheId) {
93105
DynamicCacheDescriptor desc = ctx.kernalContext().cache().cacheDescriptor(cacheId);
94106

95107
if (desc == null)

modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/IgniteClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public void DestroyCache(string name)
142142
{
143143
IgniteArgumentCheck.NotNull(name, "name");
144144

145-
DoOutOp(ClientOp.CacheDestroy, w => w.WriteString(name));
145+
DoOutOp(ClientOp.CacheDestroy, w => w.WriteInt(BinaryUtils.GetCacheId(name)));
146146
}
147147

148148
/** <inheritDoc /> */

0 commit comments

Comments
 (0)