diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ClientFactory.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ClientFactory.java index e04d3b5cbd269..7bec15f96c310 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ClientFactory.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3ClientFactory.java @@ -30,6 +30,10 @@ /** * Factory for creation of {@link AmazonS3} client instances. + * Important: HBase's HBoss module implements this interface in its + * test. + * Take care when updating this interface to ensure that a client + * implementing only the deprecated method will work. */ @InterfaceAudience.Private @InterfaceStability.Unstable @@ -46,10 +50,33 @@ public interface S3ClientFactory { * @return S3 client * @throws IOException IO problem */ - AmazonS3 createS3Client(URI name, + default AmazonS3 createS3Client(URI name, String bucket, AWSCredentialsProvider credentialSet, String userAgentSuffix, - StatisticsFromAwsSdk statisticsFromAwsSdk) throws IOException; + StatisticsFromAwsSdk statisticsFromAwsSdk) throws IOException { + return createS3Client(name, bucket, credentialSet, userAgentSuffix); + } + + /** + * Creates a new {@link AmazonS3} client. + * Obsolete and never directly called in the s3 code. + * It exists to keep HBoss builds compiling: they do implement it + * and want to build/run across Hadoop versions. + * @param name raw input S3A file system URI + * @param bucket Optional bucket to use to look up per-bucket proxy secrets + * @param credentialSet credentials to use + * @param userAgentSuffix optional suffix for the UA field. + * @return S3 client + * @throws IOException IO problem + * @deprecated this is only here to stop hboss builds breaking. + */ + @Deprecated + default AmazonS3 createS3Client(URI name, + String bucket, + AWSCredentialsProvider credentialSet, + String userAgentSuffix) throws IOException { + throw new UnsupportedOperationException("Not implemented"); + } }