kfaraz commented on code in PR #18106:
URL: https://github.com/apache/druid/pull/18106#discussion_r2137193505
##########
extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java:
##########
@@ -72,49 +72,50 @@ public void kill(DataSegment segment) throws
SegmentLoadingException
try {
String filename = segmentPath.getName();
- final FileSystem fs = segmentPath.getFileSystem(config);
- if (!filename.endsWith(".zip")) {
- throw new SegmentLoadingException("Unknown file type[%s]",
segmentPath);
- } else {
-
- if (!fs.exists(segmentPath)) {
- log.warn("Segment path [%s] does not exist", segmentPath);
- return;
+ try (final FileSystem fs = segmentPath.getFileSystem(config)) {
Review Comment:
There's already a try on line 73. Maybe just update that to assign the
filesystem variable `fs`.
You can move the assignment `filename = segmentPath.getName()` outside the
try.
--
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]