laserninja opened a new pull request, #11635:
URL: https://github.com/apache/gravitino/pull/11635
### What changes were proposed in this pull request?
Implement `fetchPlanningResult` (`GET
/v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{planId}`) and
`cancelPlanning` (`DELETE .../plan/{planId}`) endpoints for the Iceberg REST
server, wired through the full dispatcher chain.
**Files changed:**
- **`IcebergTableOperations`**: Two new JAX-RS endpoints with metrics,
authorization, and logging
- **`IcebergTableOperationDispatcher`**: Interface methods for
`fetchPlanningResult` and `cancelPlanning`
- **`IcebergTableOperationExecutor`**: Delegates to `CatalogWrapperForREST`
- **`IcebergTableEventDispatcher`**: Pre/post/failure event dispatch
- **`IcebergTableHookDispatcher`**: Pass-through delegation (no hooks needed)
- **`CatalogWrapperForREST`**: Throws `NoSuchPlanIdException` (sync-only
planning)
- **`IcebergExceptionMapper`**: Maps `NoSuchPlanIdException` → 404
- **`OperationType`**: Adds `FETCH_PLANNING_RESULT` and `CANCEL_PLANNING`
- **6 new event classes**: Pre/post/failure events for both operations
### Why are the changes needed?
The Iceberg REST spec defines endpoints for fetching and cancelling async
scan plans. Even though Gravitino currently only supports synchronous scan
planning (always returns `COMPLETED`), these endpoints must exist to be
spec-compliant. They correctly return 404 since no async plan IDs are retained,
and provide a clear extension point for future async support.
Fix: #11583
### Does this PR introduce _any_ user-facing change?
Yes — two new REST API endpoints:
- `GET /v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{planId}` —
returns 404 (no async plans exist)
- `DELETE /v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{planId}`
— returns 404 (no async plans exist)
### How was this patch tested?
- Added `testFetchPlanningResultNotFound` and `testCancelPlanningNotFound`
in `TestIcebergTableOperations`
- Tests verify 404 response status and correct event dispatch (`PreEvent` +
`FailureEvent`)
- All existing tests continue to pass: `./gradlew
:iceberg:iceberg-rest-server:test -PskipITs`
--
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]