laserninja opened a new pull request, #10671:
URL: https://github.com/apache/gravitino/pull/10671
### What changes were proposed in this pull request?
Add `pageToken` and `pageSize` query parameter support to the Iceberg REST
server's `listNamespaces`, `listTables`, and `listViews` endpoints, threading
them through the full call chain (REST → Event/Hook Dispatchers → Executors →
CatalogWrapper).
Pagination is implemented as offset-based in-memory pagination in
`IcebergCatalogWrapper`. When `pageSize` is provided, results are sliced and
`nextPageToken` is populated with the offset of the next batch. When no
pagination parameters are provided, existing behavior (return all results) is
preserved.
### Why are the changes needed?
The Iceberg REST spec defines `pageToken` and `pageSize` query parameters on
list endpoints, but Gravitino's Iceberg REST server did not accept or handle
them. Clients with large catalogs cannot paginate results — everything was
returned in a single response.
Fix: #10669
### Does this PR introduce _any_ user-facing change?
Yes. The following REST endpoints now accept optional `pageToken` and
`pageSize` query parameters:
- `GET /v1/{prefix}/namespaces`
- `GET /v1/{prefix}/namespaces/{namespace}/tables`
- `GET /v1/{prefix}/namespaces/{namespace}/views`
### How was this patch tested?
- Added `testListNamespaceWithPagination` in `TestIcebergNamespaceOperations`
- Added `testListTablesWithPagination` in `TestIcebergTableOperations`
- Added `testListViewsWithPagination` in `TestIcebergViewOperations`
- Updated existing tests in `TestIcebergViewHookDispatcher` and
`TestIcebergViewOperationExecutor`
- All existing unit tests 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]