dlmarion commented on code in PR #33:
URL:
https://github.com/apache/accumulo-classloaders/pull/33#discussion_r2694560116
##########
modules/local-caching-classloader/src/main/java/org/apache/accumulo/classloader/lcc/definition/ContextDefinition.java:
##########
@@ -139,4 +160,29 @@ public String getChecksum() {
public String toJson() {
return GSON.toJson(this);
}
+
+ @Override
+ public String keyword() {
+ return "create-context-definition";
+ }
+
+ @Override
+ public String description() {
+ return "Creates and prints a Context Definition";
+ }
+
+ @Override
+ public void execute(String[] args) throws Exception {
+ URL.setURLStreamHandlerFactory(new FsUrlStreamHandlerFactory(new
Configuration()));
+
+ Opts opts = new Opts();
+ opts.parseArgs(ContextDefinition.class.getName(), args);
+ URL[] urls = new URL[opts.files.size()];
+ int count = 0;
+ for (String f : opts.files) {
+ urls[count++] = new URL(f);
+ }
+ ContextDefinition def = create(opts.contextName, opts.monitorInterval,
urls);
+ System.out.println(def.toJson());
Review Comment:
Tested this locally and there is not an extra newline in the output. I
redirected the output to a file, then sent that to json_verify to confirm that
it's valid json.
--
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]