Skip to content

Commit 808f413

Browse files
authored
Merge pull request #54 from aliyun/feature/release-v1.1.9-16
release 1.1.9-16
2 parents 9cb8393 + 415dfd6 commit 808f413

File tree

93 files changed

+1407
-823
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1407
-823
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
shell: bash
3333
- name: Archive test results
3434
if: always()
35-
uses: actions/upload-artifact@v3
35+
uses: actions/upload-artifact@v4
3636
with:
3737
name: test-results
3838
path: |

client/client-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.aliyun.dataworks</groupId>
66
<artifactId>client</artifactId>
7-
<version>1.1.9-10</version>
7+
<version>1.1.9-16</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

client/client-spark-utils/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.aliyun.dataworks</groupId>
66
<artifactId>client</artifactId>
7-
<version>1.1.9-10</version>
7+
<version>1.1.9-16</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

client/client-toolkits/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.aliyun.dataworks</groupId>
66
<artifactId>client</artifactId>
7-
<version>1.1.9-10</version>
7+
<version>1.1.9-16</version>
88
<relativePath>../pom.xml</relativePath>
99
</parent>
1010

client/migrationx/migrationx-common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<parent>
2323
<artifactId>migrationx</artifactId>
2424
<groupId>com.aliyun.dataworks</groupId>
25-
<version>1.1.9-10</version>
25+
<version>1.1.9-16</version>
2626
<relativePath>../pom.xml</relativePath>
2727
</parent>
2828

client/migrationx/migrationx-common/src/main/java/com/aliyun/migrationx/common/metrics/DefaultMetricCollector.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
import java.util.function.Consumer;
44

