Browse Source

HADOOP-16484. S3A to warn or fail if S3Guard is disabled - addendum: silent for S3GuardTool (#1714). Contributed by Gabor Bota.

Change-Id: I63b928ef5da425ef982dd4100a426fc23f64bac1
Gabor Bota 5 years ago
parent
commit
cad540819f

+ 5 - 0
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3GuardTool.java

@@ -138,6 +138,11 @@ public abstract class S3GuardTool extends Configured implements Tool {
   protected S3GuardTool(Configuration conf, String...opts) {
     super(conf);
 
+    // Set s3guard is off warn level to silent, as the fs is often instantiated
+    // without s3guard on purpose.
+    conf.set(S3GUARD_DISABLED_WARN_LEVEL,
+        S3Guard.DisabledWarnLevel.SILENT.toString());
+
     commandFormat = new CommandFormat(0, Integer.MAX_VALUE, opts);
     // For metadata store URI
     commandFormat.addOptionWithValue(META_FLAG);