Class AzureDataStore
- java.lang.Object
-
- org.apache.jackrabbit.core.data.AbstractDataStore
-
- org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore
-
- org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage.AzureDataStore
-
- All Implemented Interfaces:
DataStore
,MultiDataStoreAware
,ConfigurableDataRecordAccessProvider
,DataRecordAccessProvider
,TypedDataStore
,SharedDataStore
public class AzureDataStore extends AbstractSharedCachingDataStore implements ConfigurableDataRecordAccessProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.jackrabbit.oak.plugins.blob.SharedDataStore
SharedDataStore.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Properties
properties
-
Fields inherited from class org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore
backend, cache, executor, listeningExecutor, schedulerExecutor
-
Fields inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
DIGEST
-
-
Constructor Summary
Constructors Constructor Description AzureDataStore()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 providedDataRecord
.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)
-
Methods inherited from class org.apache.jackrabbit.oak.plugins.blob.AbstractSharedCachingDataStore
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
-
Methods inherited from class org.apache.jackrabbit.core.data.AbstractDataStore
encodeHexString, getRecordFromReference, getReferenceFromIdentifier
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.jackrabbit.oak.plugins.blob.SharedDataStore
getRepositoryId, setRepositoryId
-
-
-
-
Method Detail
-
createBackend
protected AbstractSharedBackend createBackend()
- Specified by:
createBackend
in classAbstractSharedCachingDataStore
-
setProperties
public void setProperties(java.util.Properties properties)
-
getBackend
public SharedBackend getBackend()
-
getMinRecordLength
public int getMinRecordLength()
- Specified by:
getMinRecordLength
in interfaceDataStore
-
setMinRecordLength
public void setMinRecordLength(int minRecordLength)
-
setDirectUploadURIExpirySeconds
public void setDirectUploadURIExpirySeconds(int seconds)
Description copied from interface:ConfigurableDataRecordAccessProvider
Specifies the number of seconds before a signed upload URI will expire. Setting this to 0 is equivalent to turning off the ability to use direct upload.- Specified by:
setDirectUploadURIExpirySeconds
in interfaceConfigurableDataRecordAccessProvider
- Parameters:
seconds
- Number of seconds before an upload URI expires.
-
setBinaryTransferAccelerationEnabled
public void setBinaryTransferAccelerationEnabled(boolean enabled)
Description copied from interface:ConfigurableDataRecordAccessProvider
Enables or disables binary transfer acceleration, if supported by the service provider.- Specified by:
setBinaryTransferAccelerationEnabled
in interfaceConfigurableDataRecordAccessProvider
- Parameters:
enabled
- True to enable binary transfer acceleration (if supported); False otherwise.
-
initiateDataRecordUpload
@Nullable public @Nullable DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs) throws java.lang.IllegalArgumentException, DataRecordUploadException
Description copied from interface:DataRecordAccessProvider
Begin a transaction to perform a direct binary upload to the storage location.- Specified by:
initiateDataRecordUpload
in interfaceDataRecordAccessProvider
- Parameters:
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 inIllegalArgumentException
.- Returns:
- A
DataRecordUpload
referencing this direct upload, ornull
if the implementation does not support direct upload. - Throws:
java.lang.IllegalArgumentException
- if the service provider or implementation cannot support the requested upload.DataRecordUploadException
- if the upload cannot be completed as requested.
-
initiateDataRecordUpload
@Nullable public @Nullable DataRecordUpload initiateDataRecordUpload(long maxUploadSizeInBytes, int maxNumberOfURIs, @NotNull @NotNull DataRecordUploadOptions options) throws java.lang.IllegalArgumentException, DataRecordUploadException
Description copied from interface:DataRecordAccessProvider
Begin a transaction to perform a direct binary upload to the storage location.- Specified by:
initiateDataRecordUpload
in interfaceDataRecordAccessProvider
- Parameters:
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 inIllegalArgumentException
.options
- - aDataRecordUploadOptions
instance containing any caller-specified options for upload URI generation.- Returns:
- A
DataRecordUpload
referencing this direct upload, ornull
if the implementation does not support direct upload. - Throws:
java.lang.IllegalArgumentException
- if the service provider or implementation cannot support the requested upload.DataRecordUploadException
- if the upload cannot be completed as requested.
-
completeDataRecordUpload
@NotNull public @NotNull DataRecord completeDataRecordUpload(java.lang.String uploadToken) throws java.lang.IllegalArgumentException, DataRecordUploadException, DataStoreException
Description copied from interface:DataRecordAccessProvider
Completes the transaction to perform a direct binary upload. This method verifies that the uploaded binary has been created and is now referenceable. For some providers doing multi-part upload, this also completes the multi-part upload process if a multi-part upload was performed.- Specified by:
completeDataRecordUpload
in interfaceDataRecordAccessProvider
- Parameters:
uploadToken
- The upload token identifying this direct upload transaction, as returned in theDataRecordUpload
object resulting from a call toDataRecordAccessProvider.initiateDataRecordUpload(long, int)
.- Returns:
- A
DataRecord
for the uploaded binary. - Throws:
java.lang.IllegalArgumentException
- if theuploadToken
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.
-
setDirectDownloadURIExpirySeconds
public void setDirectDownloadURIExpirySeconds(int seconds)
Description copied from interface:ConfigurableDataRecordAccessProvider
Specifies the number of seconds before a signed download URI will expire. Setting this to 0 is equivalent to turning off the ability to use direct download.- Specified by:
setDirectDownloadURIExpirySeconds
in interfaceConfigurableDataRecordAccessProvider
- Parameters:
seconds
- Number of seconds before a download URI expires.
-
setDirectDownloadURICacheSize
public void setDirectDownloadURICacheSize(int maxSize)
Description copied from interface:ConfigurableDataRecordAccessProvider
Specifies the maximum number of read URIs to be cached in an in-memory cache. Setting this to 0 is equivalent to disabling the cache.- Specified by:
setDirectDownloadURICacheSize
in interfaceConfigurableDataRecordAccessProvider
- Parameters:
maxSize
- Number of read URIs to cache.
-
getDownloadURI
@Nullable public @Nullable java.net.URI getDownloadURI(@NotNull @NotNull DataIdentifier identifier, @NotNull @NotNull DataRecordDownloadOptions downloadOptions)
Description copied from interface:DataRecordAccessProvider
Return a URI for directly reading the binary associated with the providedDataRecord
.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 aBlobDownloadOptions
instance by callingDataRecordDownloadOptions.fromBlobDownloadOptions(BlobDownloadOptions)
, or to accept the service provider default behavior a caller can simply useDataRecordDownloadOptions.DEFAULT
.- Specified by:
getDownloadURI
in interfaceDataRecordAccessProvider
- Parameters:
identifier
- TheDataIdentifier
for theDataRecord
containing the binary to be read via direct download.downloadOptions
- ADataRecordDownloadOptions
instance used to specify any download options that should be set on this download.- Returns:
- A URI for directly reading the binary, or
null
if the URI cannot be generated, for example if the capability is disabled by configuration or if a service provider error occurs.
-
-