Package org.opensearch.repositories.s3
Class AmazonS3Reference
- java.lang.Object
-
- org.opensearch.common.util.concurrent.AbstractRefCounted
-
- org.opensearch.repositories.s3.AmazonS3Reference
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Releasable,RefCounted
public class AmazonS3Reference extends AbstractRefCounted implements Releasable
Handles the shutdown of the wrappedAmazonS3Clientusing reference counting.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.amazonaws.services.s3.AmazonS3client()Returns the underlying `AmazonS3` client.voidclose()Call when the client is not needed anymore.protected voidcloseInternal()-
Methods inherited from class org.opensearch.common.util.concurrent.AbstractRefCounted
alreadyClosed, decRef, getName, incRef, refCount, tryIncRef
-
-
-
-
Method Detail
-
close
public void close()
Call when the client is not needed anymore.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfaceReleasable
-
client
public com.amazonaws.services.s3.AmazonS3 client()
Returns the underlying `AmazonS3` client. All method calls are permitted BUT NOT shutdown. Shutdown is called when reference count reaches 0.
-
closeInternal
protected void closeInternal()
- Specified by:
closeInternalin classAbstractRefCounted
-
-