diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java b/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java index dbbe6f1ec5..88294ee0b9 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/AcidUtils.java @@ -1935,7 +1935,7 @@ public static void findOriginals(FileSystem fs, Path dir, } private static List tryListLocatedHdfsStatus(Ref useFileIds, FileSystem fs, - Path directory) { + Path directory) throws IOException { List childrenWithId = null; if (useFileIds == null) { return childrenWithId; @@ -1947,9 +1947,9 @@ public static void findOriginals(FileSystem fs, Path dir, if (val == null) { useFileIds.value = true; } - } catch (Throwable t) { - LOG.error("Failed to get files with ID; using regular API: " + t.getMessage()); - if (val == null && t instanceof UnsupportedOperationException) { + } catch (UnsupportedOperationException uoe) { + LOG.warn("Failed to get files with ID; using regular API: " + uoe.getMessage()); + if (val == null) { useFileIds.value = false; } } @@ -3137,9 +3137,9 @@ public static TxnType getTxnType(Configuration conf, ASTNode tree) { useFileIds.value = true; // The call succeeded, so presumably the API is there. } return result; - } catch (Throwable t) { - LOG.error("Failed to get files with ID; using regular API: " + t.getMessage()); - if (val == null && t instanceof UnsupportedOperationException) { + } catch (UnsupportedOperationException uoe) { + LOG.warn("Failed to get files with ID; using regular API: " + uoe.getMessage()); + if (val == null) { useFileIds.value = false; } } diff --git a/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java b/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java index f71f5a58b1..87842138c3 100644 --- a/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java +++ b/shims/common/src/main/java/org/apache/hadoop/hive/shims/HadoopShims.java @@ -251,6 +251,19 @@ RecordReader getRecordReader(JobConf job, CombineFileSplit split, Reporter repor Class> rrClass) throws IOException; } + /** + * List a directory for file status with ID. + * + * @param fs The {@code FileSystem} to load the path + * @param path The directory to list + * @param filter A filter to use on the files in the directory + * @return A list of file status with IDs + * @throws IOException An I/O exception of some sort has occurred + * @throws FileNotFoundException If the path is not found in the + * {@code FileSystem} + * @throws UnsupportedOperationException the {@code FileSystem} is not a + * {@code DistributedFileSystem} + */ List listLocatedHdfsStatus( FileSystem fs, Path path, PathFilter filter) throws IOException;