Skip to content

Commit 5a1431c

Browse files
committed
fix
1 parent addd004 commit 5a1431c

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

paimon-filesystems/paimon-s3-impl/src/main/java/org/apache/paimon/s3/HadoopCompliantFileIO.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.apache.hadoop.fs.FileSystem;
3131

3232
import java.io.IOException;
33-
import java.io.UncheckedIOException;
3433
import java.util.Map;
3534
import java.util.concurrent.ConcurrentHashMap;
3635

@@ -146,19 +145,12 @@ private FileSystem getFileSystem(org.apache.hadoop.fs.Path path) throws IOExcept
146145
if (authority == null) {
147146
authority = "DEFAULT";
148147
}
149-
try {
150-
return map.computeIfAbsent(
151-
authority,
152-
k -> {
153-
try {
154-
return createFileSystem(path);
155-
} catch (IOException e) {
156-
throw new UncheckedIOException(e);
157-
}
158-
});
159-
} catch (UncheckedIOException e) {
160-
throw e.getCause();
148+
FileSystem fs = map.get(authority);
149+
if (fs == null) {
150+
fs = createFileSystem(path);
151+
map.put(authority, fs);
161152
}
153+
return fs;
162154
}
163155

164156
protected abstract FileSystem createFileSystem(org.apache.hadoop.fs.Path path)

0 commit comments

Comments
 (0)