nsivabalan commented on a change in pull request #1912:
URL: https://github.com/apache/hudi/pull/1912#discussion_r465039422



##########
File path: hudi-client/src/main/java/org/apache/hudi/table/HoodieTable.java
##########
@@ -505,16 +507,26 @@ private boolean waitForCondition(String partitionPath, 
Stream<Pair<String, Strin
     final FileSystem fileSystem = metaClient.getRawFs();
     List<String> fileList = 
partitionFilePaths.map(Pair::getValue).collect(Collectors.toList());
     try {
-      getFailSafeConsistencyGuard(fileSystem).waitTill(partitionPath, 
fileList, visibility);
+      getConsistencyGuard(fileSystem, 
config.getConsistencyGuardConfig()).waitTill(partitionPath, fileList, 
visibility);
     } catch (IOException | TimeoutException ioe) {
       LOG.error("Got exception while waiting for files to show up", ioe);
       return false;
     }
     return true;
   }
 
-  private ConsistencyGuard getFailSafeConsistencyGuard(FileSystem fileSystem) {
-    return new FailSafeConsistencyGuard(fileSystem, 
config.getConsistencyGuardConfig());
+  /**
+   * Instantiate {@link ConsistencyGuard} via reflection, passing in the 
required args.
+   * <p>
+   * Default consistencyGuard class is {@link FailSafeConsistencyGuard}.
+   */
+  public static ConsistencyGuard getConsistencyGuard(FileSystem fs, 
ConsistencyGuardConfig consistencyGuardConfig) throws IOException {

Review comment:
       I see FSUtils also instantiates FailSafeConsistencyGuard for 
WrapperFileSystem. Do we need similar reflection based instantiation fix there 
too?
   
https://github.com/apache/hudi/blob/master/hudi-common/src/main/java/org/apache/hudi/common/fs/FSUtils.java
   Check lines 529 to 535. 




----------------------------------------------------------------
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:
[email protected]


Reply via email to