Class AsyncOperator
- All Implemented Interfaces:
AutoCloseable
Operators without an explicit executor share a default executor. Operators, derived streams, and outstanding operations keep it alive. Closing the last operator and stream releases it after outstanding operations complete; a later operator creates a new default executor.
The default executor uses the same worker context class loader behavior as AsyncExecutor.
-
Field Summary
FieldsFields inherited from class NativeObject
nativeHandle -
Method Summary
Modifier and TypeMethodDescriptionblocking()Create a new operator that performs every operation blocking.protected voiddisposeInternal(long handle) Deletes underlying native object pointer.Clone a new operator that is identical to this one.Create a new operator that is layered with the given layer.list(String path, ListOptions options) static AsyncOperatorConstruct an OpenDAL operator:static AsyncOperatorConstruct an OpenDAL operator:static AsyncOperatorof(ServiceConfig config) Construct an OpenDAL operator.static AsyncOperatorof(ServiceConfig config, AsyncExecutor executor) Construct an OpenDAL operator.presignRead(String path, Duration duration) presignRead(String path, Duration duration, ReadOptions options) Creates a presigned read request with the given options.presignStat(String path, Duration duration) presignStat(String path, Duration duration, StatOptions options) Creates a presigned stat request with the given options.presignWrite(String path, Duration duration) presignWrite(String path, Duration duration, WriteOptions options) Creates a presigned write request with the given options.CompletableFuture<byte[]> CompletableFuture<byte[]> CompletableFuture<byte[]> read(String path, ReadOptions options) stat(String path, StatOptions options) write(String path, byte[] content, WriteOptions options) write(String path, String content, WriteOptions options) Methods inherited from class NativeObject
close, isDisposed
-
Field Details
-
info
-
-
Method Details
-
of
Construct an OpenDAL operator.- Parameters:
config- the config of the underneath service to access data from.
-
of
Construct an OpenDAL operator.- Parameters:
executor- the underneath executor to run async operations;nullto use a default global executor.
-
of
Construct an OpenDAL operator:You can find all possible schemes here and see what config options each service supports.
- Parameters:
scheme- the name of the underneath service to access data from.map- a map of properties to construct the underneath operator.
-
of
Construct an OpenDAL operator:You can find all possible schemes here and see what config options each service supports.
- Parameters:
scheme- the name of the underneath service to access data from.map- a map of properties to construct the underneath operator.executor- the underneath executor to run async operations;nullto use a default global executor.
-
duplicate
Clone a new operator that is identical to this one. The new operator has its own lifecycle.Since an operator will release all its resource and "flush" on lifecycle end, this method is suitable to create a narrowed "scope" while avoiding creating a brand-new operator for each scope.
- Returns:
- the cloned operator.
-
layer
Create a new operator that is layered with the given layer.Note that the current operator is not modified. The returned operator is a new instance. You must close the current operator on demand to avoid resource leak.
- Parameters:
layer- the layer to be applied.- Returns:
- the layered new operator.
-
blocking
Create a new operator that performs every operation blocking.Note that the current operator is not modified. The returned operator is a new instance. You must close the current operator on demand to avoid resource leak.
- Returns:
- the blocking new operator.
-
write
-
write
-
write
-
write
-
stat
-
stat
-
read
-
read
-
read
-
presignRead
-
presignRead
public CompletableFuture<PresignedRequest> presignRead(String path, Duration duration, ReadOptions options) Creates a presigned read request with the given options.The service must support presigning this operation. Support for individual options depends on the service. Send the returned HTTP method and headers along with the URI.
- Parameters:
path- the path of the object.duration- how long the presigned request remains valid.options- the read options to include in the presigned request.- Returns:
- the presigned request.
-
presignWrite
-
presignWrite
public CompletableFuture<PresignedRequest> presignWrite(String path, Duration duration, WriteOptions options) Creates a presigned write request with the given options.The service must support presigning this operation. Support for individual options depends on the service. Send the returned HTTP method and headers along with the URI.
- Parameters:
path- the path of the object.duration- how long the presigned request remains valid.options- the write options to include in the presigned request.- Returns:
- the presigned request.
-
presignStat
-
presignStat
public CompletableFuture<PresignedRequest> presignStat(String path, Duration duration, StatOptions options) Creates a presigned stat request with the given options.The service must support presigning this operation. Support for individual options depends on the service. Send the returned HTTP method and headers along with the URI.
- Parameters:
path- the path of the object.duration- how long the presigned request remains valid.options- the stat options to include in the presigned request.- Returns:
- the presigned request.
-
delete
-
createDir
-
copy
-
rename
-
removeAll
-
list
-
list
-
disposeInternal
protected void disposeInternal(long handle) Description copied from class:NativeObjectDeletes underlying native object pointer.- Specified by:
disposeInternalin classNativeObject- Parameters:
handle- to the native object pointer
-