-
Notifications
You must be signed in to change notification settings - Fork 13k
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
[FLINK-7709] Add CheckpointStatisticDetailsHandler for new REST endpoint #4763
[FLINK-7709] Add CheckpointStatisticDetailsHandler for new REST endpoint #4763
Conversation
Rebasing onto the latest master. |
4d69441
to
d152cf2
Compare
Reviewed 24 of 31 files at r1. flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/checkpoints/CheckpointStatsCache.java, line 44 at r1 (raw file):
The CheckpointStatsCache should be moved out of the legacy namespace. flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/checkpoints/CheckpointStatistics.java, line 233 at r1 (raw file):
This method is near identical to Comments from Reviewable |
@zentol I'm not entirely sure whether reviewable makes things better or worse wrt reviewing. At least I can no longer respond to individual comments directly from github. You're right with both comments. I'll remove the |
@tillrohrmann I wanted to try it out, primarily since i can mark individual files as reviewed. For the remaining files I will once again write the comments on github. |
Alright @zentol. I guess it would work if I signed up for reviewable. |
44dfe88
to
41434f7
Compare
I still have to look at the JSON generation in this PR. |
@JsonProperty(FIELD_NAME_NUM_SUBTASKS) int numSubtasks, | ||
@JsonProperty(FIELD_NAME_NUM_ACK_SUBTASKS) int numAckSubtasks, | ||
@JsonDeserialize(keyUsing = JobVertexIDDeserializer.class) @JsonProperty(FIELD_NAME_TASKS) @Nullable Map<JobVertexID, TaskCheckpointStatistics> checkpointStatisticsPerTask) { | ||
this.id = id; |
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.
missing checkNotNull
check for all fields but checkpoitnStatisticsPerTask
.
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.
Good catch. Will add the checks.
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.
Hmm I think all not checked parameters are actually primitives and, thus, don't need to be checked for null.
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.
true, all objects are checked.
@JsonSubTypes({ | ||
@JsonSubTypes.Type(value = CheckpointStatistics.CompletedCheckpointStatistics.class, name = "completed"), | ||
@JsonSubTypes.Type(value = CheckpointStatistics.FailedCheckpointStatistics.class, name = "failed")}) | ||
@JsonInclude(JsonInclude.Include.NON_NULL) |
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.
We could annotate the particular field instead of the class.
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.
I will remove the Include.NON_NULL directive and re-add the FAIL_ON_MISSING_CREATOR_PROPERTY to the ObjectMapper
.
throw new IllegalArgumentException("Given checkpoint stats object of type " + checkpointStats.getClass().getName() + " cannot be converted."); | ||
} | ||
} else { | ||
return null; |
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.
pretty sure this would lead to a NullPointerException, since neither the CheckpointStatshandler, not AbstractExceutionGraphhandler, nor the AbstractRestHandler handle the case of the returned value being null.
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.
I think it should actually work and output a serialized null
value. However, this case distinction is not necessary and should be better pulled out of this method.
numAckSubtasks, | ||
checkpointingStatisticsPerTask); | ||
|
||
this.externalPath = externalPath; |
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.
missing null checks
numAckSubtasks, | ||
checkpointingStatisticsPerTask); | ||
|
||
this.failureTimestamp = failureTimestamp; |
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.
missing null checks
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.
Should be a primitive.
@@ -33,8 +33,7 @@ | |||
objectMapper.enable( | |||
DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES, | |||
DeserializationFeature.FAIL_ON_NULL_FOR_PRIMITIVES, | |||
DeserializationFeature.FAIL_ON_READING_DUP_TREE_KEY, | |||
DeserializationFeature.FAIL_ON_MISSING_CREATOR_PROPERTIES); |
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.
Removing this also means we have to add explicit null checks to all existing Request-/ResponseBody classes.
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.
Do note that we must be on the look-out for requests that use primitive fields, as jackson will default them to 0 if they are missing, which will cause misleading error messages.
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.
This is a valid objection which I share. I'll remove this change and set the map of TaskCheckpointStatistics
to an empty map in case that we want to leave the details out.
Thanks for the review @zentol. I've addressed your comments: Reverted change to |
…ointingStatistics#generateCheckpointStatistics method
…ull check out of CheckpointStatistics#generateCheckpointStatistics; Make CheckpointStatistics#checkpointStatisticcsPerTask non nullable; Add fail on missing creator property
a15f452
to
147a5b0
Compare
Rebased onto the latest master |
no objections, feel free to merge this. |
Disable failing when not all creator properties are known Move CheckpointStatsCache out of legacy package; Remove unused CheckpointingStatistics#generateCheckpointStatistics method Remove JsonInclude.Include.NON_NULL from CheckpointStatistics; Pull null check out of CheckpointStatistics#generateCheckpointStatistics; Make CheckpointStatistics#checkpointStatisticcsPerTask non nullable; Add fail on missing creator property This closes apache#4763.
What is the purpose of the change
Adds the new
CheckpointStatisticDetailsHandler
for the new REST server endpoint.Moreover, this PR disables the
FAIL_ON_MISSING_CREATOR_PROPERTIES
property for theRestMapperUtils.getStrictObjectMapper
because that is something the individuals beans can do on their own (e.g. by checking withPreconditions.checkNotNull
).R @zentol because of the changes to the
ObjectMapper
setup.Verifying this change
This change is already covered by existing tests, such as
CheckpointingStatisticsTest
.Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation