Xushaohong commented on code in PR #4683:
URL: https://github.com/apache/ozone/pull/4683#discussion_r1188388580
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHAManagerImpl.java:
##########
@@ -92,6 +97,27 @@ public SCMHAManagerImpl(final ConfigurationSource conf,
}
}
+
+ private void createStartTransactionBufferMonitor() {
+ long interval = conf.getTimeDuration(
+ OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL,
+ OZONE_SCM_HA_DBTRANSACTIONBUFFER_FLUSH_INTERVAL_DEFAULT,
+ TimeUnit.MILLISECONDS);
+ SCMHATransactionBufferMonitorTask monitorTask
+ = new SCMHATransactionBufferMonitorTask(
+ (SCMHADBTransactionBuffer) transactionBuffer, ratisServer, interval);
+ trxBufferMonitorService =
+ new BackgroundSCMService.Builder().setClock(scm.getSystemClock())
+ .setScmContext(scm.getScmContext())
+ .setServiceName("SCMHATransactionMonitor")
+ .setIntervalInMillis(interval)
+ .setWaitTimeInMillis(interval)
+ .setPeriodicalTask(() -> {
+ monitorTask.run();
+ }).build();
Review Comment:
```suggestion
.setPeriodicalTask(monitorTask)
.build();
```
Could be simpler
--
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]