danny0405 commented on code in PR #8950:
URL: https://github.com/apache/hudi/pull/8950#discussion_r1229554043
##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/clustering/ClusteringPlanSourceFunction.java:
##########
@@ -60,21 +61,31 @@ public class ClusteringPlanSourceFunction extends
AbstractRichFunction implement
*/
private final String clusteringInstantTime;
- public ClusteringPlanSourceFunction(String clusteringInstantTime,
HoodieClusteringPlan clusteringPlan) {
+ private boolean isPending;
+
+ private final Configuration conf;
+
+ public ClusteringPlanSourceFunction(String clusteringInstantTime,
HoodieClusteringPlan clusteringPlan, Configuration conf) {
this.clusteringInstantTime = clusteringInstantTime;
this.clusteringPlan = clusteringPlan;
+ this.conf = conf;
}
@Override
public void open(Configuration parameters) throws Exception {
- // no operation
+ isPending = StreamerUtil.createMetaClient(conf).getActiveTimeline()
+ .getInstantsAsStream().anyMatch(i ->
clusteringInstantTime.equals(i.getTimestamp()) && !i.isCompleted());
Review Comment:
Maybe we can also move the code into `run` so there is no need to keep a
class member `isPending`.
--
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]