yuqi1129 opened a new pull request, #14915:
URL: https://github.com/apache/gravitino/pull/14915
### What changes were proposed in this pull request?
Add the public Glossary API in `api/`, following the Glossary design
(#14238):
- `org.apache.gravitino.glossary`:
- `GlossaryTerm`: name, definition, synonyms, `Status` (`DRAFT` /
`APPROVED` / `DEPRECATED`), domains, broader, narrower and related terms,
links, source reference, properties and revision (`version`). `matchedBy()` and
`bindings()` are set only on the terms returned by a lookup.
`listBindings(kind)` lists the bindings of a term.
- `GlossaryOperations` for the metalake: list, get, create, alter, drop,
and `matchTerms(words, domain)` for agents that do not use MCP.
- `TermSpec` (builder) for the content of a new term. Only the name is
required; without a status, a term is `APPROVED`.
- `TermChange`: rename, updateDefinition, setStatus, add/removeSynonym,
add/removeDomain, add/removeBroader, add/removeRelated, updateLinks,
setSourceRef, setProperty, removeProperty.
- `TermLink`, `TermMatch` and `TermBinding` (`IMPLEMENTED_BY` on catalogs,
schemas, tables, views, columns, filesets, topics and models; `USED_BY` on a
metric of a semantic model).
- `SupportsTerms` (list and bind terms, and `listColumnTerms()` for tables
and views) and `SupportsMetricTerms` (the terms of the metrics of a semantic
model).
- `supportsTerms()` default accessors on `Catalog`, `Schema`, `Table`,
`View`, `Column`, `Fileset`, `Topic` and `Model`, and `supportsMetricTerms()`
on `SemanticModel`.
- `NoSuchTermException` and `TermAlreadyExistsException`.
- `MetadataObject.Type.GLOSSARY_TERM` as a single-level name type.
- `MetadataAuthzHelper` builds its metadata object entity types from
`MetadataObjectUtil.metadataObjectEntityTypes()`, so a type with no entity yet,
such as `GLOSSARY_TERM`, does not break its static initialization. This is the
same change as in the Domain API (#13881).
Storage, core, REST, clients, MCP and authorization come in later subtasks.
The three definition privileges are added with authorization, as the Domain
privileges were, so their bits do not clash with the Domain branch.
### Why are the changes needed?
This is the first code subtask of the Business Glossary epic (#14913). It
defines the public API that the core, server and client subtasks implement.
Fixes #14914
### Does this PR introduce _any_ user-facing change?
It adds a new public API in `api/` and a new
`MetadataObject.Type.GLOSSARY_TERM` value. Nothing implements the API yet, so
behavior does not change.
### How was this patch tested?
- New tests: `TestTermChange`, `TestTermSpec`, `TestTermValues`,
`TestMetadataObjects#testGlossaryTermObject`,
`TestExceptions#testGlossaryExceptionsHierarchy` and
`TestMetadataObjectUtil#testMetadataObjectEntityTypes`.
- Commands run:
- `./gradlew :api:build -PskipITs` (includes Javadoc)
- `./gradlew compileTestJava -PskipITs` for all modules
- `TestMetadataObjectUtil` and `TestRelationalGarbageCollector` in `core`
- `TestMetadataAuthzHelper` and
`TestJcasbinAuthorizer#testMetalakeDropEvictsEveryMetadataTypeAndKeepsOtherMetalake`
in `server-common`
--
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]