ctubbsii commented on code in PR #3122:
URL: https://github.com/apache/accumulo/pull/3122#discussion_r1049005037


##########
server/base/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java:
##########
@@ -106,7 +106,7 @@ public static PermissionHandler 
getPermHandler(ServerContext context) {
   protected SecurityOperation(ServerContext context, Authorizor author, 
Authenticator authent,
       PermissionHandler pm) {
     this.context = context;
-    zkUserPath = Constants.ZROOT + "/" + context.getInstanceID() + "/users";
+    zkUserPath = Constants.ZROOT + "/" + context.getInstanceID() + 
Constants.ZUSERS;

Review Comment:
   > I was just trying to suggest that 1) we reduce concatenation and 2) we 
localize the builders in a single place.
   
   My suggestion achieves that, but just for this one path. The other constants 
or paths may not be as easy to do (may include more variables... like injection 
of table name, tserver name, etc.). This one is an easy one to do here, since 
every case is identical, the only variable component is the instance ID, and 
they all have a context to work with. So rather than focus on swapping out a 
constant, which is only a tiny, trivial improvement, we can swap out the string 
literal for a method, which is a slightly bigger improvement, and works towards 
another larger goal.



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

Reply via email to