smengcl commented on code in PR #3821:
URL: https://github.com/apache/ozone/pull/3821#discussion_r999987176
##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/OzoneManagerServiceProviderImpl.java:
##########
@@ -255,6 +265,22 @@ public void start() {
TimeUnit.MILLISECONDS);
}
+ private void stopSyncDataFromOMThread() {
+ scheduler.shutdownNow();
+ LOG.debug("Shutdown the OM DB sync scheduler.");
+ }
+
+ @Override
+ public boolean triggerSyncDataFromOMImmediately() {
+ if (!isSyncDataFromOMRunning) {
+ stopSyncDataFromOMThread();
+ scheduler = Executors.newScheduledThreadPool(1);
+ startSyncDataFromOM(0L);
Review Comment:
nit: add a few lines of comments explaining why we need to stop current sync
thread and start another one (to reset the timer)
--
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]