forked from alibaba/DataX
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85b740c
commit 80132c8
Showing
15 changed files
with
704 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mvn clean package -Dappname=all | ||
mvn clean install -Dappname=all | ||
mkdir -p /opt/tis/tis-datax-executor | ||
rm -rf /opt/tis/tis-datax-executor/* | ||
tar xvf ../tis-datax-executor.tar.gz -C /opt/tis/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
move to `tis-datax/executor/tis-datax-executor` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,113 +9,48 @@ | |
* @author 百岁 ([email protected]) | ||
* @date 2023/11/18 | ||
*/ | ||
public class DataXLifecycleHookMsg implements IDataXTaskRelevant { | ||
public class DataXLifecycleHookMsg extends JobHookMsg { | ||
|
||
private IDataXBatchPost.LifeCycleHook lifeCycleHook; | ||
private String tableName; | ||
private StoreResourceType resType; | ||
private String dataXName; | ||
private String jobName; | ||
private Integer taskId; | ||
private Long execEpochMilli; | ||
|
||
private DataXLifecycleHookMsg() { | ||
public DataXLifecycleHookMsg() { | ||
} | ||
|
||
public static DataXLifecycleHookMsg createDataXLifecycleHookMsg(String dataXName, String tableName, | ||
|
||
public static DataXLifecycleHookMsg createDataXLifecycleHookMsg(IDataxProcessor processor, String tableName, | ||
Integer taskId, String jobName, | ||
Long currentTimeStamp, | ||
IDataXBatchPost.LifeCycleHook lifeCycleHook) { | ||
if (StringUtils.isEmpty(dataXName)) { | ||
throw new IllegalArgumentException("dataXName can not be null"); | ||
} | ||
IDataXBatchPost.LifeCycleHook lifeCycleHook, | ||
Boolean dryRun) { | ||
if (StringUtils.isEmpty(tableName)) { | ||
throw new IllegalArgumentException("tableName can not be null"); | ||
} | ||
if (StringUtils.isEmpty(jobName)) { | ||
throw new IllegalArgumentException("jobName can not be null"); | ||
} | ||
|
||
DataXLifecycleHookMsg lifecycleHookMsg = new DataXLifecycleHookMsg(); | ||
lifecycleHookMsg.setTableName(tableName); | ||
lifecycleHookMsg.setLifeCycleHook(lifeCycleHook); | ||
lifecycleHookMsg.setResType(StoreResourceType.DataApp); | ||
lifecycleHookMsg.setTaskId(Objects.requireNonNull(taskId, "taskId can not be null")); | ||
lifecycleHookMsg.setDataXName(dataXName); | ||
lifecycleHookMsg.setExecEpochMilli(Objects.requireNonNull(currentTimeStamp, "currentTimeStamp can not be " + | ||
"null")); | ||
lifecycleHookMsg.setJobName(jobName); | ||
return lifecycleHookMsg; | ||
} | ||
|
||
private void setDataXName(String dataXName) { | ||
this.dataXName = dataXName; | ||
} | ||
|
||
private void setJobName(String jobName) { | ||
this.jobName = jobName; | ||
} | ||
|
||
private void setTaskId(Integer taskId) { | ||
this.taskId = taskId; | ||
} | ||
|
||
private void setExecEpochMilli(Long execEpochMilli) { | ||
this.execEpochMilli = execEpochMilli; | ||
return createHookMsg(processor.identityValue(), processor.getResType(), taskId, jobName, currentTimeStamp, dryRun, | ||
() -> { | ||
DataXLifecycleHookMsg hookMsg = new DataXLifecycleHookMsg(); | ||
hookMsg.setTableName(tableName); | ||
hookMsg.setLifeCycleHook(Objects.requireNonNull(lifeCycleHook, "param lifeCycleHook")); | ||
return hookMsg; | ||
}); | ||
} | ||
|
||
public String getTableName() { | ||
return this.tableName; | ||
} | ||
|
||
public StoreResourceType getResType() { | ||
return resType; | ||
} | ||
|
||
private void setResType(StoreResourceType resType) { | ||
this.resType = resType; | ||
} | ||
|
||
private void setTableName(String tableName) { | ||
public void setTableName(String tableName) { | ||
this.tableName = tableName; | ||
} | ||
|
||
public IDataXBatchPost.LifeCycleHook getLifeCycleHook() { | ||
return Objects.requireNonNull(this.lifeCycleHook, "lifeCycleHook can not be null"); | ||
} | ||
|
||
private void setLifeCycleHook(IDataXBatchPost.LifeCycleHook lifeCycleHook) { | ||
public void setLifeCycleHook(IDataXBatchPost.LifeCycleHook lifeCycleHook) { | ||
this.lifeCycleHook = lifeCycleHook; | ||
} | ||
|
||
@Override | ||
public Integer getTaskId() { | ||
return Objects.requireNonNull(this.taskId, "taskid can not be null"); | ||
} | ||
|
||
@Override | ||
public String getJobName() { | ||
return this.jobName; | ||
} | ||
|
||
@Override | ||
public String getDataXName() { | ||
return this.dataXName; | ||
} | ||
|
||
@Override | ||
public long getExecEpochMilli() { | ||
// throw new UnsupportedOperationException(); | ||
return Objects.requireNonNull(this.execEpochMilli, "execEpochMilli can not be null"); | ||
} | ||
|
||
@Override | ||
public int getTaskSerializeNum() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public String getFormatTime(TimeFormat format) { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
import java.util.Objects; | ||
|
||
/** | ||
* used by com.qlangtech.tis.plugin.datax.TaskExec | ||
* | ||
* @author 百岁 ([email protected]) | ||
* @date 2023/11/18 | ||
*/ | ||
|
@@ -32,10 +34,10 @@ protected final boolean useRuntimePropEnvProps() { | |
return false; | ||
} | ||
|
||
// @Override | ||
// protected String[] getExtraJavaSystemPrams() { | ||
// return new String[]{"-D" + CenterResource.KEY_notFetchFromCenterRepository + "=true"}; | ||
// } | ||
// @Override | ||
// protected String[] getExtraJavaSystemPrams() { | ||
// return new String[]{"-D" + CenterResource.KEY_notFetchFromCenterRepository + "=true"}; | ||
// } | ||
|
||
@Override | ||
protected final String getIncrStateCollectAddress() { | ||
|
@@ -69,5 +71,6 @@ protected void addMainClassParams(CuratorDataXTaskMessage msg, Integer taskId, S | |
|
||
cmdLine.addArgument(String.valueOf(msg.getTaskSerializeNum())); | ||
cmdLine.addArgument(String.valueOf(msg.getExecEpochMilli())); | ||
// cmdLine.addArgument(msg.) | ||
} | ||
} |
Oops, something went wrong.