yanghua commented on a change in pull request #2434: URL: https://github.com/apache/hudi/pull/2434#discussion_r556193603
########## File path: hudi-flink/src/main/java/org/apache/hudi/operator/InstantGenerateOperator.java ########## @@ -222,4 +234,59 @@ public void close() throws Exception { fs.close(); } } + + private boolean checkReceivedData(long checkpointId) throws InterruptedException, IOException { + int numberOfParallelSubtasks = getRuntimeContext().getNumberOfParallelSubtasks(); + FileStatus[] fileStatuses = null; + Path generatePath = new Path(INSTANT_GENERATE_FOLDER_NAME); + int tryTimes = 1; + // waiting all subtask create generate file ready + while (true) { + Thread.sleep(500L); + fileStatuses = fs.listStatus(generatePath, new PathFilter() { + @Override + public boolean accept(Path pathname) { + return pathname.getName().contains(String.format("_%d_",checkpointId)); + } + }); + + // is ready + if (fileStatuses != null && fileStatuses.length == numberOfParallelSubtasks) { + break; + } + + if (tryTimes >= 5) { Review comment: Let's make it configurable? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org