Skip to content
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

[Improve][Zeta] Don't trigger handleSaveMode when restore #5192

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private Set<URL> searchPluginJars() {

private MultipleTableJobConfigParser getJobConfigParser() {
return new MultipleTableJobConfigParser(
jobFilePath, idGenerator, jobConfig, commonPluginJars);
jobFilePath, idGenerator, jobConfig, commonPluginJars, isStartWithSavePoint);
}

private LogicalDagGenerator getLogicalDagGenerator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,16 @@
public class JobConfigParser {
private static final ILogger LOGGER = Logger.getLogger(JobConfigParser.class);
private IdGenerator idGenerator;

private boolean isStartWithSavePoint;
private List<URL> commonPluginJars;

public JobConfigParser(@NonNull IdGenerator idGenerator, @NonNull List<URL> commonPluginJars) {
public JobConfigParser(
@NonNull IdGenerator idGenerator,
@NonNull List<URL> commonPluginJars,
boolean isStartWithSavePoint) {
this.idGenerator = idGenerator;
this.commonPluginJars = commonPluginJars;
this.isStartWithSavePoint = isStartWithSavePoint;
}

public Tuple2<CatalogTable, Action> parseSource(
Expand Down Expand Up @@ -190,7 +194,9 @@ public Tuple2<CatalogTable, Action> parseTransform(
sink.prepare(config);
sink.setJobContext(jobConfig.getJobContext());
sink.setTypeInfo(rowType);
handleSaveMode(sink);
if (!isStartWithSavePoint) {
handleSaveMode(sink);
}
final String actionName =
createSinkActionName(0, tuple.getLeft().getPluginName(), getTableName(config));
final SinkAction action =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,27 @@ public class MultipleTableJobConfigParser {
private final ReadonlyConfig envOptions;

private final JobConfigParser fallbackParser;
private final boolean isStartWithSavePoint;

public MultipleTableJobConfigParser(
String jobDefineFilePath, IdGenerator idGenerator, JobConfig jobConfig) {
this(jobDefineFilePath, idGenerator, jobConfig, Collections.emptyList());
this(jobDefineFilePath, idGenerator, jobConfig, Collections.emptyList(), false);
}

public MultipleTableJobConfigParser(
String jobDefineFilePath,
IdGenerator idGenerator,
JobConfig jobConfig,
List<URL> commonPluginJars) {
List<URL> commonPluginJars,
boolean isStartWithSavePoint) {
this.idGenerator = idGenerator;
this.jobConfig = jobConfig;
this.commonPluginJars = commonPluginJars;
this.isStartWithSavePoint = isStartWithSavePoint;
this.seaTunnelJobConfig = ConfigBuilder.of(Paths.get(jobDefineFilePath));
this.envOptions = ReadonlyConfig.fromConfig(seaTunnelJobConfig.getConfig("env"));
this.fallbackParser = new JobConfigParser(idGenerator, commonPluginJars);
this.fallbackParser =
new JobConfigParser(idGenerator, commonPluginJars, isStartWithSavePoint);
}

public ImmutablePair<List<Action>, Set<URL>> parse() {
Expand Down Expand Up @@ -607,7 +611,9 @@ private static <T> T findLast(LinkedHashMap<?, T> map) {
sink,
factoryUrls,
actionConfig);
handleSaveMode(sink);
if (!isStartWithSavePoint) {
handleSaveMode(sink);
}
sinkAction.setParallelism(parallelism);
return sinkAction;
}
Expand Down