bvaradar commented on a change in pull request #700: HUDI-138 - Meta Files 
handling also need to support consistency guard
URL: https://github.com/apache/incubator-hudi/pull/700#discussion_r296458138
 
 

 ##########
 File path: 
hoodie-common/src/main/java/com/uber/hoodie/common/io/storage/HoodieWrapperFileSystem.java
 ##########
 @@ -236,7 +237,28 @@ public FSDataOutputStream append(Path f, int bufferSize, 
Progressable progress)
 
   @Override
   public boolean rename(Path src, Path dst) throws IOException {
-    return fileSystem.rename(convertToDefaultPath(src), 
convertToDefaultPath(dst));
+    try {
+      consistencyGuard.waitTillFileAppears(convertToDefaultPath(src));
+    } catch (TimeoutException e) {
+      throw new HoodieException("Timed out waiting for " + src + " to appear", 
e);
+    }
+
+    boolean success = fileSystem.rename(convertToDefaultPath(src), 
convertToDefaultPath(dst));
+
+    if (success) {
+      try {
+        consistencyGuard.waitTillFileAppears(convertToDefaultPath(dst));
+      } catch (TimeoutException e) {
+        throw new HoodieException("Timed out waiting for " + dst + " to 
appear", e);
+      }
+
+      try {
+        consistencyGuard.waitTillFileDisappears(convertToDefaultPath(src));
+      } catch (TimeoutException e) {
+        throw new HoodieException("Timed out waiting for " + dst + " to 
disappear", e);
 
 Review comment:
   Fixed.

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


With regards,
Apache Git Services

Reply via email to