prateekm commented on a change in pull request #1434:
URL: https://github.com/apache/samza/pull/1434#discussion_r503568064
##########
File path: samza-rest/src/main/java/org/apache/samza/rest/SamzaRestService.java
##########
@@ -104,24 +99,16 @@ public static void main(String[] args)
ServletContainer container = new ServletContainer(samzaRestApplication);
restService.addServlet(container, "/*");
- // Schedule monitors to run
- ThreadFactory threadFactory = new ThreadFactoryBuilder().setDaemon(true)
-
.setNameFormat("MonitorThread-%d")
- .build();
- ScheduledExecutorService schedulingService =
Executors.newScheduledThreadPool(1, threadFactory);
- schedulingProvider = new
ScheduledExecutorSchedulingProvider(schedulingService);
- SamzaMonitorService monitorService = new SamzaMonitorService(config,
- metricsRegistry,
- schedulingProvider);
+ monitorService = new SamzaMonitorService(config, metricsRegistry);
monitorService.start();
restService.runBlocking();
monitorService.stop();
} catch (Throwable t) {
log.error("Exception in main.", t);
} finally {
- if (schedulingProvider != null) {
- schedulingProvider.stop();
+ if (monitorService != null) {
+ monitorService.stop();
Review comment:
monitorService.stop is already being called on line 106. Do you need to
remove that?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]