mxm commented on code in PR #571:
URL:
https://github.com/apache/flink-kubernetes-operator/pull/571#discussion_r1172575638
##########
flink-kubernetes-operator-autoscaler/src/main/java/org/apache/flink/kubernetes/operator/autoscaler/AutoScalerInfo.java:
##########
@@ -86,20 +87,24 @@ public AutoScalerInfo(Map<String, String> data) {
configMap.setData(Preconditions.checkNotNull(data));
}
- @SneakyThrows
- public SortedMap<Instant, Map<JobVertexID, Map<ScalingMetric, Double>>>
getMetricHistory() {
+ public SortedMap<Instant, CollectedMetrics> getMetricHistory() {
var historyYaml = configMap.getData().get(COLLECTED_METRICS_KEY);
if (historyYaml == null) {
return new TreeMap<>();
}
- return YAML_MAPPER.readValue(decompress(historyYaml), new
TypeReference<>() {});
+ try {
+ return YAML_MAPPER.readValue(decompress(historyYaml), new
TypeReference<>() {});
+ } catch (JsonProcessingException e) {
+ LOG.error(
+ "Could not deserialize metric history, possibly the format
changed. Discarding...");
+ return new TreeMap<>();
Review Comment:
Actually that does not work without a fix that I'm working on right now. If
you re-init, then the job update time can still be in the past which triggers
filling the metric window immediately. PR pending which addresses this.
--
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]