avijayanhwx commented on a change in pull request #850:
URL: https://github.com/apache/hadoop-ozone/pull/850#discussion_r413989769
##########
File path:
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/scm/ReconScmTask.java
##########
@@ -34,26 +32,30 @@
private Thread taskThread;
private ReconTaskStatusDao reconTaskStatusDao;
private volatile boolean running;
+ private volatile boolean registered;
- @Inject
- public ReconScmTask(ReconTaskStatusDao reconTaskStatusDao) {
+ protected ReconScmTask(ReconTaskStatusDao reconTaskStatusDao) {
this.reconTaskStatusDao = reconTaskStatusDao;
}
- public void register() {
+ private void register() {
String taskName = getTaskName();
if (!reconTaskStatusDao.existsById(taskName)) {
ReconTaskStatus reconTaskStatusRecord = new ReconTaskStatus(
taskName, 0L, 0L);
reconTaskStatusDao.insert(reconTaskStatusRecord);
LOG.info("Registered {} task ", taskName);
+ registered = true;
}
Review comment:
Good catch... I will fix it by removing the flag since the DB check is
not expected to be costly.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]