Skip to content

Commit 0812d27

Browse files
authored
feat: Move DefaultMetadataCache into its own module (#19125)
## Which issue does this PR close? Implements #19074 ## Rationale for this change As the default cache implementations expand, the module structure under `datafusion/execution/src/cache/` has become crowded. This PR continues the pattern established in #18855 by separating `DefaultFilesMetadataCache` into its own module to improve code organization and maintainability. <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. --> ## What changes are included in this PR? - Created new `file_metadata_cache.rs` module containing: - `DefaultFilesMetadataCacheState` (internal state management) - `DefaultFilesMetadataCache` (public struct and implementation) - All trait implementations (`FileMetadataCache` and `CacheAccessor`) - All 3 related tests and test helpers - Updated `mod.rs` to declare and export the new module - Updated `cache_manager.rs` to import from new location - Cleaned up `cache_unit.rs` (reduced from 863 to 159 lines) <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> Yes, all existing tests have been moved to the new module and pass successfully ## Are there any user-facing changes? No user-facing changes. This is purely an internal code organization refactoring. <!-- If there are user-facing changes then we may require documentation to be updated before approving the PR. --> <!-- If there are any breaking changes to public APIs, please add the `api change` label. -->
1 parent adaed42 commit 0812d27

File tree

4 files changed

+744
-708
lines changed

4 files changed

+744
-708
lines changed

datafusion/execution/src/cache/cache_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::cache::CacheAccessor;
19-
use crate::cache::cache_unit::DefaultFilesMetadataCache;
19+
use crate::cache::DefaultFilesMetadataCache;
2020
use datafusion_common::{Result, Statistics};
2121
use object_store::ObjectMeta;
2222
use object_store::path::Path;

0 commit comments

Comments
 (0)