File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
paimon-filesystems/paimon-oss-impl/src/main/java/org/apache/paimon/oss Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments