arjun4084346 commented on code in PR #4024:
URL: https://github.com/apache/gobblin/pull/4024#discussion_r1720028969
##########
gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/DagActionStoreChangeMonitor.java:
##########
@@ -146,15 +148,26 @@ protected void initializeMonitor() {
throw new RuntimeException(String.format("Unable to retrieve dagActions
from the dagActionStore while "
+ "initializing the %s",
DagActionStoreChangeMonitor.class.getCanonicalName()), e);
}
- // TODO: make this multi-threaded to add parallelism
+ final ExecutorService executorService =
Executors.newFixedThreadPool(ConfigUtils.getInt(this.config,
ConfigurationKeys.DAG_ACTION_STORE_MONITOR_EXECUTOR_THREADS, 5));
+
for (DagActionStore.DagAction action : dagActions) {
try {
- handleDagAction(action, true);
+ executorService.submit(()->handleDagAction(action, true));
} catch (Exception e) {
log.error("Unexpected error initializing from DagActionStore changes,
upon {}", action, e);
this.unexpectedErrors.mark();
}
}
+ try {
+ boolean executedSuccessfully=
executorService.awaitTermination(ConfigUtils.getInt(this.config,
ConfigurationKeys.DAG_ACTION_STORE_MONITOR_EXECUTOR_TIMEOUT_SECONDS,30),
TimeUnit.SECONDS);
Review Comment:
spaces
--
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]