You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by nn...@apache.org on 2021/04/07 00:05:43 UTC

[geode] branch support/1.14 updated: GEODE-9084: Removed the redis gfsh command. (#6271) (#6274)

This is an automated email from the ASF dual-hosted git repository.

nnag pushed a commit to branch support/1.14
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/support/1.14 by this push:
     new d3f3a09  GEODE-9084: Removed the redis gfsh command. (#6271) (#6274)
d3f3a09 is described below

commit d3f3a0908edea4f552684b322b2eb8119565ec0a
Author: Nabarun Nag <na...@users.noreply.github.com>
AuthorDate: Tue Apr 6 17:03:06 2021 -0700

    GEODE-9084: Removed the redis gfsh command. (#6271) (#6274)
    
    * This command is not needed as per the new design of geode compatible with redis module.
    
    (cherry picked from commit c1b8e52321aa204912357a706a0faea1444f913f)
---
 .../geode/redis/internal/GeodeRedisServer.java     |  2 -
 .../geode/redis/internal/gfsh/RedisCommand.java    | 55 ---------------------
 .../redis/internal/gfsh/RedisCommandFunction.java  | 56 ----------------------
 .../org.springframework.shell.core.CommandMarker   | 18 -------
 ...de-apis-compatible-with-redis-serializables.txt |  1 -
 5 files changed, 132 deletions(-)

diff --git a/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/GeodeRedisServer.java b/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/GeodeRedisServer.java
index 1c6434d..e0dd81c 100644
--- a/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/GeodeRedisServer.java
+++ b/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/GeodeRedisServer.java
@@ -30,7 +30,6 @@ import org.apache.geode.redis.internal.executor.CommandFunction;
 import org.apache.geode.redis.internal.executor.StripedExecutor;
 import org.apache.geode.redis.internal.executor.SynchronizedStripedExecutor;
 import org.apache.geode.redis.internal.executor.key.RenameFunction;
-import org.apache.geode.redis.internal.gfsh.RedisCommandFunction;
 import org.apache.geode.redis.internal.netty.NettyRedisServer;
 import org.apache.geode.redis.internal.pubsub.PubSub;
 import org.apache.geode.redis.internal.pubsub.PubSubImpl;
@@ -80,7 +79,6 @@ public class GeodeRedisServer {
 
     CommandFunction.register(regionProvider.getDataRegion(), stripedExecutor, redisStats);
     RenameFunction.register(regionProvider.getDataRegion(), stripedExecutor, redisStats);
-    RedisCommandFunction.register();
 
     passiveExpirationManager =
         new PassiveExpirationManager(regionProvider.getDataRegion(), redisStats);
diff --git a/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/gfsh/RedisCommand.java b/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/gfsh/RedisCommand.java
deleted file mode 100644
index 535eafc..0000000
--- a/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/gfsh/RedisCommand.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package org.apache.geode.redis.internal.gfsh;
-
-import java.util.List;
-import java.util.Set;
-
-import org.springframework.shell.core.annotation.CliCommand;
-import org.springframework.shell.core.annotation.CliOption;
-
-import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.management.cli.GfshCommand;
-import org.apache.geode.management.internal.cli.result.model.ResultModel;
-import org.apache.geode.management.internal.functions.CliFunctionResult;
-import org.apache.geode.management.internal.security.ResourceOperation;
-import org.apache.geode.security.ResourcePermission;
-
-public class RedisCommand extends GfshCommand {
-  public static final String REDIS = "redis";
-  public static final String REDIS__HELP =
-      "Commands related to the Geode APIs compatible with Redis.";
-  public static final String REDIS__ENABLE_UNSUPPORTED_COMMANDS = "enable-unsupported-commands";
-  public static final String REDIS__ENABLE_UNSUPPORTED_COMMANDS__HELP =
-      "Boolean value to determine "
-          + "whether or not to enable unsupported commands. Unsupported commands have not been fully tested.";
-
-  @CliCommand(value = {REDIS}, help = REDIS__HELP)
-  @ResourceOperation(resource = ResourcePermission.Resource.DATA,
-      operation = ResourcePermission.Operation.MANAGE)
-  public ResultModel enableUnsupportedCommands(
-      @CliOption(key = REDIS__ENABLE_UNSUPPORTED_COMMANDS,
-          unspecifiedDefaultValue = "false", specifiedDefaultValue = "true",
-          help = REDIS__ENABLE_UNSUPPORTED_COMMANDS__HELP) Boolean enableUnsupportedCommands) {
-
-    Set<DistributedMember> members = getAllNormalMembers();
-
-    List<CliFunctionResult> results =
-        executeAndGetFunctionResult(new RedisCommandFunction(), enableUnsupportedCommands, members);
-
-    return ResultModel.createMemberStatusResult(results);
-  }
-}
diff --git a/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/gfsh/RedisCommandFunction.java b/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/gfsh/RedisCommandFunction.java
deleted file mode 100644
index 8aff0d3..0000000
--- a/geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/gfsh/RedisCommandFunction.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
- * agreements. See the NOTICE file distributed with this work for additional information regarding
- * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License. You may obtain a
- * copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.geode.redis.internal.gfsh;
-
-import org.apache.geode.cache.execute.FunctionContext;
-import org.apache.geode.cache.execute.FunctionService;
-import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.management.cli.CliFunction;
-import org.apache.geode.management.internal.functions.CliFunctionResult;
-import org.apache.geode.redis.internal.GeodeRedisService;
-
-public class RedisCommandFunction extends CliFunction<Boolean> {
-
-  private static final long serialVersionUID = -6607122865046807926L;
-
-  public static void register() {
-    FunctionService.registerFunction(new RedisCommandFunction());
-  }
-
-  @Override
-  public CliFunctionResult executeFunction(FunctionContext<Boolean> context) {
-    boolean enableUnsupportedCommands = context.getArguments();
-
-    InternalCache cache = (InternalCache) context.getCache();
-
-    if (!cache.getInternalDistributedSystem().getConfig().getRedisEnabled()) {
-      return new CliFunctionResult(context.getMemberName(), false,
-          "Error: Geode APIs compatible with Redis are not enabled");
-    }
-
-    GeodeRedisService geodeRedisService = cache.getService(GeodeRedisService.class);
-
-    if (geodeRedisService == null) {
-      return new CliFunctionResult(context.getMemberName(), false,
-          "Error: GeodeRedisService is not running.");
-    }
-
-    geodeRedisService.setEnableUnsupported(enableUnsupportedCommands);
-
-    String unsupportedCommandsString = enableUnsupportedCommands ? "Unsupported commands enabled."
-        : "Unsupported commands disabled.";
-    return new CliFunctionResult(context.getMemberName(), true, unsupportedCommandsString);
-  }
-}
diff --git a/geode-apis-compatible-with-redis/src/main/resources/META-INF/services/org.springframework.shell.core.CommandMarker b/geode-apis-compatible-with-redis/src/main/resources/META-INF/services/org.springframework.shell.core.CommandMarker
deleted file mode 100644
index a586c21..0000000
--- a/geode-apis-compatible-with-redis/src/main/resources/META-INF/services/org.springframework.shell.core.CommandMarker
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# Redis commands
-org.apache.geode.redis.internal.gfsh.RedisCommand
diff --git a/geode-apis-compatible-with-redis/src/main/resources/org/apache/geode/redis/internal/sanctioned-geode-apis-compatible-with-redis-serializables.txt b/geode-apis-compatible-with-redis/src/main/resources/org/apache/geode/redis/internal/sanctioned-geode-apis-compatible-with-redis-serializables.txt
index 4a5a511..0ece538 100755
--- a/geode-apis-compatible-with-redis/src/main/resources/org/apache/geode/redis/internal/sanctioned-geode-apis-compatible-with-redis-serializables.txt
+++ b/geode-apis-compatible-with-redis/src/main/resources/org/apache/geode/redis/internal/sanctioned-geode-apis-compatible-with-redis-serializables.txt
@@ -10,7 +10,6 @@ org/apache/geode/redis/internal/executor/CommandFunction,true,-13025063163164547
 org/apache/geode/redis/internal/executor/SingleResultRedisFunction,true,3239452234149879302
 org/apache/geode/redis/internal/executor/key/RenameFunction,true,7047473969356686453
 org/apache/geode/redis/internal/executor/string/SetOptions$Exists,false
-org/apache/geode/redis/internal/gfsh/RedisCommandFunction,true,-6607122865046807926
 org/apache/geode/redis/internal/netty/CoderException,true,4707944288714910949
 org/apache/geode/redis/internal/netty/RedisCommandParserException,true,4707944288714910949
 org/apache/geode/redis/internal/pubsub/PubSubImpl$1,false,this$0:org/apache/geode/redis/internal/pubsub/PubSubImpl