From 55fad6a3de3125d9e7e2e9a5f8fa5b1b22a1de60 Mon Sep 17 00:00:00 2001 From: Sean Mackrory Date: Fri, 22 Jun 2018 11:36:36 -0600 Subject: [PATCH] HADOOP-15416. Clear error message in S3Guard diff if source not found. Contributed by Gabor Bota. --- .../java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java index fbffba915d..ac10e0876a 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java @@ -805,7 +805,9 @@ private static void printDiff(FileStatus msStatus, */ private void compareDir(FileStatus msDir, FileStatus s3Dir, PrintStream out) throws IOException { - Preconditions.checkArgument(!(msDir == null && s3Dir == null)); + Preconditions.checkArgument(!(msDir == null && s3Dir == null), + "The path does not exist in metadata store and on s3."); + if (msDir != null && s3Dir != null) { Preconditions.checkArgument(msDir.getPath().equals(s3Dir.getPath()), String.format("The path from metadata store and s3 are different:" +