RocMarshal commented on code in PR #27291:
URL: https://github.com/apache/flink/pull/27291#discussion_r2649822186
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/ClusterResourceStatisticsProvider.java:
##########
@@ -21,9 +21,15 @@
import org.apache.flink.runtime.clusterframework.types.ResourceProfile;
import org.apache.flink.runtime.instance.InstanceID;
+import javax.annotation.Nullable;
+
/** Provides statistics of cluster resources. */
public interface ClusterResourceStatisticsProvider {
+ /** Get total number of tasks assigned to the current instance. slots. */
+ @Nullable
+ Integer getAssignedTasks(InstanceID instanceId);
Review Comment:
Thanks for the comments.
Since we currently synchronize the value of assignedTasks via slot reports,
there may be an intermediate state where a null value is needed to represent
it: a slot has not received any slot report information yet. In this case,
representing assignedTasks as an uninitialized state (i.e., null) might be more
appropriate.
I also agree with your point. This is really just a matter of choice, since
in principle I likewise prefer the logic and implementation to be as simple as
possible.
Updated.
--
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]