java.lang.Object
org.apache.beam.sdk.io.aws2.common.ObjectPool<KeyT,ObjectT> 
- Type Parameters:
- KeyT- > Key to share objects by
- ObjectT- > Shared object
- Direct Known Subclasses:
- ObjectPool.ClientPool
@Internal
public class ObjectPool<KeyT extends @NonNull Object,ObjectT extends @NonNull Object> 
extends Object
Reference counting object pool to easily share invalid input: '&' destroy objects.
 
Internal only, subject to incompatible changes or removal at any time!
NOTE: This relies heavily on the implementation of Object.equals(Object) for ObjectPool.
 If not implemented properly, clients can't be shared between instances of DoFn.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classObjectPool.ClientPool<ClientT extends SdkClient>Client pool to easily share AWS clients per configuration.
- 
Constructor SummaryConstructorsConstructorDescriptionObjectPool(Function<KeyT, ObjectT> builder) ObjectPool(Function<KeyT, ObjectT> builder, @Nullable ThrowingConsumer<Exception, ObjectT> finalizer) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic <ClientT extends SdkClient,BuilderT extends AwsClientBuilder<BuilderT, ClientT>> 
 ObjectPool.ClientPool<ClientT> pooledClientFactory(BuilderT builder) voidRelease a reference to a shared client instance.voidreleaseByKey(KeyT key) Release a reference to a shared object instance usingObjectPool.Retain a reference to a shared client instance.
- 
Constructor Details- 
ObjectPool
- 
ObjectPool
 
- 
- 
Method Details- 
retainRetain a reference to a shared client instance. If not available, an instance is created.
- 
releaseByKeyRelease a reference to a shared object instance usingObjectPool. If that instance is not used anymore, it will be removed and destroyed.
- 
releaseRelease a reference to a shared client instance. If that instance is not used anymore, it will be removed and destroyed.
- 
pooledClientFactorypublic static <ClientT extends SdkClient,BuilderT extends AwsClientBuilder<BuilderT, ObjectPool.ClientPool<ClientT> pooledClientFactoryClientT>> (BuilderT builder) 
 
-