API, Core: Implement events endpoint#15990
Draft
stevenzwu wants to merge 7 commits intoapache:mainfrom
Draft
Conversation
Add request and response objects for the /events endpoint, including CatalogObjectIdentifier, CatalogObjectType, CatalogObjectUuid in the API module, and Event, Operation types, parsers, QueryEventsRequest, QueryEventsResponse with serialization support in core. Based on apache#14142 Made-with: Cursor Model: claude-4.6-opus-high-thinking
…tern Replace 14 individual operation files and 14 individual parser files with a single CatalogOperation interface (with inner classes) and a single CatalogOperationParser class (with private writeXxx/readXxx methods), following the established MetadataUpdate/MetadataUpdateParser pattern. Also fixes CustomOperation serialization to properly include properties. Made-with: Cursor Model: claude-4.6-opus-high-thinking
Use a namespace-and-name CatalogObjectIdentifier so event query filters follow the proposed REST shape and can reuse the existing identifier parsing pattern. Also move EventParser next to Event, rename the response continuation token field, and add round-trip parser coverage. Made-with: Cursor Model: GPT-5.4
Reject empty namespace levels in CatalogObjectIdentifier and enforce non-negative event query bounds so invalid filters are rejected consistently during request construction and parsing. Made-with: Cursor Model: GPT-5.4
- Add @nullable to QueryEventsResponse.continuationToken and handle null in parser serialization/deserialization - Use primitive int/long for required Event fields instead of boxed types - Fix RESTSerializers naming: DeSerializer -> Deserializer, EventsResponse -> QueryEventsResponse - Standardize toJsonPretty to toJson(obj, boolean) across all parsers - Add Preconditions constructor validation to all CatalogOperation inner classes - Use consistent Preconditions.checkArgument in CatalogObjectUuid constructor with null check for type parameter - Pass ImmutableList.of() instead of null for optional requirements in CatalogOperationParser - Simplify QueryEventsResponseParser.fromJson builder to chained expression - Add .hasMessage() assertions to TestCatalogObjectUuidParser Made-with: Cursor Model: claude-4.6-opus-high-thinking
Merge 14 individual TestXxxOperationParser files into a single TestCatalogOperationParser class in the rest/events/ package, mirroring the TestMetadataUpdateParser pattern. All test coverage is preserved with deduplicated null/error handling tests. Made-with: Cursor Model: claude-4.6-opus-high-thinking
Move CatalogOperation and OperationType from rest.events.operations to rest.events, eliminating the unnecessary subpackage nesting. Made-with: Cursor Model: claude-4.6-opus-high-thinking
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.
Implement the events endpoint proposal (see spec PR #12584). This would replace PR #14142 as the original author couldn't work on it anymore.
This is in draft status as we will have some open questions on the spec itself. e.g.
As the spec adjusts, so does the implementation. Current purpose is to demonstrate what the implementation would look like. This will be broken down to smaller PRs for the formal review process.