hangc0276 commented on code in PR #4018:
URL: https://github.com/apache/bookkeeper/pull/4018#discussion_r1264976011
##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/LedgerDirsManager.java:
##########
@@ -290,6 +299,39 @@ public void addToWritableDirs(File dir, boolean
underWarnThreshold) {
}
}
+ /**
+ * Add the dir to warn dirs list.
+ */
+ @VisibleForTesting
+ public void addToWarnDirs(File dir) {
+ if (!warnDirs.contains(dir)) {
+ LOG.warn(dir + " usages is above warn threshold. Adding it to warn
dirs list");
+ List<File> updatedFilledDirs = new ArrayList<File>(warnDirs);
Review Comment:
Why not use `warnDirs.add(dir)` directly? Due to the warnDirs is a list,
does it will happen the same dir being add to the list twice?
--
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]