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



##########
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:
       Nit: warn? 




-- 
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-unsubscr...@hbase.apache.org

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


Reply via email to