dmvk commented on code in PR #26663: URL: https://github.com/apache/flink/pull/26663#discussion_r2156484738
########## flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/allocator/StateSizeEstimates.java: ########## @@ -58,22 +54,13 @@ public Optional<Long> estimate(ExecutionVertexID jobVertexId) { return Optional.ofNullable(stateSizes.get(jobVertexId)); } - static StateSizeEstimates empty() { - return new StateSizeEstimates(); - } - - public static StateSizeEstimates fromGraph(@Nullable ExecutionGraph executionGraph) { - return Optional.ofNullable(executionGraph) - .flatMap(graph -> Optional.ofNullable(graph.getCheckpointCoordinator())) - .flatMap(coordinator -> Optional.ofNullable(coordinator.getCheckpointStore())) - .flatMap(store -> Optional.ofNullable(store.getLatestCheckpoint())) - .map( - cp -> - new StateSizeEstimates( - merge( - fromCompletedCheckpoint(cp), - mapVerticesToOperators(executionGraph)))) - .orElse(empty()); + public static StateSizeEstimates fromGraphAndState( + @NotNull final ExecutionGraph executionGraph, + @NotNull final CompletedCheckpoint latestCheckpoint) { Review Comment: it's just a convention / hint for IDE. There are some toolings out there that could build on top of that for static code analysis such as https://github.com/uber/NullAway, but we haven't integrated it. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org