-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: streamjob api add in sreworks-job
- Loading branch information
Showing
15 changed files
with
582 additions
and
180 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
|
||
# | ||
# sreworks_project_path/contribute-to-sreworks.sh "paas/appmanager" | ||
# | ||
|
||
SW_ROOT=$(cd `dirname $0`; pwd) | ||
|
||
IS_GIT_ROOT=$(ls -l .git|wc -l|awk '{print $1}') | ||
|
||
if [ "$IS_GIT_ROOT" = "0" ];then | ||
echo "" | ||
echo "Please run contribute-to-sreworks.sh in Git Project root path /" | ||
exit 1 | ||
fi | ||
|
||
# 判断目标路径是否存在 | ||
TARGET_PATH=$1 | ||
if [ ! -d ${SW_ROOT}/${TARGET_PATH} ];then | ||
echo "Target app path not found" | ||
exit 1 | ||
fi | ||
|
||
|
||
# 只能拷贝到paas/saas这两个目录下 | ||
if [[ "$TARGET_PATH" =~ ^paas/.* ]] || [[ "$TARGET_PATH" =~ ^saas/.* ]] || [[ "$TARGET_PATH" =~ ^/paas/.* ]] || [[ "$TARGET_PATH" =~ ^/saas/.* ]]; then | ||
echo "Path check ok" | ||
else | ||
echo "Please copy code to paas/* or saas/*" | ||
echo "" | ||
echo "List paas/" | ||
ls -l ${SW_ROOT}/${TARGET_PATH}/paas/|grep -v "total " | ||
echo "" | ||
echo "List saas/" | ||
ls -l ${SW_ROOT}/${TARGET_PATH}/saas/|grep -v "total " | ||
exit 1 | ||
fi | ||
|
||
|
||
# 将当前代码拷贝到一个临时目录,移除.git文件 | ||
rm -rf /tmp/tmp_sw_project | ||
mkdir -p /tmp/tmp_sw_project | ||
cp -r ./ /tmp/tmp_sw_project/ | ||
rm -rf /tmp/tmp_sw_project/.git | ||
|
||
mv /tmp/tmp_sw_project ${SW_ROOT}/${TARGET_PATH}/../ | ||
mv ${SW_ROOT}/${TARGET_PATH}/../tmp_sw_project ${SW_ROOT}/${TARGET_PATH}.bak | ||
rm -rf ${SW_ROOT}/${TARGET_PATH} | ||
mv ${SW_ROOT}/${TARGET_PATH}.bak ${SW_ROOT}/${TARGET_PATH} | ||
echo "Copy code ok" | ||
|
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
52 changes: 0 additions & 52 deletions
52
...master/src/main/java/com/alibaba/sreworks/job/master/domain/DO/SreworksStreamJobSink.java
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
...ster/src/main/java/com/alibaba/sreworks/job/master/domain/DO/SreworksStreamJobSource.java
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
...r/src/main/java/com/alibaba/sreworks/job/master/domain/DTO/SreworksStreamJobBlockDTO.java
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,61 @@ | ||
package com.alibaba.sreworks.job.master.domain.DTO; | ||
|
||
import com.alibaba.fastjson.JSONArray; | ||
import com.alibaba.fastjson.JSONObject; | ||
import com.alibaba.sreworks.job.master.domain.DO.SreworksStreamJobBlock; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.StringUtils; | ||
|
||
@Data | ||
@Slf4j | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class SreworksStreamJobBlockDTO { | ||
|
||
private Long id; | ||
|
||
private Long streamJobId; | ||
private Long gmtCreate; | ||
|
||
private Long gmtModified; | ||
|
||
private String creator; | ||
|
||
private String operator; | ||
|
||
private String appId; | ||
|
||
private String name; | ||
|
||
private String blockType; | ||
|
||
private String blockTypeDisplay; | ||
|
||
private JSONObject data; | ||
|
||
|
||
|
||
public SreworksStreamJobBlockDTO(SreworksStreamJobBlock jobBlock) { | ||
id = jobBlock.getId(); | ||
gmtCreate = jobBlock.getGmtCreate(); | ||
gmtModified = jobBlock.getGmtModified(); | ||
streamJobId = jobBlock.getStreamJobId(); | ||
appId = jobBlock.getAppId(); | ||
name = jobBlock.getName(); | ||
blockType = jobBlock.getBlockType(); | ||
data = JSONObject.parseObject(jobBlock.getData()); | ||
if (StringUtils.equals(blockType, "source") && data.getString("sourceType") != null) { | ||
blockTypeDisplay = "输入源:" + data.getString("sourceType"); | ||
} else if (StringUtils.equals(blockType, "sink") && data.getString("sinkType") != null) { | ||
blockTypeDisplay = "输出:" + data.getString("sinkType"); | ||
} else if (StringUtils.equals(blockType, "python")){ | ||
blockTypeDisplay = "Python处理"; | ||
} else { | ||
blockTypeDisplay = blockType; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.