sijie commented on a change in pull request #944: Introduce MockClock and
MockExecutorController to improve timer-based testing
URL: https://github.com/apache/bookkeeper/pull/944#discussion_r159744730
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsMonitor.java
##########
@@ -40,117 +45,109 @@
/**
* Thread to monitor the disk space periodically.
*/
-class LedgerDirsMonitor extends BookieThread {
+class LedgerDirsMonitor {
private static final Logger LOG =
LoggerFactory.getLogger(LedgerDirsMonitor.class);
private final int interval;
private final ServerConfiguration conf;
private final ConcurrentMap<File, Float> diskUsages;
private final DiskChecker diskChecker;
private final LedgerDirsManager ldm;
+ private ScheduledExecutorService executor;
+ private ScheduledFuture<?> checkTask;
- public LedgerDirsMonitor(final ServerConfiguration conf, final DiskChecker
diskChecker,
+ public LedgerDirsMonitor(final ServerConfiguration conf,
+ final DiskChecker diskChecker,
final LedgerDirsManager ldm) {
- super("LedgerDirsMonitorThread");
this.interval = conf.getDiskCheckInterval();
this.conf = conf;
this.diskChecker = diskChecker;
this.diskUsages = ldm.getDiskUsages();
this.ldm = ldm;
}
- @Override
- public void run() {
- while (true) {
- try {
- List<File> writableDirs = ldm.getWritableLedgerDirs();
- // Check all writable dirs disk space usage.
- for (File dir : writableDirs) {
+ private void check() {
Review comment:
yes there is no code change there. I will add a note to description and
leave a comment so people will see it.
----------------------------------------------------------------
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