Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builds will compile now but tests will still fail right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we do tricks with handoff. the HBoss code should get its own class invoked because it subclasses this one; it's the new method (with stats coming) in which isn't called.

And for S3A itself, because our clients do implement the method -this one never gets invoked

}

}