File tree Expand file tree Collapse file tree 3 files changed +18
-4
lines changed
core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache
platforms/dotnet/Apache.Ignite.Core/Impl/Client Expand file tree Collapse file tree 3 files changed +18
-4
lines changed Original file line number Diff line number Diff line change 2626 * Cache destroy request.
2727 */
2828public 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 );
Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff 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 /> */
You can’t perform that action at this time.
0 commit comments