[#11583] feat(iceberg-rest): Implement fetch and cancel endpoints for async scan planning lifecycle#11635
Open
laserninja wants to merge 1 commit into
Open
Conversation
roryqi
reviewed
Jun 14, 2026
| */ | ||
| public FetchPlanningResultResponse fetchPlanningResult( | ||
| TableIdentifier tableIdentifier, String planId) { | ||
| throw new NoSuchPlanIdException( |
Contributor
There was a problem hiding this comment.
We don't override this method.
…ts for async scan planning lifecycle
Add fetchPlanningResult (GET .../plan/{planId}) and cancelPlanning
(DELETE .../plan/{planId}) endpoints to the Iceberg REST server, wired
through the full dispatcher chain (executor, event, hook dispatchers).
Since Gravitino currently performs synchronous scan planning only,
both methods throw NoSuchPlanIdException (404). This provides correct
HTTP semantics per the Iceberg REST spec while leaving a clear
extension point for future async planning support.
Changes:
- IcebergTableOperationDispatcher: add interface methods
- IcebergTableOperationExecutor: delegate to CatalogWrapperForREST
- IcebergTableEventDispatcher: pre/post/failure event dispatch
- IcebergTableHookDispatcher: pass-through delegation
- CatalogWrapperForREST: throw NoSuchPlanIdException
- IcebergExceptionMapper: map NoSuchPlanIdException to 404
- IcebergTableOperations: REST endpoints with auth and metrics
- OperationType: add FETCH_PLANNING_RESULT, CANCEL_PLANNING
- 6 new event classes for the event listener system
- Tests for both endpoints verifying 404 and event dispatch
c1d78d9 to
98ca42d
Compare
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?
Implement
fetchPlanningResult(GET /v1/{prefix}/namespaces/{namespace}/tables/{table}/plan/{planId}) andcancelPlanning(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 loggingIcebergTableOperationDispatcher: Interface methods forfetchPlanningResultandcancelPlanningIcebergTableOperationExecutor: Delegates toCatalogWrapperForRESTIcebergTableEventDispatcher: Pre/post/failure event dispatchIcebergTableHookDispatcher: Pass-through delegation (no hooks needed)CatalogWrapperForREST: ThrowsNoSuchPlanIdException(sync-only planning)IcebergExceptionMapper: MapsNoSuchPlanIdException→ 404OperationType: AddsFETCH_PLANNING_RESULTandCANCEL_PLANNINGWhy 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?
testFetchPlanningResultNotFoundandtestCancelPlanningNotFoundinTestIcebergTableOperationsPreEvent+FailureEvent)./gradlew :iceberg:iceberg-rest-server:test -PskipITs