xiangfu0 commented on code in PR #19019:
URL: https://github.com/apache/pinot/pull/19019#discussion_r3632407635
##########
pinot-common/src/main/java/org/apache/pinot/common/response/BrokerResponse.java:
##########
@@ -456,4 +458,30 @@ default long getRealtimeTotalMemAllocatedBytes() {
default String getMaterializedViewQueried() {
return null;
}
+
+ /// Returns generic, product-agnostic response metadata: a free-form
string-to-[JsonNode] map that
+ /// any component can populate to surface non-fatal, informational notes
about how the query was
+ /// handled (for example that it was executed with an alternate or degraded
strategy). Values are
+ /// arbitrary JSON, so a note can be a scalar, an object, or an array. This
is intentionally a
+ /// generic extension point: the core engine attaches no semantics to the
keys or values, so
+ /// extensions can add their own entries without a dedicated typed field on
this interface.
+ ///
+ /// This is distinct from [#getTraceInfo()] (per-server trace strings, only
populated when tracing
+ /// is enabled) and from [#getExceptions()] (the error/warning list). The
default is an empty,
+ /// unmodifiable map for implementations that do not support response
metadata.
+ default Map<String, JsonNode> getResponseMetadata() {
Review Comment:
Please hide this default getter from Jackson. `BrokerResponseNative` is
explicitly deserializable and does not override it, so Jackson 2.22.1 treats
`responseMetadata` as a known setterless property and tries to populate the
immutable `Map.of()` returned here. A non-empty value then fails with
`JsonMappingException` caused by `UnsupportedOperationException`;
`ignoreUnknown = true` does not apply because this getter makes the property
known. This breaks legacy response deserialization when the new field is
present. Mark the default getter `@JsonIgnore` while retaining `@JsonProperty`
on the V2 override, and add a `BrokerResponseNative.fromJsonString`
compatibility test with non-empty metadata.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]