Skip to content

Commit

Permalink
[FLINK-35227][rest] Remove execution-mode in ExecutionConfigInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
1996fanrui committed Jul 12, 2024
1 parent 2632c8f commit 53de70a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions docs/static/generated/rest_v1_dispatcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2079,8 +2079,6 @@ components:
ExecutionConfigInfo:
type: object
properties:
execution-mode:
type: string
job-parallelism:
type: integer
format: int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,11 @@ public JobConfigInfo deserialize(
/** Nested class to encapsulate the execution configuration. */
public static final class ExecutionConfigInfo {

@Deprecated public static final String FIELD_NAME_EXECUTION_MODE = "execution-mode";
public static final String FIELD_NAME_RESTART_STRATEGY = "restart-strategy";
public static final String FIELD_NAME_PARALLELISM = "job-parallelism";
public static final String FIELD_NAME_OBJECT_REUSE_MODE = "object-reuse-mode";
public static final String FIELD_NAME_GLOBAL_JOB_PARAMETERS = "user-config";

/** @deprecated Use {@link JobDetailsInfo#getJobType()} instead. */
@Deprecated
@JsonProperty(FIELD_NAME_EXECUTION_MODE)
private final String executionMode;

@JsonProperty(FIELD_NAME_RESTART_STRATEGY)
private final String restartStrategy;

Expand All @@ -194,23 +188,17 @@ public static final class ExecutionConfigInfo {

@JsonCreator
public ExecutionConfigInfo(
@JsonProperty(FIELD_NAME_EXECUTION_MODE) String executionMode,
@JsonProperty(FIELD_NAME_RESTART_STRATEGY) String restartStrategy,
@JsonProperty(FIELD_NAME_PARALLELISM) int parallelism,
@JsonProperty(FIELD_NAME_OBJECT_REUSE_MODE) boolean isObjectReuse,
@JsonProperty(FIELD_NAME_GLOBAL_JOB_PARAMETERS)
Map<String, String> globalJobParameters) {
this.executionMode = Preconditions.checkNotNull(executionMode);
this.restartStrategy = Preconditions.checkNotNull(restartStrategy);
this.parallelism = parallelism;
this.isObjectReuse = isObjectReuse;
this.globalJobParameters = Preconditions.checkNotNull(globalJobParameters);
}

public String getExecutionMode() {
return executionMode;
}

public String getRestartStrategy() {
return restartStrategy;
}
Expand Down Expand Up @@ -239,15 +227,13 @@ public boolean equals(Object o) {
ExecutionConfigInfo that = (ExecutionConfigInfo) o;
return parallelism == that.parallelism
&& isObjectReuse == that.isObjectReuse
&& Objects.equals(executionMode, that.executionMode)
&& Objects.equals(restartStrategy, that.restartStrategy)
&& Objects.equals(globalJobParameters, that.globalJobParameters);
}

@Override
public int hashCode() {
return Objects.hash(
executionMode,
restartStrategy,
parallelism,
isObjectReuse,
Expand All @@ -256,7 +242,6 @@ public int hashCode() {

public static ExecutionConfigInfo from(ArchivedExecutionConfig archivedExecutionConfig) {
return new ExecutionConfigInfo(
archivedExecutionConfig.getExecutionMode(),
archivedExecutionConfig.getRestartStrategyDescription(),
archivedExecutionConfig.getParallelism(),
archivedExecutionConfig.getObjectReuseEnabled(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected JobConfigInfo getTestResponseInstance() {

final JobConfigInfo.ExecutionConfigInfo executionConfigInfo =
new JobConfigInfo.ExecutionConfigInfo(
"foobar", "always", 42, false, globalJobParameters);
"always", 42, false, globalJobParameters);
return new JobConfigInfo(new JobID(), "testJob", executionConfigInfo);
}
}

0 comments on commit 53de70a

Please sign in to comment.