public class AzureDataStore extends AbstractSharedCachingDataStore implements ConfigurableDataRecordAccessProvider
SharedDataStore.Type
Modifier and Type | Field and Description |
---|---|
protected java.util.Properties |
properties |
backend, cache, executor, listeningExecutor, schedulerExecutor
DIGEST
Constructor and Description |
---|
AzureDataStore() |
Modifier and Type | Method and Description |
---|---|
@NotNull DataRecord |
completeDataRecordUpload(java.lang.String uploadToken)
Completes the transaction to perform a direct binary upload.
|
protected AbstractSharedBackend |
createBackend() |
SharedBackend |
getBackend() |
@Nullable java.net.URI |
getDownloadURI(@NotNull DataIdentifier identifier,
@NotNull DataRecordDownloadOptions downloadOptions)
Return a URI for directly reading the binary associated with the provided
DataRecord . |
int |
getMinRecordLength() |
@Nullable DataRecordUpload |
initiateDataRecordUpload(long maxUploadSizeInBytes,
int maxNumberOfURIs)
Begin a transaction to perform a direct binary upload to the storage
location.
|
@Nullable DataRecordUpload |
initiateDataRecordUpload(long maxUploadSizeInBytes,
int maxNumberOfURIs,
@NotNull DataRecordUploadOptions options)
Begin a transaction to perform a direct binary upload to the storage
location.
|
void |
setBinaryTransferAccelerationEnabled(boolean enabled)
Enables or disables binary transfer acceleration, if supported by the
service provider.
|
void |
setDirectDownloadURICacheSize(int maxSize)
Specifies the maximum number of read URIs to be cached in an in-memory
cache.
|
void |
setDirectDownloadURIExpirySeconds(int seconds)
Specifies the number of seconds before a signed download URI will expire.
|
void |
setDirectUploadURIExpirySeconds(int seconds)
Specifies the number of seconds before a signed upload URI will expire.
|
void |
setMinRecordLength(int minRecordLength) |
void |
setProperties(java.util.Properties properties) |
addMetadataRecord, addMetadataRecord, addRecord, addRecord, clearInUse, close, deleteAllMetadataRecords, deleteAllOlderThan, deleteMetadataRecord, deleteRecord, exists, getAllIdentifiers, getAllMetadataRecords, getAllRecords, getCache, getMetadataRecord, getOrCreateReferenceKey, getRecord, getRecordForId, getRecordIfStored, getStats, getType, init, metadataRecordExists, setCacheSize, setPath, setStagingPurgeInterval, setStagingRetryInterval, setStagingSplitPercentage, setStatisticsProvider, setUploadThreads, updateModifiedDateOnAccess
encodeHexString, getRecordFromReference, getReferenceFromIdentifier
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getRepositoryId, setRepositoryId
protected AbstractSharedBackend createBackend()
createBackend
in class AbstractSharedCachingDataStore
public void setProperties(java.util.Properties properties)
public SharedBackend getBackend()
public int getMinRecordLength()
getMinRecordLength
in interface DataStore
public void setMinRecordLength(int minRecordLength)
public void setDirectUploadURIExpirySeconds(int seconds)
ConfigurableDataRecordAccessProvider
setDirectUploadURIExpirySeconds
in interface ConfigurableDataRecordAccessProvider
seconds
- Number of seconds before an upload URI expires.public void setBinaryTransferAccelerationEnabled(boolean enabled)
ConfigurableDataRecordAccessProvider
setBinaryTransferAccelerationEnabled
in interface ConfigurableDataRecordAccessProvider
enabled
- True to enable binary transfer acceleration (if
supported); False otherwise.@Nullable public @Nullable DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs) throws java.lang.IllegalArgumentException, DataRecordUploadException
DataRecordAccessProvider
initiateDataRecordUpload
in interface DataRecordAccessProvider
maxUploadSizeInBytes
- - the largest size of the binary to be
uploaded, in bytes, based on the caller's best guess. If the
actual size of the file to be uploaded is known, that value should
be used.maxNumberOfURIs
- - the maximum number of URIs the client is able to
accept. If the caller does not support multi-part uploading, this
value should be 1. Note that the implementing class is not
required to support multi-part uploading so it may return only a
single upload URI regardless of the value passed in for this
parameter. A caller may also pass in -1 to indicate that it is
able to accept any number of URIs. Any other negative number or
0 may result in IllegalArgumentException
.DataRecordUpload
referencing this direct upload,
or null
if the implementation does not support direct
upload.java.lang.IllegalArgumentException
- if the service provider or
implementation cannot support the requested upload.DataRecordUploadException
- if the upload cannot be completed as
requested.@Nullable public @Nullable DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull @NotNull DataRecordUploadOptions options) throws java.lang.IllegalArgumentException, DataRecordUploadException
DataRecordAccessProvider
initiateDataRecordUpload
in interface DataRecordAccessProvider
maxUploadSizeInBytes
- - the largest size of the binary to be
uploaded, in bytes, based on the caller's best guess. If the
actual size of the file to be uploaded is known, that value should
be used.maxNumberOfURIs
- - the maximum number of URIs the client is able to
accept. If the caller does not support multi-part uploading, this
value should be 1. Note that the implementing class is not
required to support multi-part uploading so it may return only a
single upload URI regardless of the value passed in for this
parameter. A caller may also pass in -1 to indicate that it is
able to accept any number of URIs. Any other negative number or
0 may result in IllegalArgumentException
.options
- - a DataRecordUploadOptions
instance containing
any caller-specified options for upload URI generation.DataRecordUpload
referencing this direct upload,
or null
if the implementation does not support direct
upload.java.lang.IllegalArgumentException
- if the service provider or
implementation cannot support the requested upload.DataRecordUploadException
- if the upload cannot be completed as
requested.@NotNull public @NotNull DataRecord completeDataRecordUpload(java.lang.String uploadToken) throws java.lang.IllegalArgumentException, DataRecordUploadException, DataStoreException
DataRecordAccessProvider
completeDataRecordUpload
in interface DataRecordAccessProvider
uploadToken
- The upload token identifying this direct upload
transaction, as returned in the DataRecordUpload
object resulting from a call to DataRecordAccessProvider.initiateDataRecordUpload(long, int)
.DataRecord
for the uploaded binary.java.lang.IllegalArgumentException
- if the uploadToken
is null,
empty, or otherwise invalid.DataRecordUploadException
- if the object written can't be found by
the service provider.DataStoreException
- if the object written can't be found by the
DataStore.public void setDirectDownloadURIExpirySeconds(int seconds)
ConfigurableDataRecordAccessProvider
setDirectDownloadURIExpirySeconds
in interface ConfigurableDataRecordAccessProvider
seconds
- Number of seconds before a download URI expires.public void setDirectDownloadURICacheSize(int maxSize)
ConfigurableDataRecordAccessProvider
setDirectDownloadURICacheSize
in interface ConfigurableDataRecordAccessProvider
maxSize
- Number of read URIs to cache.@Nullable public @Nullable java.net.URI getDownloadURI(@NotNull @NotNull DataIdentifier identifier, @NotNull @NotNull DataRecordDownloadOptions downloadOptions)
DataRecordAccessProvider
DataRecord
.
The caller must provide a DataRecordDownloadOptions
instance that
will be used by the implementation to specify options on the download.
This can be obtained from a BlobDownloadOptions
instance by
calling DataRecordDownloadOptions.fromBlobDownloadOptions(BlobDownloadOptions)
,
or to accept the service provider default behavior a caller can simply
use DataRecordDownloadOptions.DEFAULT
.
getDownloadURI
in interface DataRecordAccessProvider
identifier
- The DataIdentifier
for the DataRecord
containing the binary to be read via direct download.downloadOptions
- A DataRecordDownloadOptions
instance used
to specify any download options that should be set on this
download.null
if the URI
cannot be generated, for example if the capability is disabled by
configuration or if a service provider error occurs.Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.