File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
core/trino-main/src/main/java/io/trino/server/ui
lib/trino-plugin-toolkit/src/main/java/io/trino/plugin/base/metrics Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 5555import static com .fasterxml .jackson .annotation .JsonIgnoreProperties .Value .forIgnoredProperties ;
5656import static io .trino .connector .system .KillQueryProcedure .createKillQueryException ;
5757import static io .trino .connector .system .KillQueryProcedure .createPreemptQueryException ;
58+ import static io .trino .plugin .base .metrics .TDigestHistogram .DIGEST_PROPERTY ;
5859import static io .trino .security .AccessControlUtil .checkCanKillQueryOwnedBy ;
5960import static io .trino .security .AccessControlUtil .checkCanViewQueryOwnedBy ;
6061import static io .trino .security .AccessControlUtil .filterQueries ;
@@ -169,7 +170,7 @@ private JsonCodec<QueryInfo> buildQueryInfoCodec(ObjectMapper objectMapper)
169170 .copy ()
170171 .setDefaultAttributes (attrs );
171172 // Don't serialize TDigestHistogram.digest which isn't useful and human readable
172- mapper .configOverride (TDigestHistogram .class ).setIgnorals (forIgnoredProperties ("digest" ));
173+ mapper .configOverride (TDigestHistogram .class ).setIgnorals (forIgnoredProperties (DIGEST_PROPERTY ));
173174
174175 // Do not output @class property for metric types
175176 mapper .addMixIn (Metric .class , DropTypeInfo .class );
Original file line number Diff line number Diff line change 3333public class TDigestHistogram
3434 implements Distribution <TDigestHistogram >
3535{
36+ // This is important so that we can instruct Jackson to ignore this property
37+ // in certain places (e.g. UiQueryResource)
38+ public static final String DIGEST_PROPERTY = "digest" ;
39+
3640 private final TDigest digest ;
3741
3842 public static TDigestHistogram fromValue (double value )
@@ -57,15 +61,15 @@ public synchronized TDigest getDigest()
5761 return TDigest .copyOf (digest );
5862 }
5963
60- @ JsonProperty ("digest" )
64+ @ JsonProperty (DIGEST_PROPERTY )
6165 public synchronized byte [] serialize ()
6266 {
6367 return digest .serialize ().getBytes ();
6468 }
6569
6670 @ JsonCreator
6771 @ DoNotCall
68- public static TDigestHistogram deserialize (@ JsonProperty ("digest" ) byte [] digest )
72+ public static TDigestHistogram deserialize (@ JsonProperty (DIGEST_PROPERTY ) byte [] digest )
6973 {
7074 return new TDigestHistogram (TDigest .deserialize (wrappedBuffer (digest )));
7175 }
You can’t perform that action at this time.
0 commit comments