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


##########
test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java:
##########
@@ -80,11 +80,58 @@ public class ScanConsistencyIT extends 
AccumuloClusterHarness {
 
   private static final Logger log = 
LoggerFactory.getLogger(ScanConsistencyIT.class);
 
-  @SuppressFBWarnings(value = {"PREDICTABLE_RANDOM", 
"DMI_RANDOM_USED_ONLY_ONCE"},
-      justification = "predictable random is ok for testing")
+  public static void main(String[] args) {
+    /**
+     * @formatter:off

Review Comment:
   This is a javadoc. It doesn't make sense to turn off formatting for 
javadocs... because the end result is still rendered HTML, not formatted plain 
text. Instead, use html tags, like `<p>`, `<ul>`, etc. If you do it right, the 
javadoc will be formatted reasonably so that it's readable.
   
   Also, if you want `<` and `>` to render properly, like you have near the 
bottom of this javadoc, you're going to need to express it as `&lt;` or `&gt;`.



##########
test/src/main/java/org/apache/accumulo/test/ScanConsistencyIT.java:
##########
@@ -80,11 +80,58 @@ public class ScanConsistencyIT extends 
AccumuloClusterHarness {
 
   private static final Logger log = 
LoggerFactory.getLogger(ScanConsistencyIT.class);
 
-  @SuppressFBWarnings(value = {"PREDICTABLE_RANDOM", 
"DMI_RANDOM_USED_ONLY_ONCE"},
-      justification = "predictable random is ok for testing")
+  public static void main(String[] args) {
+    /**
+     * @formatter:off
+     * Note: In order to run main,
+     * 1) Build the project
+     * 2) Copy the accumulo test jar (in /test/target/) into your accumulo 
installation's
+     * lib directory*
+     * 3) Copy the JUnit dependencies into your accumulo installation's lib 
directory:
+     * "mvn dependency:copy-dependencies -DincludeGroupIds="org.junit.jupiter"
+     * cp test/target/dependency/junit-jupiter-* $ACCUMULO_HOME/lib/"
+     *
+     * *Ensure the test jar is in lib before the tablet servers start. Restart 
tablet
+     * servers if necessary.
+     *
+     * Now, this can be run with
+     * "accumulo org.apache.accumulo.test.ScanConsistencyIT <props-file> 
<tmp-dir> <table> <sleep-time>"
+     *      <props-file>: An accumulo client properties file
+     *      <tmp-dir>: tmpDir field for the TestContext object
+     *      <table>: The name of the table to be created
+     *      <sleep-time>: The time to sleep (ms) after submitting the various 
concurrent tasks
+     * @formatter:on
+     */
+    Preconditions.checkArgument(args.length == 4, "Invalid arguments. Use: "
+        + "accumulo org.apache.accumulo.test.ScanConsistencyIT <props-file> 
<tmp-dir> <table> <sleep-time>");
+    final String propsFile = args[0];
+    final String tmpDir = args[1];
+    final String table = args[2];
+    final long sleepTime = Long.parseLong(args[3]);
+
+    try (AccumuloClient client = Accumulo.newClient().from(propsFile).build()) 
{
+      FileSystem fileSystem = FileSystem.get(new Configuration());
+      runTest(client, fileSystem, tmpDir, table, sleepTime);
+    } catch (Exception e) {
+      log.error(e.toString());
+    }

Review Comment:
   No need to catch and log. Just let it get thrown through the main method. 
The stack trace there will be more useful than the truncated exception that 
goes to the logger.



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