lasdf1234 opened a new pull request, #11729:
URL: https://github.com/apache/gravitino/pull/11729
### What changes were proposed in this pull request?
Add Iceberg REST Catalog `register-view` support to Gravitino IRC, aligned
with the existing `register-table` flow:
- Expose `POST .../namespaces/{namespace}/register-view` in
`IcebergNamespaceOperations`.
- Wire `registerView` through the view dispatcher chain
(`IcebergViewHookDispatcher` → `IcebergViewEventDispatcher` →
`IcebergViewOperationExecutor` → `IcebergCatalogWrapper` → Iceberg
`CatalogHandlers.registerView`).
- When authorization is enabled, strictly import the view into Gravitino
metadata and set the authenticated IRC caller as owner (same semantics as
`register-table`).
- Add audit/event support (`IcebergRegisterViewPreEvent`, success/failure
events, `OperationType`).
- Advertise `Endpoint.V1_REGISTER_VIEW` in IRC config.
- Add unit tests for REST, dispatcher, executor, and hook layers.
Fix: #11728
### Why are the changes needed?
Iceberg REST API defines `register-view` for registering existing view
metadata, but Gravitino IRC only supported `register-table`. This gap blocks
view import/migration workflows and leaves IRC view endpoint coverage
incomplete.
### Does this PR introduce _any_ user-facing change?
Yes.
1. New IRC endpoint: `POST /v1/{prefix}namespaces/{namespace}/register-view`.
2. IRC `/v1/config` now includes `V1_REGISTER_VIEW` in the advertised
endpoints list.
### How was this patch tested?
- `./gradlew :iceberg:iceberg-rest-server:test --tests
org.apache.gravitino.iceberg.service.rest.TestIcebergViewOperations -PskipITs`
- `./gradlew :iceberg:iceberg-rest-server:test --tests
org.apache.gravitino.iceberg.service.dispatcher.TestIcebergViewHookDispatcher
-PskipITs`
- `./gradlew :iceberg:iceberg-rest-server:test --tests
org.apache.gravitino.iceberg.service.dispatcher.TestIcebergViewOperationExecutor
-PskipITs`
Made with [Cursor](https://cursor.com)
--
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]