Hisoka-X commented on code in PR #3131:
URL:
https://github.com/apache/incubator-seatunnel/pull/3131#discussion_r998870852
##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/checkpoint/TaskStatistics.java:
##########
@@ -42,20 +44,20 @@ public class TaskStatistics implements Serializable {
TaskStatistics(Long jobVertexId, int parallelism) {
this.jobVertexId = checkNotNull(jobVertexId, "JobVertexID");
checkArgument(parallelism > 0, "the parallelism of task <= 0");
- this.subtaskStats = new SubtaskStatistics[parallelism];
+ this.subtaskStats = Arrays.asList(new SubtaskStatistics[parallelism]);
Review Comment:
Can't use `new ArrayList<>(parallelism);`, because it will make subtaskStats
init size=0, so you can't use subtaskStats .set(4,data), it will throw
ArrayOutOfRangeException. `Arrays.asList(new SubtaskStatistics[parallelism]);`
will make init size = parallelism, and default value = null.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]