smiklosovic commented on code in PR #3579:
URL: https://github.com/apache/cassandra/pull/3579#discussion_r1778646862


##########
src/java/org/apache/cassandra/service/StorageService.java:
##########
@@ -1457,6 +1461,68 @@ public void setConcurrentCompactors(int value)
         CompactionManager.instance.setConcurrentCompactors(value);
     }
 
+    public String getAuthenticator()
+    {
+        return DatabaseDescriptor.getAuthenticator().getClass().getName();
+    }
+
+    public void setAuthenticator(String value)
+    {
+        if (value == null)
+            throw new IllegalArgumentException("Authenticator cannot be null");
+
+        try {
+            Class<?> cl = Class.forName(value);
+
+            // Ensure the class implements IAuthenticator
+            if (IAuthenticator.class.isAssignableFrom(cl)) {
+                IAuthenticator authenticator =
+                (IAuthenticator) cl.getDeclaredConstructor().newInstance();
+                authenticator.setup();
+                DatabaseDescriptor.setAuthenticator(authenticator);
+                Roles.resetRoleCache();
+                // NetworkPermissionsCache uses the authenticator, so it 
should be reset as well.
+                AuthenticatedUser.resetNetworkPermissionsCache();
+            } else {
+                throw new IllegalArgumentException(value + " does not 
implement IAuthenticator");
+            }
+        }
+        catch (Exception e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+    public String getAuthorizer()

Review Comment:
   methods like these should return not only name but parameters as well 



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to