jerryshao opened a new pull request, #13881:
URL: https://github.com/apache/gravitino/pull/13881
### What changes were proposed in this pull request?
Add the public Domain API, following the Domain design in #13867 (design doc
v1.20, still in review):
- `org.apache.gravitino.domain`:
- `Domain`: name, comment, properties, `Status` (`DRAFT` / `PUBLISHED`),
parent, backing tag (`TagValue`), and `inheritedFrom` for inherited membership.
Operations on a single domain live on the object:
- `publish()`, `unpublish()`, `attachToParent(parent)` (attach or move),
`detachFromParent()` and `updateBackingTag(TagValue)` (`null` removes it), each
returning a new snapshot.
- `createSubdomain`, `listSubdomains` / `listSubdomainsInfo` and
`listMembers(DomainMemberFilter)`.
- `DomainOperations` for the metalake: list, get, create (top-level),
alter, delete.
- `DomainChange`: rename, updateComment, setProperty, removeProperty.
- `SupportsDomains`: list the domains of a metadata object. It is
read-only; objects join or leave a domain through `SupportsTags` with the
domain's backing tag.
- `DomainMember`, with `SUPPORTED_TYPES` (catalog, schema, table, view,
fileset, topic, model and semantic model), and `DomainMemberFilter` (`types`,
`nameContains`, and `domains`: the listed domain and/or subdomains the members
come from, all when not set).
- `supportsDomains()` default accessors on `Catalog`, `Schema`, `Table`,
`View`, `Fileset`, `Topic`, `Model` and `SemanticModel`.
- `NoSuchDomainException`, `DomainAlreadyExistsException` and
`NonEmptyDomainException` (deleting a domain that has subdomains).
- `MetadataObject.Type.DOMAIN` as a single-level name type.
- `MetadataAuthzHelper` now builds its metadata object entity types from
`MetadataObjectUtil.metadataObjectEntityTypes()`. A type with no entity yet,
such as `DOMAIN`, no longer breaks its static initialization.
Storage, REST endpoints, clients, MCP tools and authorization come in later
subtasks. Registering `DOMAIN` as taggable in `TagManager` is part of the core
subtask.
### Why are the changes needed?
This is the first step of the Domain epic (#13864). It defines the public
API that the core, server and client subtasks implement.
Fix: #13877
### Does this PR introduce _any_ user-facing change?
It adds a new public API in `api/` and a new `MetadataObject.Type.DOMAIN`
value. Nothing implements the API yet, so behavior does not change.
### How was this patch tested?
- New tests: `TestDomainChange`, `TestDomainMemberFilter`,
`TestMetadataObjects#testDomainObject` and
`TestMetadataObjectUtil#testMetadataObjectEntityTypes`.
- Commands run:
- `./gradlew :api:build -PskipITs`
- `./gradlew compileTestJava -PskipITs` for all modules
- `TestMetadataAuthzHelper` in `server-common`
- the core tag and garbage collector tests
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]