Will-Lo commented on code in PR #3879:
URL: https://github.com/apache/gobblin/pull/3879#discussion_r1498076026
##########
gobblin-utility/src/main/java/org/apache/gobblin/util/ParallelRunner.java:
##########
@@ -86,6 +87,10 @@ public class ParallelRunner implements Closeable {
public static final String PARALLEL_RUNNER_THREADS_KEY =
"parallel.runner.threads";
public static final int DEFAULT_PARALLEL_RUNNER_THREADS = 10;
+ public static int readConfigNumParallelRunnerThreads(Properties props) {
+ return Integer.parseInt(props.getProperty(PARALLEL_RUNNER_THREADS_KEY,
Integer.toString(DEFAULT_PARALLEL_RUNNER_THREADS)));
+ }
+
Review Comment:
Does it make sense to have this config/function when a lot of other classes
pass in a different config to control the number of threads in this class?
Example: Metadata writer defines their own config for how many registration
threads it wants when using this class. Seems to me that this class is just a
generic parallel runner class and can be used in a lot of different areas, so
it makes less sense for it to have its own dedicated config for number of
threads unless it's defining a default.
##########
gobblin-utility/src/main/java/org/apache/gobblin/util/ParallelRunner.java:
##########
@@ -86,6 +87,10 @@ public class ParallelRunner implements Closeable {
public static final String PARALLEL_RUNNER_THREADS_KEY =
"parallel.runner.threads";
public static final int DEFAULT_PARALLEL_RUNNER_THREADS = 10;
+ public static int readConfigNumParallelRunnerThreads(Properties props) {
+ return Integer.parseInt(props.getProperty(PARALLEL_RUNNER_THREADS_KEY,
Integer.toString(DEFAULT_PARALLEL_RUNNER_THREADS)));
+ }
+
Review Comment:
We can have it as `getDefaultParallelRunnerConcurrency` ?
--
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]