xiangfu0 commented on code in PR #19580:
URL: https://github.com/apache/pinot/pull/19580#discussion_r4031571261
##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/store/SegmentLocalFSDirectory.java:
##########
@@ -182,12 +182,8 @@ public long getDiskSizeBytes() {
// check that v3 subdirectory exists since the format may not have been
converted
if (_segmentDirectory != null && _segmentDirectory.exists()) {
- try {
- return FileUtils.sizeOfDirectory(_segmentDirectory.toPath().toFile());
- } catch (IllegalArgumentException e) {
- LOGGER.error("Failed to read disk size for directory: {}",
_segmentDirectory.getAbsolutePath());
- return -1;
- }
+ // A concurrent reload may be rewriting this directory in place, so use
the delete-tolerant walk.
+ return
org.apache.pinot.common.utils.FileUtils.sizeOfDirectory(_segmentDirectory);
Review Comment:
Is this the only usage? shall we also banned the
`org.apache.commons.io.FileUtils.sizeOfDirectory` usage from checkstyle?
--
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]