zentol commented on a change in pull request #17578:
URL: https://github.com/apache/flink/pull/17578#discussion_r742626076
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/savepoints/SavepointTriggerRequestBody.java
##########
@@ -19,39 +19,56 @@
package org.apache.flink.runtime.rest.messages.job.savepoints;
import org.apache.flink.runtime.rest.messages.RequestBody;
+import org.apache.flink.runtime.rest.messages.TriggerId;
import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonIgnore;
import
org.apache.flink.shaded.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
import javax.annotation.Nullable;
+import java.util.Optional;
+
/** {@link RequestBody} to trigger savepoints. */
public class SavepointTriggerRequestBody implements RequestBody {
public static final String FIELD_NAME_TARGET_DIRECTORY =
"target-directory";
private static final String FIELD_NAME_CANCEL_JOB = "cancel-job";
+ private static final String FIELD_NAME_TRIGGER_ID = "triggerId";
+
@JsonProperty(FIELD_NAME_TARGET_DIRECTORY)
@Nullable
private final String targetDirectory;
@JsonProperty(FIELD_NAME_CANCEL_JOB)
private final boolean cancelJob;
+ @JsonProperty(FIELD_NAME_TRIGGER_ID)
+ @Nullable
+ private final TriggerId triggerId;
+
@JsonCreator
public SavepointTriggerRequestBody(
@Nullable @JsonProperty(FIELD_NAME_TARGET_DIRECTORY) final String
targetDirectory,
- @Nullable @JsonProperty(FIELD_NAME_CANCEL_JOB) final Boolean
cancelJob) {
+ @Nullable @JsonProperty(FIELD_NAME_CANCEL_JOB) final Boolean
cancelJob,
+ @Nullable @JsonProperty(FIELD_NAME_TRIGGER_ID) TriggerId
triggerId) {
this.targetDirectory = targetDirectory;
this.cancelJob = cancelJob != null ? cancelJob : false;
+ this.triggerId = triggerId;
}
@Nullable
public String getTargetDirectory() {
return targetDirectory;
}
+ @JsonIgnore
+ public Optional<TriggerId> getTriggerId() {
+ return Optional.ofNullable(triggerId);
+ }
Review comment:
I can add a commit to make this consistent.
--
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]