Skip to content

refactor(core): make SchemaManager an interface - #9174

Open
baiyangtx wants to merge 4 commits into
apache:masterfrom
baiyangtx:zhangyongxiang.alpha/codex-schema-manager-interface
Open

refactor(core): make SchemaManager an interface#9174
baiyangtx wants to merge 4 commits into
apache:masterfrom
baiyangtx:zhangyongxiang.alpha/codex-schema-manager-interface

Conversation

@baiyangtx

@baiyangtx baiyangtx commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Purpose

SchemaManager is currently a concrete file-system-backed class. This couples callers to a specific implementation and makes it difficult for catalogs and table implementations to provide specialized schema-management behavior while keeping the rest of the codebase independent of the storage mechanism.

This PR turns SchemaManager into an interface and moves the existing implementation to FileSystemSchemaManager.

The change:

  • defines the schema-management contract in SchemaManager;
  • keeps the current file-system behavior unchanged in FileSystemSchemaManager;
  • updates file-system-specific construction sites to instantiate FileSystemSchemaManager while keeping consumers typed against SchemaManager;
  • preserves the existing SchemaManager static utility entry points by delegating them to the default implementation; and
  • includes the latest schema operations, such as schema merging, rollback, and schema-path handling, in the interface contract.

This separation allows alternative or decorated schema-manager implementations to be introduced without requiring downstream table components to depend on the file-system implementation. No schema format or runtime behavior is changed by this refactoring.

Tests

  • Existing SchemaManagerTest coverage continues to exercise schema creation, evolution, commit, rollback, and utility behavior through the interface and default implementation.
  • Core compilation and project checks passed:
mvn -pl paimon-core -am -DskipTests compile

zhangyongxiang.alpha added 4 commits August 11, 2026 20:16
Move the existing file-system implementation to FileSystemSchemaManager and update construction sites to use it. Keep consumers typed against SchemaManager and preserve its static utility API.
…a/codex-schema-manager-interface

# Conflicts:
#	paimon-core/src/main/java/org/apache/paimon/privilege/FileBasedPrivilegeManager.java
@baiyangtx

Copy link
Copy Markdown
Contributor Author

@Aitozi @JingsongLi PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant