Package org.apache.hadoop.fs.s3a.impl
Class ClientManagerImpl
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.fs.s3a.impl.ClientManagerImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,ClientManager,org.apache.hadoop.service.Service
public class ClientManagerImpl
extends org.apache.hadoop.service.AbstractService
implements ClientManager
Client manager for on-demand creation of S3 clients,
with parallelized close of them in
serviceStop().
Updates Statistic.STORE_CLIENT_CREATION
to track count and duration of client creation.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClientManagerImpl(S3ClientFactory clientFactory, S3ClientFactory unencryptedClientFactory, S3ClientFactory.S3ClientCreationParameters clientCreationParameters, org.apache.hadoop.fs.statistics.DurationTrackerFactory durationTrackerFactory) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionsoftware.amazon.awssdk.services.s3.S3AsyncClientGet the Async S3Client,raising a failure to create as an IOException.software.amazon.awssdk.services.s3.S3ClientGet the AsyncS3Client, raising a failure to create as an UncheckedIOException.software.amazon.awssdk.services.s3.S3ClientGet the S3Client, raising a failure to create as an IOException.software.amazon.awssdk.services.s3.S3ClientGet the S3Client, raising a failure to create as an UncheckedIOException.software.amazon.awssdk.transfer.s3.S3TransferManagerGet the transfer manager, creating it and any dependencies if needed.software.amazon.awssdk.services.s3.S3ClientGet or create an unencrypted S3 client.getUri()Get the URI of the filesystem.protected voidtoString()Methods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, serviceStart, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.hadoop.service.Service
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, registerServiceListener, start, stop, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
LOG
public static final org.slf4j.Logger LOG
-
-
Constructor Details
-
ClientManagerImpl
public ClientManagerImpl(S3ClientFactory clientFactory, S3ClientFactory unencryptedClientFactory, S3ClientFactory.S3ClientCreationParameters clientCreationParameters, org.apache.hadoop.fs.statistics.DurationTrackerFactory durationTrackerFactory) Constructor.This does not create any clients.
It does disable noisy logging from the S3 Transfer Manager.
- Parameters:
clientFactory- client factory to invokeunencryptedClientFactory- client factory to invokeclientCreationParameters- creation parameters.durationTrackerFactory- duration tracker.
-
-
Method Details
-
getOrCreateS3Client
Description copied from interface:ClientManagerGet the S3Client, raising a failure to create as an IOException.- Specified by:
getOrCreateS3Clientin interfaceClientManager- Returns:
- the S3 client
- Throws:
IOException- failure to create the client.
-
getOrCreateS3ClientUnchecked
public software.amazon.awssdk.services.s3.S3Client getOrCreateS3ClientUnchecked() throws UncheckedIOExceptionGet the S3Client, raising a failure to create as an UncheckedIOException.- Specified by:
getOrCreateS3ClientUncheckedin interfaceClientManager- Returns:
- the S3 client
- Throws:
UncheckedIOException- failure to create the client.
-
getOrCreateAsyncClient
Description copied from interface:ClientManagerGet the Async S3Client,raising a failure to create as an IOException.- Specified by:
getOrCreateAsyncClientin interfaceClientManager- Returns:
- the Async S3 client
- Throws:
IOException- failure to create the client.
-
getOrCreateAsyncS3ClientUnchecked
public software.amazon.awssdk.services.s3.S3Client getOrCreateAsyncS3ClientUnchecked() throws UncheckedIOExceptionGet the AsyncS3Client, raising a failure to create as an UncheckedIOException.- Specified by:
getOrCreateAsyncS3ClientUncheckedin interfaceClientManager- Returns:
- the S3 client
- Throws:
UncheckedIOException- failure to create the client.
-
getOrCreateUnencryptedS3Client
public software.amazon.awssdk.services.s3.S3Client getOrCreateUnencryptedS3Client() throws IOExceptionGet or create an unencrypted S3 client. This is used for unencrypted operations when CSE is enabled with V1 compatibility.- Specified by:
getOrCreateUnencryptedS3Clientin interfaceClientManager- Returns:
- unencrypted S3 client
- Throws:
IOException- on any failure
-
getOrCreateTransferManager
public software.amazon.awssdk.transfer.s3.S3TransferManager getOrCreateTransferManager() throws IOExceptionDescription copied from interface:ClientManagerGet the transfer manager, creating it and any dependencies if needed.- Specified by:
getOrCreateTransferManagerin interfaceClientManager- Returns:
- a transfer manager
- Throws:
IOException- on any failure to create the manager
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.AbstractService- Throws:
Exception
-
getUri
Get the URI of the filesystem.- Returns:
- URI to use when creating clients.
-
toString
- Overrides:
toStringin classorg.apache.hadoop.service.AbstractService
-