Repository navigation
Conversation
Add the public Domain API in the `org.apache.gravitino.domain` package, following the Domain design (apache#13866), and `MetadataObject.Type.DOMAIN` as a single-level name type. MetadataAuthzHelper now collects the entity types of the metadata object types that are backed by an entity, so a type without an entity yet, such as DOMAIN, does not break its static initialization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p Function support Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…NonEmptyDomainException Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r#withDomains Replace withIncludeAllSubdomains and withSubdomains with a single withDomains option: the names of the listed domain and/or its sub-domains the members come from, all of them when not set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acks another domain A domain name may contain "/". Instead, creating a domain with the default backing tag fails when a tag with that name already backs another domain, which also covers names left behind by moving or renaming a domain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document 403 for binding a backing tag the caller does not own, the nearest-level rule for membership, the sub-domain reported for a member that carries several backing tags, and an empty result when every name given to withDomains is ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code Coverage Report
Files
|
Document that the parent name is returned even when the parent is not visible, how a backing tag with or without a value matches tag assignments, and that changes apply to the current state of the domain with the last write winning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A name given to DomainMemberFilter#withDomains selects that domain's scope: a top-level domain with its visible sub-domains, or a sub-domain alone. Members of the listed domain itself are those whose DomainMember#subdomain() is empty. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Following design v1.23, catalogs and schemas are never members: a backing tag on them makes the leaf objects under it members, and member listing expands them to those objects. DomainMember's supported types become the leaf types, and a member's sub-domain is decided by its effective tags. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- createDomain and createSubdomain take an explicit backing tag and whether to create it; there is no default tag name or implicit adoption. - Add BackingTagAlreadyBoundException for a binding that conflicts with another domain. - Replace DomainMember#subdomain() and Domain#inheritedFrom() with DomainRelation (DIRECT, INHERITED, VIA_SUBDOMAIN with a source), listing every relation that applies. - SupportsDomains is on leaf types only and lists every visible domain whose scope contains the object; drop it from Catalog and Schema. - Document that privileges on a domain apply to its sub-domains, so moving or detaching changes access. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Following design v1.25, the metalake, the current parent and the domain are checked together: an owner of any of them passes, otherwise a privilege must be allowed on one and denied on none, so a parent's allow does not override a deny on the sub-domain. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- SupportsDomains lists the parents of visible sub-domains only. - DomainRelation#inherited keeps only the source's name and type, so relations built from any MetadataObject implementation compare equal. - A member's relations are not narrowed by the filter's domains. - Sub-domain listings return visible sub-domains; snapshot operations address the domain by name; MetadataObject.Type.DOMAIN describes leaf membership and that a domain cannot be tagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add the public Domain API, following the Domain design in #13867 (design doc v1.24, still in review):
org.apache.gravitino.domain:Domain: name, comment, properties,Status(DRAFT/PUBLISHED), parent, backing tag (TagValue), andrelationsfor domains of an object. Operations on a single domain live on the object:publish(),unpublish(),attachToParent(parent)(attach or move),detachFromParent()andupdateBackingTag(TagValue)(nullremoves it), each returning a new snapshot.createSubdomain(with an explicit backing tag),listSubdomains/listSubdomainsInfoandlistMembers(DomainMemberFilter).DomainOperationsfor the metalake: list, get, create (top-level, with an explicit backing tag: a new tag to create or an existing (tag, value)), alter, delete.DomainChange: rename, updateComment, setProperty, removeProperty.SupportsDomains: list every visible domain whose scope contains a leaf object, with its relations. It is read-only; objects join or leave a domain throughSupportsTagswith the domain's backing tag.DomainRelation: how an object relates to a domain (DIRECT,INHERITEDfrom a catalog or schema,VIA_SUBDOMAIN), reported for members and for domains of an object.DomainMember, withSUPPORTED_TYPES: the leaf types table, view, fileset, topic, model and semantic model. Catalogs and schemas are never members; a backing tag on them makes the leaf objects under them members.DomainMemberFilter:types,nameContains, anddomains, the domains whose scope is listed (the whole scope of the listed domain when not set).supportsDomains()default accessors onTable,View,Fileset,Topic,ModelandSemanticModel.NoSuchDomainException,DomainAlreadyExistsException,NonEmptyDomainException(deleting a domain that has subdomains) andBackingTagAlreadyBoundException(a backing tag binding that conflicts with another domain).MetadataObject.Type.DOMAINas a single-level name type.MetadataAuthzHelpernow builds its metadata object entity types fromMetadataObjectUtil.metadataObjectEntityTypes(). A type with no entity yet, such asDOMAIN, no longer breaks its static initialization.Storage, REST endpoints, clients, MCP tools and authorization come in later subtasks.
DOMAINis not a taggable type; the backing tag is stored on the domain itself.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 newMetadataObject.Type.DOMAINvalue. Nothing implements the API yet, so behavior does not change.How was this patch tested?
TestDomainChange,TestDomainMemberFilter,TestDomainRelation,TestExceptions#testDomainExceptionsHierarchy,TestMetadataObjects#testDomainObjectandTestMetadataObjectUtil#testMetadataObjectEntityTypes../gradlew :api:build -PskipITs./gradlew compileTestJava -PskipITsfor all modulesTestMetadataAuthzHelperinserver-common🤖 Generated with Claude Code