-
Notifications
You must be signed in to change notification settings - Fork 780
[#10464] refactor(iceberg): decouple listener events from Iceberg API models #10558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,6 +115,16 @@ public static <T> T cloneIcebergRESTObject(Object message, Class<T> className) { | |
| } | ||
| } | ||
|
|
||
| public static Map<String, Object> toSerializableMap(Object message) { | ||
| ObjectMapper icebergObjectMapper = IcebergObjectMapper.getInstance(); | ||
| try { | ||
| byte[] values = icebergObjectMapper.writeValueAsBytes(message); | ||
| return icebergObjectMapper.readValue(values, Map.class); | ||
| } catch (IOException e) { | ||
|
Comment on lines
+118
to
+123
|
||
| throw new RuntimeException(e); | ||
| } | ||
| } | ||
|
|
||
| public static NameIdentifier getGravitinoNameIdentifier( | ||
| String metalakeName, String catalogName, Namespace namespace) { | ||
| Stream<String> catalogNS = | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
toSerializableMapis new behavior that changes listener payload shapes, but there’s no test coverage asserting that it actually produces a deep-cloned, serializable map (and not Iceberg model instances) for representative requests/responses. Consider adding a focused unit test (e.g., alongside the existingTestIcebergRESTUtils#testSerdeIcebergRESTObject) that validates the returned map structure and that mutations to the original object don’t affect the stored payload.