From 5a174f8ac6e5f170b427b30bf72ef33f90c20d91 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Tue, 3 Apr 2018 16:31:34 +0100 Subject: [PATCH] HADOOP-14758. S3GuardTool.prune to handle UnsupportedOperationException. Contributed by Gabor Bota. --- .../java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java | 6 +++++- 1 file changed, 5 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 e764021159..a9147ffc51 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 int run(String[] args, PrintStream out) throws 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;