cyrus-jackson commented on a change in pull request #148:
URL: https://github.com/apache/incubator-ratis/pull/148#discussion_r465464215



##########
File path: 
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java
##########
@@ -258,6 +259,39 @@ RaftGroup getGroup() {
     return RaftGroup.valueOf(getMemberId().getGroupId(), 
getRaftConf().getPeers());
   }
 
+  /**
+   * This removes the group from the server.
+   * If the flag is set to false, the directory is moved to
+   * {@link RaftServerConfigKeys#REMOVED_GROUPS_DIR_KEY} location only if
+   * {@link RaftServerConfigKeys#MOVE_REMOVED_GROUPS_ENABLED_KEY} is enabled.
+   * If the flag is true, the group is permanently deleted.
+   * @param deleteDirectory
+   */
+  public void groupRemove(boolean deleteDirectory) {
+    final RaftStorageDirectory dir = state.getStorage().getStorageDir();
+
+    /* Shutdown is triggered here inorder to avoid any locked files. */
+    shutdown(deleteDirectory);
+
+    if(!deleteDirectory && RaftServerConfigKeys.moveRemovedGroupsEnabled

Review comment:
       I have moved the logic to groupRemove




----------------------------------------------------------------
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:
[email protected]


Reply via email to