ctubbsii commented on code in PR #33:
URL: 
https://github.com/apache/accumulo-classloaders/pull/33#discussion_r2696024914


##########
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:
   It's not an "extra" one, but the fact that there's one at the end at all, 
means the checksum for the file written from this utility will not match the 
checksum when the file is copied without the extra newline, which is what 
LocalStore does, and so does our test code, which just write the toJson 
directly, without the extra newline.



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