eolivelli commented on a change in pull request #1683: Enhance Auditor
URL: https://github.com/apache/bookkeeper/pull/1683#discussion_r218501416
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/replication/Auditor.java
##########
@@ -345,21 +348,66 @@ public void start() {
return;
}
+ try {
+ watchBookieChanges();
+ knownBookies = getAvailableBookies();
+ } catch (BKException bke) {
+ LOG.error("Couldn't get bookie list, so exiting", bke);
+ submitShutdownTask();
+ }
+
+ try {
+ this.ledgerUnderreplicationManager
+ .notifyLostBookieRecoveryDelayChanged(new
LostBookieRecoveryDelayChangedCb());
+ } catch (UnavailableException ue) {
+ LOG.error("Exception while registering for
LostBookieRecoveryDelay change notification, so exiting",
+ ue);
+ submitShutdownTask();
+ }
+
+ long bookieCheckInterval =
conf.getAuditorPeriodicBookieCheckInterval();
+ if (bookieCheckInterval == 0) {
+ LOG.info("Auditor periodic bookie checking disabled, running
once check now anyhow");
+ executor.submit(bookieCheck);
+ } else {
+ LOG.info("Auditor periodic bookie checking enabled"
+ + " 'auditorPeriodicBookieCheckInterval' {} seconds",
bookieCheckInterval);
+ executor.scheduleAtFixedRate(bookieCheck, 0,
bookieCheckInterval, TimeUnit.SECONDS);
+ }
+
long interval = conf.getAuditorPeriodicCheckInterval();
if (interval > 0) {
- LOG.info("Auditor periodic ledger checking enabled"
- + " 'auditorPeriodicCheckInterval' {} seconds",
interval);
+ LOG.info("Auditor periodic ledger checking enabled" + "
'auditorPeriodicCheckInterval' {} seconds",
+ interval);
+
+ long checkAllLedgersLastExecutedCTime = -1;
+ try {
+ checkAllLedgersLastExecutedCTime =
ledgerUnderreplicationManager.getCheckAllLedgersCTime();
+ } catch (UnavailableException ue) {
+ LOG.error("Got UnavailableException while trying to get
checkAllLedgersCTime", ue);
+ }
+ long durationSinceLastExecutionInSecs =
(System.currentTimeMillis() - checkAllLedgersLastExecutedCTime)
Review comment:
This will be weird if checkAllLedgersLastExecutedCTime is -1
Btw it will work
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services