You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/01/26 13:30:46 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #4054: HBASE-26690 Modify FSTableDescriptors to not rely on renaming when wr…

Apache9 commented on a change in pull request #4054:
URL: https://github.com/apache/hbase/pull/4054#discussion_r792636301



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java
##########
@@ -506,131 +454,135 @@ public static TableDescriptor getTableDescriptorFromFs(FileSystem fs,
   }
 
   /**
-   * Returns the latest table descriptor for the table located at the given directory
-   * directly from the file system if it exists.
-   * @throws TableInfoMissingException if there is no descriptor
+   * Returns the latest table descriptor for the table located at the given directory directly from
+   * the file system if it exists.
    */
   public static TableDescriptor getTableDescriptorFromFs(FileSystem fs, Path tableDir)
     throws IOException {
-    FileStatus status = getTableInfoPath(fs, tableDir, false);
-    if (status == null) {
-      throw new TableInfoMissingException("No table descriptor file under " + tableDir);
+    return getTableDescriptorFromFs(fs, tableDir, true).map(Pair::getSecond).orElse(null);
+  }
+
+  private static void deleteMalformedFile(FileSystem fs, Path file) throws IOException {
+    LOG.info("Delete malformed table descriptor file {}", file);
+    if (!fs.delete(file, false)) {
+      LOG.info("Failed to delete malformed table descriptor file {}", file);

Review comment:
       Done.




-- 
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: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org