You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2017/11/24 10:41:30 UTC
ignite git commit: IGNITE-6988 .NET: Thin client: OP_CACHE_DESTROY
takes cacheId instead of name
Repository: ignite
Updated Branches:
refs/heads/master f863ca016 -> 555fcebb2
IGNITE-6988 .NET: Thin client: OP_CACHE_DESTROY takes cacheId instead of name
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/555fcebb
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/555fcebb
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/555fcebb
Branch: refs/heads/master
Commit: 555fcebb2261e0ce3cfb1713a4322fad69505d2c
Parents: f863ca0
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Fri Nov 24 13:41:23 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Nov 24 13:41:23 2017 +0300
----------------------------------------------------------------------
.../client/cache/ClientCacheDestroyRequest.java | 8 +++++---
.../platform/client/cache/ClientCacheRequest.java | 12 ++++++++++++
.../Apache.Ignite.Core/Impl/Client/IgniteClient.cs | 2 +-
3 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/555fcebb/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheDestroyRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheDestroyRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheDestroyRequest.java
index 032116d..6645a03 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheDestroyRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheDestroyRequest.java
@@ -26,8 +26,8 @@ import org.apache.ignite.internal.processors.platform.client.ClientResponse;
* Cache destroy request.
*/
public class ClientCacheDestroyRequest extends ClientRequest {
- /** Cache name. */
- private final String cacheName;
+ /** Cache ID. */
+ private final int cacheId;
/**
* Constructor.
@@ -37,11 +37,13 @@ public class ClientCacheDestroyRequest extends ClientRequest {
public ClientCacheDestroyRequest(BinaryRawReader reader) {
super(reader);
- cacheName = reader.readString();
+ cacheId = reader.readInt();
}
/** {@inheritDoc} */
@Override public ClientResponse process(ClientConnectionContext ctx) {
+ String cacheName = ClientCacheRequest.cacheDescriptor(ctx, cacheId).cacheName();
+
ctx.kernalContext().grid().destroyCache(cacheName);
return super.process(ctx);
http://git-wip-us.apache.org/repos/asf/ignite/blob/555fcebb/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
index 44416be..52b799f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
@@ -87,9 +87,21 @@ class ClientCacheRequest extends ClientRequest {
/**
* Gets the cache descriptor.
*
+ * @param ctx Context.
* @return Cache descriptor.
*/
protected DynamicCacheDescriptor cacheDescriptor(ClientConnectionContext ctx) {
+ return cacheDescriptor(ctx, cacheId);
+ }
+
+ /**
+ * Gets the cache descriptor.
+ *
+ * @param ctx Context.
+ * @param cacheId Cache id.
+ * @return Cache descriptor.
+ */
+ public static DynamicCacheDescriptor cacheDescriptor(ClientConnectionContext ctx, int cacheId) {
DynamicCacheDescriptor desc = ctx.kernalContext().cache().cacheDescriptor(cacheId);
if (desc == null)
http://git-wip-us.apache.org/repos/asf/ignite/blob/555fcebb/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/IgniteClient.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/IgniteClient.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/IgniteClient.cs
index 13a3a83..2dd18cc 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/IgniteClient.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Client/IgniteClient.cs
@@ -142,7 +142,7 @@ namespace Apache.Ignite.Core.Impl.Client
{
IgniteArgumentCheck.NotNull(name, "name");
- DoOutOp(ClientOp.CacheDestroy, w => w.WriteString(name));
+ DoOutOp(ClientOp.CacheDestroy, w => w.WriteInt(BinaryUtils.GetCacheId(name)));
}
/** <inheritDoc /> */