errose28 commented on code in PR #8363:
URL: https://github.com/apache/ozone/pull/8363#discussion_r2098519142
##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/replicas/ReplicasVerify.java:
##########
@@ -67,21 +96,59 @@ public class ReplicasVerify extends Handler {
@CommandLine.ArgGroup(exclusive = false, multiplicity = "1")
private Verification verification;
- private List<ReplicaVerifier> replicaVerifiers;
+ @CommandLine.Option(names = "--threads",
+ description = "Number of threads to use for verification",
+ defaultValue = "10")
+ private int threadCount;
+
+ private ExecutorService verificationExecutor;
+ private ExecutorService writerExecutor;
+ private ThreadLocal<List<ReplicaVerifier>> threadLocalVerifiers;
Review Comment:
For parallel invocation at the command line, each command would be a
separate process with a separate JVM and the static instance would not be
shared. I don't think we need to worry about a CLI entrypoint having multiple
instances invoked in parallel within the same process, so either option should
work fine. However adding `static` conforms with best practices and example
defined in the [ThreadLocal
javadoc](https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html).
> ThreadLocal instances are typically private static fields in classes that
wish to associate state with a thread (e.g., a user ID or Transaction ID).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]