From 42f2c6c4eccd40cc59ee1ff80d49d3ec46940ebd Mon Sep 17 00:00:00 2001 From: Mehakmeet Singh Date: Fri, 19 Nov 2021 14:25:43 +0530 Subject: [PATCH 1/2] HADOOP-18016. Make certain methods LimitedPrivate in S3AUtils.java to provide proxy support --- .../java/org/apache/hadoop/fs/s3a/S3AUtils.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java index b495d50564e9e..d69fbfe926832 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java @@ -96,6 +96,9 @@ /** * Utility methods for S3A code. + * Some methods are marked LimitedPrivate since they are being used in an + * external project. It would be better to call them rather than copying the + * whole code in that project. */ @InterfaceAudience.Private @InterfaceStability.Evolving @@ -884,6 +887,8 @@ public static String lookupPassword( /** * Get a password from a configuration, including JCEKS files, handling both * the absolute key and bucket override. + *
+ * Note: LimitedPrivate for ranger repository to get secrets. * @param bucket bucket or "" if none known * @param conf configuration * @param baseKey base key to look up, e.g "fs.s3a.secret.key" @@ -894,6 +899,7 @@ public static String lookupPassword( * @throws IOException on any IO problem * @throws IllegalArgumentException bad arguments */ + @InterfaceAudience.LimitedPrivate("Ranger") public static String lookupPassword( String bucket, Configuration conf, @@ -1152,10 +1158,15 @@ private static Method getFactoryMethod(Class cl, Class returnType, * This method does not propagate security provider path information from * the S3A property into the Hadoop common provider: callers must call * {@link #patchSecurityCredentialProviders(Configuration)} explicitly. + * + *
+ * Note: LimitedPrivate for ranger repository to set up + * per-bucket configurations. * @param source Source Configuration object. * @param bucket bucket name. Must not be empty. * @return a (potentially) patched clone of the original. */ + @InterfaceAudience.LimitedPrivate("Ranger") public static Configuration propagateBucketOptions(Configuration source, String bucket) { @@ -1351,6 +1362,8 @@ private static void initProtocolSettings(Configuration conf, /** * Initializes AWS SDK proxy support in the AWS client configuration * if the S3A settings enable it. + *
+ * Note: LimitedPrivate to provide proxy support in ranger repository. * * @param conf Hadoop configuration * @param bucket Optional bucket to use to look up per-bucket proxy secrets @@ -1358,6 +1371,7 @@ private static void initProtocolSettings(Configuration conf, * @throws IllegalArgumentException if misconfigured * @throws IOException problem getting username/secret from password source. */ + @InterfaceAudience.LimitedPrivate("Ranger") public static void initProxySupport(Configuration conf, String bucket, ClientConfiguration awsConf) throws IllegalArgumentException, From 28d9a760f9ba56c95c0436877a35fbef97467274 Mon Sep 17 00:00:00 2001 From: Mehakmeet Singh Date: Tue, 23 Nov 2021 16:55:38 +0530 Subject: [PATCH 2/2] HADOOP-18016. review comment --- .../src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java index d69fbfe926832..4828340e38d21 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AUtils.java @@ -97,8 +97,7 @@ /** * Utility methods for S3A code. * Some methods are marked LimitedPrivate since they are being used in an - * external project. It would be better to call them rather than copying the - * whole code in that project. + * external project. */ @InterfaceAudience.Private @InterfaceStability.Evolving