ctubbsii commented on code in PR #3122:
URL: https://github.com/apache/accumulo/pull/3122#discussion_r1048866460
##########
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:
Every time we use this constant, we are always appending it this way. This
implies it might make more sense to just make a method dangle off of `context`
that uses a memoized supplier:
```java
zkUserPath = context.zkUserPath();
```
```java
Supplier<String> zkUserPath = Suppliers.memoize(() -> Constants.ZROOT +
"/" + getInstanceID() + Constants.ZUSERS);
// ...
public String zkUserPath() {
return zkUserPath.get();
}
```
--
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]