ctubbsii commented on code in PR #5192:
URL: https://github.com/apache/accumulo/pull/5192#discussion_r1901320766
##########
server/base/src/main/java/org/apache/accumulo/server/conf/util/ZooPropEditor.java:
##########
@@ -82,24 +82,26 @@ public void execute(String[] args) throws Exception {
ZooPropEditor.Opts opts = new ZooPropEditor.Opts();
opts.parseArgs(ZooPropEditor.class.getName(), args);
- ZooReaderWriter zrw = new ZooReaderWriter(opts.getSiteConfiguration());
-
var siteConfig = opts.getSiteConfiguration();
- try (ServerContext context = new ServerContext(siteConfig)) {
- PropStoreKey<?> propKey = getPropKey(context, opts);
- switch (opts.getCmdMode()) {
- case SET:
- setProperty(context, propKey, opts);
- break;
- case DELETE:
- deleteProperty(context, propKey, readPropNode(propKey, zrw), opts);
- break;
- case PRINT:
- printProperties(context, propKey, readPropNode(propKey, zrw));
- break;
- case ERROR:
- default:
- throw new IllegalArgumentException("Invalid operation requested");
+ try (var zk = new ZooSession(getClass().getSimpleName(), siteConfig)) {
+ var zrw = zk.asReaderWriter();
+
+ try (ServerContext context = new ServerContext(siteConfig)) {
Review Comment:
Done in c6dc8b58ea7af44cb79fc0c4d301141386fc7d42
However, this class needs some additional work. There's a lot of passing
around an extra ZK object (ZooSession now) that could have been obtained from
the context instead. I think that was done to support setting up a ZK session
from client config options passed on the command-line, but I'm not sure without
further investigation.
--
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]