danny0405 commented on code in PR #10420:
URL: https://github.com/apache/hudi/pull/10420#discussion_r1438465244


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/clustering/ClusteringPlanOperator.java:
##########
@@ -88,10 +97,20 @@ public void notifyCheckpointComplete(long checkpointId) {
   }
 
   private void scheduleClustering(HoodieFlinkTable<?> table, long 
checkpointId) {
+    List<HoodieInstant> pendingClusteringInstantTimes =
+        
ClusteringUtils.getPendingClusteringInstantTimes(table.getMetaClient());
     // the first instant takes the highest priority.
     Option<HoodieInstant> firstRequested = Option.fromJavaOptional(
-        
ClusteringUtils.getPendingClusteringInstantTimes(table.getMetaClient()).stream()
+        pendingClusteringInstantTimes.stream()
             .filter(instant -> instant.getState() == 
HoodieInstant.State.REQUESTED).findFirst());
+
+    long pendingClusteringCount = pendingClusteringInstantTimes.stream()
+        .filter(instant -> instant.getState() == 
State.REQUESTED).collect(Collectors.toList()).size();

Review Comment:
   Can we use `count` of stream instead of collect ?



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to