HADOOP-18016. Make certain methods LimitedPrivate in S3AUtils.java (#3685)

Contributed By: Mehakmeet Singh
This commit is contained in:
Mehakmeet Singh 2021-11-24 13:32:59 +05:30 committed by GitHub
parent d3f0b7eab7
commit a35f7dec25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -96,6 +96,8 @@ import static org.apache.hadoop.util.functional.RemoteIterators.filteringRemoteI
/** /**
* Utility methods for S3A code. * Utility methods for S3A code.
* Some methods are marked LimitedPrivate since they are being used in an
* external project.
*/ */
@InterfaceAudience.Private @InterfaceAudience.Private
@InterfaceStability.Evolving @InterfaceStability.Evolving
@ -884,6 +886,8 @@ public final class S3AUtils {
/** /**
* Get a password from a configuration, including JCEKS files, handling both * Get a password from a configuration, including JCEKS files, handling both
* the absolute key and bucket override. * the absolute key and bucket override.
* <br>
* <i>Note:</i> LimitedPrivate for ranger repository to get secrets.
* @param bucket bucket or "" if none known * @param bucket bucket or "" if none known
* @param conf configuration * @param conf configuration
* @param baseKey base key to look up, e.g "fs.s3a.secret.key" * @param baseKey base key to look up, e.g "fs.s3a.secret.key"
@ -894,6 +898,7 @@ public final class S3AUtils {
* @throws IOException on any IO problem * @throws IOException on any IO problem
* @throws IllegalArgumentException bad arguments * @throws IllegalArgumentException bad arguments
*/ */
@InterfaceAudience.LimitedPrivate("Ranger")
public static String lookupPassword( public static String lookupPassword(
String bucket, String bucket,
Configuration conf, Configuration conf,
@ -1152,10 +1157,15 @@ public final class S3AUtils {
* This method does not propagate security provider path information from * This method does not propagate security provider path information from
* the S3A property into the Hadoop common provider: callers must call * the S3A property into the Hadoop common provider: callers must call
* {@link #patchSecurityCredentialProviders(Configuration)} explicitly. * {@link #patchSecurityCredentialProviders(Configuration)} explicitly.
*
* <br>
* <i>Note:</i> LimitedPrivate for ranger repository to set up
* per-bucket configurations.
* @param source Source Configuration object. * @param source Source Configuration object.
* @param bucket bucket name. Must not be empty. * @param bucket bucket name. Must not be empty.
* @return a (potentially) patched clone of the original. * @return a (potentially) patched clone of the original.
*/ */
@InterfaceAudience.LimitedPrivate("Ranger")
public static Configuration propagateBucketOptions(Configuration source, public static Configuration propagateBucketOptions(Configuration source,
String bucket) { String bucket) {
@ -1351,6 +1361,8 @@ public final class S3AUtils {
/** /**
* Initializes AWS SDK proxy support in the AWS client configuration * Initializes AWS SDK proxy support in the AWS client configuration
* if the S3A settings enable it. * if the S3A settings enable it.
* <br>
* <i>Note:</i> LimitedPrivate to provide proxy support in ranger repository.
* *
* @param conf Hadoop configuration * @param conf Hadoop configuration
* @param bucket Optional bucket to use to look up per-bucket proxy secrets * @param bucket Optional bucket to use to look up per-bucket proxy secrets
@ -1358,6 +1370,7 @@ public final class S3AUtils {
* @throws IllegalArgumentException if misconfigured * @throws IllegalArgumentException if misconfigured
* @throws IOException problem getting username/secret from password source. * @throws IOException problem getting username/secret from password source.
*/ */
@InterfaceAudience.LimitedPrivate("Ranger")
public static void initProxySupport(Configuration conf, public static void initProxySupport(Configuration conf,
String bucket, String bucket,
ClientConfiguration awsConf) throws IllegalArgumentException, ClientConfiguration awsConf) throws IllegalArgumentException,