You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/06/24 01:15:02 UTC

[GitHub] [geode] agingade commented on a change in pull request #5285: GEODE-8099: make those gfsh commands that updates cluster configuratiā€¦

agingade commented on a change in pull request #5285:
URL: https://github.com/apache/geode/pull/5285#discussion_r444588637



##########
File path: geode-core/src/main/java/org/apache/geode/management/internal/api/LocatorClusterManagementService.java
##########
@@ -113,7 +113,7 @@
 public class LocatorClusterManagementService implements ClusterManagementService {
   @VisibleForTesting
   // the dlock service name used by the CMS
-  static final String CMS_DLOCK_SERVICE_NAME = "CMS_DLOCK_SERVICE";
+  public static final String CMS_DLOCK_SERVICE_NAME = "CMS_DLOCK_SERVICE";

Review comment:
       Since "LocatorClusterManagementService" is central to the ClusterConfigurationService; will it be better to have the cms-dlock service created in this class; and have helper method to lock and unlock. Assumption is when the lock is requested the Locator Management service will be up and running.
   
   lockConfigForUpdate() {}
   unLockConfigForUpdate() {}

##########
File path: geode-gfsh/src/main/java/org/apache/geode/management/cli/GfshCommand.java
##########
@@ -59,6 +59,14 @@ public boolean isOnlineCommandAvailable() {
     return gfsh.isConnectedAndReady();
   }
 
+  /**
+   * For those commands that could possibly change the cluster configuration, they need to
+   * override this method to return true.
+   */
+  public boolean affectsClusterConfiguration() {

Review comment:
       How about naming it as "updatesClusterConfiguration" (); they both are same, just another name to consider, its left to you. 

##########
File path: geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/remote/CommandExecutor.java
##########
@@ -207,4 +219,32 @@ protected Object invokeCommand(Object command, GfshParseResult parseResult) {
 
     return resultModel;
   }
+
+  @VisibleForTesting
+  boolean lockCMS(Object command) {
+    if (cmsDlockService == null) {
+      return false;
+    }
+    if (!(command instanceof GfshCommand)) {

Review comment:
       How about combining all of the if into an AND condition.
   
   if (cmsDlockService == null && !(command instanceof GfshCommand) &&...)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org