5-
import com.aliyun.migrationx.common.metrics.DolphinMetricsCollector.Summary;
6-
75
/**
86
* default implement
97
* @author 聿剑
@@ -55,6 +53,16 @@ public void markTempSpecProcess(Metrics metrics) {
5553

5654
}
5755

56+
@Override
57+
public void markUnSupportedSpecProcess(Metrics metrics) {
58+
59+
}
60+
61+
@Override
62+
public void incrementType(String taskType) {
63+
64+
}
65+
5866
@Override
5967
public void markSuccessSpecProcess(String workflowName, String nodeName) {
6068

@@ -81,7 +89,7 @@ public void finishCollector() {
8189
}
8290

8391
@Override
84-
public void finishCollector(Consumer<Summary> c) {
92+
public void finishCollector(Consumer<Object> c) {
8593

8694
}
8795

client/migrationx/migrationx-common/src/main/java/com/aliyun/migrationx/common/metrics/DolphinMetrics.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
package com.aliyun.migrationx.common.metrics;
1717

18-
import lombok.Builder;
1918
import lombok.Data;
2019
import lombok.EqualsAndHashCode;
2120
import lombok.ToString;

client/migrationx/migrationx-common/src/main/java/com/aliyun/migrationx/common/metrics/DolphinMetricsCollector.java

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ public class DolphinMetricsCollector implements MetricsCollector {
4949
private final Set<Metrics> failedDolphinSchedulerTasks = new HashSet<>();
5050
private final Set<Metrics> skippedDolphinSchedulerTasks = new HashSet<>();
5151
private final Set<Metrics> tempDolphinSchedulerTasks = new HashSet<>();
52+
private final Set<Metrics> unSupportedDolphinSchedulerTasks = new HashSet<>();
53+
private final Map<String, Integer> typeCounter = new HashMap<>();
5254

5355
private String transformerType;
5456
private Date startTime;
@@ -158,6 +160,21 @@ public void markTempSpecProcess(Metrics tmp) {
158160
tempDolphinSchedulerTasks.add(metrics);
159161
}
160162

163+
@Override
164+
public void markUnSupportedSpecProcess(Metrics metrics) {
165+
unSupportedDolphinSchedulerTasks.add(metrics);
166+
}
167+
168+
@Override
169+
public void incrementType(String taskType) {
170+
Integer count = typeCounter.get(taskType);
171+
if (count == null) {
172+
typeCounter.put(taskType, 1);
173+
} else {
174+
typeCounter.put(taskType, count + 1);
175+
}
176+
}
177+
161178
private Metrics findMetrics(Metrics tmp) {
162179
String workflowName = tmp.getWorkflowName();
163180
String nodeName = tmp.getDwName();
@@ -176,21 +193,27 @@ public void finishCollector() {
176193
}
177194

178195
@Override
179-
public void finishCollector(Consumer<Summary> c) {
196+
public void finishCollector(Consumer<Object> c) {
180197
Summary summary = new Summary();
181198
summary.setStartTime(startTime);
182199
summary.setEndTime(new Date());
183200
summary.setTransformerType(transformerType);
184201
summary.setType(CollectorType.DolphinScheduler.name());
185-
summary.setSuccess(toSummary(successDolphinSchedulerTasks));
186-
summary.setFailed(toSummary(failedDolphinSchedulerTasks));
187-
summary.setSkipped(toSummary(skippedDolphinSchedulerTasks));
188-
summary.setTemp(toSummary(tempDolphinSchedulerTasks));
189202
summary.setTotalSuccess(successDolphinSchedulerTasks.size());
190203
summary.setTotalFailed(failedDolphinSchedulerTasks.size());
191204
summary.setTotalSkipped(skippedDolphinSchedulerTasks.size());
192205
summary.setTotalTemp(tempDolphinSchedulerTasks.size());
206+
summary.setTotalUnSupported(unSupportedDolphinSchedulerTasks.size());
193207
c.accept(summary);
208+
209+
Detail detail = new Detail();
210+
detail.setSuccess(toSummary(successDolphinSchedulerTasks));
211+
detail.setFailed(toSummary(failedDolphinSchedulerTasks));
212+
detail.setSkipped(toSummary(skippedDolphinSchedulerTasks));
213+
detail.setTemp(toSummary(tempDolphinSchedulerTasks));
214+
detail.setUnSupported(toSummary(unSupportedDolphinSchedulerTasks));
215+
detail.setTypeCounter(typeCounter);
216+
c.accept(detail);
194217
}
195218

196219
private List<Project> toSummary(Set<Metrics> metricsList) {
@@ -219,6 +242,7 @@ private List<Project> toSummary(Set<Metrics> metricsList) {
219242
task = new Task();
220243
task.setTaskCode(dolphinMetrics.getTaskCode());
221244
task.setTaskName(dolphinMetrics.getTaskName());
245+
task.setTaskType(dolphinMetrics.getTaskType());
222246
taskMap.put(dolphinMetrics.getTaskCode(), task);
223247
process.getTasks().add(task);
224248
}
@@ -249,10 +273,17 @@ public static class Summary {
249273
private int totalFailed;
250274
private int totalSkipped;
251275
private int totalTemp;
276+
private int totalUnSupported;
277+
}
278+
279+
@Data
280+
public static class Detail {
252281
private List<Project> success;
253282
private List<Project> failed;
254283
private List<Project> skipped;
255284
private List<Project> temp;
285+
private List<Project> unSupported;
286+
private Map<String, Integer> typeCounter;
256287
}
257288

258289
@Data
@@ -273,5 +304,6 @@ public static class Process {
273304
public static class Task {
274305
private String taskName;
275306
private Long taskCode;
307+
private String taskType;
276308
}
277309
}

client/migrationx/migrationx-common/src/main/java/com/aliyun/migrationx/common/metrics/Metrics.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
package com.aliyun.migrationx.common.metrics;
1717

18+
import java.util.Objects;
19+
1820
import lombok.AllArgsConstructor;
1921
import lombok.Data;
2022
import lombok.NoArgsConstructor;
@@ -34,4 +36,14 @@ public class Metrics {
3436
protected Long projectId;
3537
protected String region;
3638
protected String errorMsg;
39+
40+
public boolean equals(Object o) {
41+
if (o == null || getClass() != o.getClass()) {return false;}
42+
Metrics metrics = (Metrics) o;
43+
return Objects.equals(dwType, metrics.dwType) && Objects.equals(dwName, metrics.dwName) && Objects.equals(workflowName, metrics.workflowName);
44+
}
45+
46+
public int hashCode() {
47+
return Objects.hash(dwType, dwName, workflowName);
48+
}
3749
}

client/migrationx/migrationx-common/src/main/java/com/aliyun/migrationx/common/metrics/MetricsCollector.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717

1818
import java.util.function.Consumer;
1919

20-
import com.aliyun.migrationx.common.metrics.DolphinMetricsCollector.Summary;
21-
2220
import org.slf4j.Logger;
2321
import org.slf4j.LoggerFactory;
2422

@@ -45,6 +43,10 @@ public interface MetricsCollector {
4543

4644
void markTempSpecProcess(Metrics metrics);
4745

46+
void markUnSupportedSpecProcess(Metrics metrics);
47+
48+
void incrementType(String taskType);
49+
4850
void markSuccessSpecProcess(String workflowName, String nodeName);
4951

5052
void markSuccessSpecProcess(Metrics metrics);
@@ -55,7 +57,7 @@ public interface MetricsCollector {
5557

5658
void finishCollector();
5759

58-
void finishCollector(Consumer<Summary> c);
60+
void finishCollector(Consumer<Object> c);
5961

6062
Progress progress();
6163
}

0 commit comments

Comments
 (0)