WeiZhong94 commented on code in PR #26981:
URL: https://github.com/apache/flink/pull/26981#discussion_r2570717422
##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmanager/scheduler/SlotSharingGroup.java:
##########
@@ -70,12 +73,35 @@ public ResourceProfile getResourceProfile() {
return resourceProfile;
}
+ public String getSlotSharingGroupName() {
+ return slotSharingGroupName;
+ }
+
+ public void setSlotSharingGroupName(String slotSharingGroupName) {
+ this.slotSharingGroupName = slotSharingGroupName;
+ }
+
// ------------------------------------------------------------------------
// Utilities
// ------------------------------------------------------------------------
+ @Override
+ public int hashCode() {
+ return Objects.hash(slotSharingGroupId);
+ }
+
Review Comment:
If we use this class as the map key and only consider the immutable part, I
think the equals method is also necessary.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/timeline/Rescale.java:
##########
@@ -0,0 +1,458 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.scheduler.adaptive.timeline;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.clusterframework.types.ResourceProfile;
+import org.apache.flink.runtime.instance.SlotSharingGroupId;
+import org.apache.flink.runtime.jobgraph.JobVertexID;
+import org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup;
+import org.apache.flink.runtime.scheduler.VertexParallelismInformation;
+import org.apache.flink.runtime.scheduler.adaptive.JobSchedulingPlan;
+import org.apache.flink.runtime.scheduler.adaptive.State;
+import org.apache.flink.runtime.scheduler.adaptive.allocator.JobInformation;
+import
org.apache.flink.runtime.scheduler.adaptive.allocator.SlotSharingSlotAllocator.ExecutionSlotSharingGroup;
+import
org.apache.flink.runtime.scheduler.adaptive.allocator.SlotSharingSlotAllocator.SlotSharingGroupMetaInfo;
+import org.apache.flink.runtime.scheduler.adaptive.allocator.VertexParallelism;
+import org.apache.flink.util.ExceptionUtils;
+import org.apache.flink.util.Preconditions;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Nullable;
+
+import java.io.Serializable;
+import java.time.Duration;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * The rescale to record the related vertices and slots change during the
rescaling process.
+ *
+ * <p>This rescale begins when the scheduler initiates a rescaling operation
and ends when the
+ * rescaling succeeds.
+ *
+ * <pre>
+ *
+ * The structure of the rescale as follows:
+ *
+ * +--> rescale id information:
+ * + +-->rescale uuid
+ * + +-->resource requirements id
+ * + +-->rescale attempt id
+ * +--> vertices:
+ * + +--> job vertex id-1 -> vertex-1 parallelism rescale:
+ * + + +--> vertex id
+ * + + +--> vertex name
+ * + + +--> slot sharing group id
+ * + + +--> slot sharing group name
+ * + + +--> desired parallelism
+ * + + +--> sufficient parallelism
+ * + + +--> pre-rescale parallelism
+ * + + +--> post-rescale parallelism
+ * + +--> job vertex id-2 -> vertex-2 parallelism rescale:
+ * + + +--> ...
+ * + + ...
+ * + ...
+ * +--> slots:
+ * + +--> slot sharing group id-1 -> slot-1 sharing group rescale:
+ * + + +--> slot sharing group id
+ * + + +--> slot sharing group name
+ * + + +--> required resource profile
+ * + + +--> minimal required slots
+ * + + +--> pre-rescale slots
+ * + + +--> post-rescale slots
+ * + + +--> acquired resource profile
+ * + +--> slot sharing group id-2 -> slot-2 sharing group rescale:
+ * + + +--> ...
+ * + + ...
+ * + ...
+ * +--> scheduler states:
+ * + +--> scheduler state span:
+ * + + +--> state
+ * + + +--> enter timestamp
+ * + + +--> leave timestamp
+ * + + +--> duration
+ * + + +--> exception information
+ * + +--> ...
+ * + ...
+ * +--> start timestamp
+ * +--> end timestamp
+ * +--> trigger cause
+ * +--> terminal state
+ * +--> terminated reason
+ *
+ * </pre>
+ *
+ * <p>The more design details about the rescale could be viewed in <a
+ * href="https://cwiki.apache.org/confluence/x/TQr0Ew">FLIP-495</a>.
+ */
+public class Rescale implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ public static final Logger LOG = LoggerFactory.getLogger(Rescale.class);
+
+ @Nullable private transient String stringedException;
Review Comment:
If this field is intended to store a stringified exception, I think
stringifiedException would be a better name. StringedException sounds a bit odd
here.
--
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]