Skip to content

Commit 607ba3e

Browse files
committed
fix
1 parent 5a1431c commit 607ba3e

File tree

1 file changed

+6
-1
lines changed
  • paimon-filesystems/paimon-oss-impl/src/main/java/org/apache/paimon/oss

1 file changed

+6
-1
lines changed

paimon-filesystems/paimon-oss-impl/src/main/java/org/apache/paimon/oss/OSSFileIO.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public class OSSFileIO extends HadoopCompliantFileIO {
7272
*/
7373
private static final Map<CacheKey, AliyunOSSFileSystem> CACHE = new ConcurrentHashMap<>();
7474

75+
// create a shared config to avoid load properties everytime
76+
private static final Configuration SHARED_CONFIG = new Configuration();
77+
7578
private Options hadoopOptions;
7679
private boolean allowCache = true;
7780

@@ -109,7 +112,9 @@ protected FileSystem createFileSystem(org.apache.hadoop.fs.Path path) {
109112
final String authority = path.toUri().getAuthority();
110113
Supplier<AliyunOSSFileSystem> supplier =
111114
() -> {
112-
Configuration hadoopConf = new Configuration(false);
115+
// create config from base config, if initializing a new config, it will
116+
// retrieve props from the file, which comes at a high cost
117+
Configuration hadoopConf = new Configuration(SHARED_CONFIG);
113118
hadoopOptions.toMap().forEach(hadoopConf::set);
114119
URI fsUri = path.toUri();
115120
if (scheme == null && authority == null) {

0 commit comments

Comments
 (0)