From 0abb3663647cbadfb340328f623136060b82e1b7 Mon Sep 17 00:00:00 2001 From: Chris Nauroth Date: Thu, 19 May 2016 21:40:17 -0700 Subject: [PATCH] HADOOP-13154. S3AFileSystem printAmazonServiceException/printAmazonClientException appear copy & paste of AWS examples. Contributed by Steve Loughran. --- .../hadoop-common/CHANGES.txt | 4 +++ .../apache/hadoop/fs/s3a/S3AFileSystem.java | 25 ++++++------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 4b8208406ae..b36036b3c90 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -94,6 +94,10 @@ Release 2.7.3 - UNRELEASED HADOOP-13084. Fix ASF License warnings in branch-2.7. (Brahma Reddy Battula via aajisaka) + HADOOP-13154. S3AFileSystem + printAmazonServiceException/printAmazonClientException appear copy & paste + of AWS examples. (Steve Loughran via cnauroth) + Release 2.7.2 - 2016-01-25 INCOMPATIBLE CHANGES diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java index 91a606cf1f4..988003777e6 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java @@ -913,7 +913,6 @@ public S3AFileStatus getFileStatus(Path f) throws IOException { throw e; } } catch (AmazonClientException e) { - printAmazonClientException(e); throw e; } @@ -943,7 +942,6 @@ public S3AFileStatus getFileStatus(Path f) throws IOException { throw e; } } catch (AmazonClientException e) { - printAmazonClientException(e); throw e; } } @@ -986,7 +984,6 @@ public S3AFileStatus getFileStatus(Path f) throws IOException { throw e; } } catch (AmazonClientException e) { - printAmazonClientException(e); throw e; } @@ -1207,20 +1204,12 @@ public long getDefaultBlockSize() { } private void printAmazonServiceException(AmazonServiceException ase) { - LOG.info("Caught an AmazonServiceException, which means your request made it " + - "to Amazon S3, but was rejected with an error response for some reason."); - LOG.info("Error Message: " + ase.getMessage()); - LOG.info("HTTP Status Code: " + ase.getStatusCode()); - LOG.info("AWS Error Code: " + ase.getErrorCode()); - LOG.info("Error Type: " + ase.getErrorType()); - LOG.info("Request ID: " + ase.getRequestId()); - LOG.info("Class Name: " + ase.getClass().getName()); - } - - private void printAmazonClientException(AmazonClientException ace) { - LOG.info("Caught an AmazonClientException, which means the client encountered " + - "a serious internal problem while trying to communicate with S3, " + - "such as not being able to access the network."); - LOG.info("Error Message: {}" + ace, ace); + LOG.info("Caught an AmazonServiceException {}", ase.toString()); + LOG.info("Error Message: {}", ase.getMessage()); + LOG.info("HTTP Status Code: {}", ase.getStatusCode()); + LOG.info("AWS Error Code: {}", ase.getErrorCode()); + LOG.info("Error Type: {}", ase.getErrorType()); + LOG.info("Request ID: {}", ase.getRequestId()); + LOG.info("Stack", ase); } }