HADOOP-14758. S3GuardTool.prune to handle UnsupportedOperationException.
Contributed by Gabor Bota.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5a174f8a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5a174f8a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5a174f8a

Branch: refs/heads/HDFS-12943
Commit: 5a174f8ac6e5f170b427b30bf72ef33f90c20d91
Parents: 93d47a0
Author: Steve Loughran <ste...@apache.org>
Authored: Tue Apr 3 16:31:34 2018 +0100
Committer: Steve Loughran <ste...@apache.org>
Committed: Tue Apr 3 16:31:34 2018 +0100

----------------------------------------------------------------------
 .../java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5a174f8a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java
----------------------------------------------------------------------
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 e764021..a9147ff 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
@@ -966,7 +966,11 @@ public abstract class S3GuardTool extends Configured 
implements Tool {
       long now = System.currentTimeMillis();
       long divide = now - delta;
 
-      getStore().prune(divide);
+      try {
+        getStore().prune(divide);
+      } catch (UnsupportedOperationException e){
+        errorln("Prune operation not supported in metadata store.");
+      }
 
       out.flush();
       return SUCCESS;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to