[ 
https://issues.apache.org/jira/browse/HADOOP-17214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102259#comment-18102259
 ] 

ASF GitHub Bot commented on HADOOP-17214:
-----------------------------------------

arhxam opened a new pull request, #8662:
URL: https://github.com/apache/hadoop/pull/8662

   ### Description of PR
   
   Fixes [HADOOP-17214](https://issues.apache.org/jira/browse/HADOOP-17214).
   
   `FileSystem.get(URI, Configuration)` currently supports disabling the 
filesystem instance cache only one scheme at a time through 
`fs.SCHEME.impl.disable.cache`. Deployments that use many schemes must 
enumerate every implementation and can miss dynamically introduced schemes.
   
   This patch adds the global `fs.impl.disable.cache` configuration, defaulting 
to `false`. When enabled, `FileSystem.get` creates a fresh instance for every 
scheme. Existing per-scheme switches remain supported and either the global or 
scheme-specific value can disable caching.
   
   The setting is exposed in `CommonConfigurationKeysPublic` and documented in 
`core-default.xml`.
   
   ### How was this patch tested?
   
   On macOS with OpenJDK 17.0.20 and Maven Wrapper 3.9.15:
   
   ```text
   ./mvnw -pl hadoop-common-project/hadoop-common -am -DskipShade \
     -Dtest=TestFileSystemCaching \
     -Dsurefire.failIfNoSpecifiedTests=false test
   
   Tests run: 18, Failures: 0, Errors: 0, Skipped: 0
   BUILD SUCCESS
   ```
   
   The new regression test requests the same URI twice with the global switch 
enabled and verifies distinct instances are returned. Before the implementation 
change it fails because the same cached instance is returned. The existing 
tests also verify that caching remains enabled by default and that 
scheme-specific disabling still works.
   
   ### For code changes:
   
   - [x] Does the title of this PR start with the corresponding JIRA issue id?
   - [ ] Object storage: N/A
   - [ ] If adding new dependencies: no new dependencies
   - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files? N/A
   
   ### AI Tooling
   
   Contains content generated by Codex.
   
   - [x] The PR includes the phrase "Contains content generated by Codex"
   - [x] My use of AI contributions follows the ASF legal policy
         https://www.apache.org/legal/generative-tooling.html
   




> Allow file system caching to be disabled for all file systems
> -------------------------------------------------------------
>
>                 Key: HADOOP-17214
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17214
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 3.3.0
>            Reporter: Haibo Chen
>            Assignee: Haibo Chen
>            Priority: Major
>
> Right now, FileSystem.get(URI uri, Configuration conf) allows caching of file 
> systems to be disabled per scheme.
> We can introduce a new global conf to disable caching for all FileSystem, the 
> default would be false (or do not disable cache gobally).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to