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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/util/ClusteringUtil.java:
##########
@@ -77,4 +77,21 @@ public static void rollbackClustering(HoodieFlinkTable<?> 
table, HoodieFlinkWrit
       table.getMetaClient().reloadActiveTimeline();
     });
   }
+
+  /**
+   * Force rolls back the inflight clustering instant, for handling failure 
case.
+   *
+   * @param table The hoodie table
+   * @param writeClient The write client
+   * @param instantTime The instant time
+   */
+  public static void rollbackClustering(HoodieFlinkTable<?> table, 
HoodieFlinkWriteClient writeClient, String instantTime) {
+    Option<HoodieInstant> inflightInstant = 
Option.fromJavaOptional(ClusteringUtils.getPendingClusteringInstantTimes(table.getMetaClient())
+        .stream().filter(instant -> instant.equals(instantTime)).findFirst());
+    if (inflightInstant.isPresent()) {

Review Comment:
   instant.getTimestamp().equals(instantTime)



-- 
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]

Reply via email to