Class DataLakeFileAppendOptions
java.lang.Object
com.azure.storage.file.datalake.options.DataLakeFileAppendOptions
Optional parameters for appending data to a file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
When this header is specified, the storage service compares the hash of the content that has arrived with this header value.Get lease action set on file.Gets the lease duration in seconds.Gets the lease ID to access the file.Gets proposed lease id.isFlush()
Returns whether file will be flushed after the append.setContentHash
(byte[] contentMd5) This hash is used to verify the integrity of the request content during transport.If true, the file will be flushed after the append.setLeaseAction
(LeaseAction leaseAction) Get lease action set on file.setLeaseDuration
(Integer leaseDurationInSeconds) Optional.setLeaseId
(String leaseId) Sets the lease ID.setProposedLeaseId
(String proposedLeaseId) Sets the proposed lease id.
-
Constructor Details
-
DataLakeFileAppendOptions
public DataLakeFileAppendOptions()Creates a new instance ofDataLakeFileAppendOptions
.
-
-
Method Details
-
getLeaseId
Gets the lease ID to access the file.- Returns:
- lease ID to access this file.
-
setLeaseId
Sets the lease ID.- Parameters:
leaseId
- The lease ID.- Returns:
- the updated DataLakeFileAppendOptions object.
-
getContentMd5
public byte[] getContentMd5()When this header is specified, the storage service compares the hash of the content that has arrived with this header value. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). Note that this MD5 hash is not stored with the file. This header is associated with the request content, and not with the stored content of the file itself.- Returns:
- MD5 hash of the content of the data.
-
setContentHash
This hash is used to verify the integrity of the request content during transport. When this header is specified, the storage service compares the hash of the content that has arrived with this header value. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). Note that this MD5 hash is not stored with the file. This header is associated with the request content, and not with the stored content of the file itself.- Parameters:
contentMd5
- contentMd5 An MD5 hash of the content of the data. If specified, the service will calculate the MD5 of the received data and fail the request if it does not match the provided MD5.- Returns:
- the updated DataLakeFileAppendOptions object.
-
isFlush
Returns whether file will be flushed after the append.- Returns:
- the boolean flag for flush.
-
setFlush
If true, the file will be flushed after the append.- Parameters:
flush
- boolean flag to indicate whether file should be flushed.- Returns:
- the updated DataLakeFileAppendOptions object.
-
getLeaseAction
Get lease action set on file.LeaseAction.ACQUIRE
will attempt to acquire a new lease on the file, withproposedLeaseId
as the lease ID.LeaseAction.ACQUIRE_RELEASE
will attempt to aquire a new lease on the file, withproposedLeaseId
as the lease ID. The lease will be released once the Append operation is complete.LeaseAction.AUTO_RENEW
will attempt to renew the lease specified byDataLakeRequestConditions.getLeaseId()
.LeaseAction.RELEASE
will attempt to release the least specified byDataLakeRequestConditions.getLeaseId()
.- Returns:
- The
LeaseAction
set on the file.
-
setLeaseAction
Get lease action set on file.LeaseAction.ACQUIRE
will attempt to acquire a new lease on the file, withproposedLeaseId
as the lease ID.LeaseAction.ACQUIRE_RELEASE
will attempt to aquire a new lease on the file, withproposedLeaseId
as the lease ID. The lease will be released once the Append operation is complete.LeaseAction.AUTO_RENEW
will attempt to renew the lease specified byDataLakeRequestConditions.getLeaseId()
.LeaseAction.RELEASE
will attempt to release the least specified byDataLakeRequestConditions.getLeaseId()
.- Parameters:
leaseAction
- theLeaseAction
to set on the file.- Returns:
- the updated DataLakeFileAppendOptions object.
-
getLeaseDuration
Gets the lease duration in seconds.- Returns:
- the lease duration in seconds.
-
setLeaseDuration
Optional. Specifies the duration of the lease, in seconds, or specify -1 for a lease that never expires. A non-infinite lease can be between 15 and 60 seconds. Sets the lease duration.- Parameters:
leaseDurationInSeconds
- the new lease duration.- Returns:
- the updated DataLakeFileAppendOptions object.
-
getProposedLeaseId
Gets proposed lease id. Valid withLeaseAction.ACQUIRE
andLeaseAction.ACQUIRE_RELEASE
.- Returns:
- the proposed lease id.
-
setProposedLeaseId
Sets the proposed lease id. Valid withLeaseAction.ACQUIRE
andLeaseAction.ACQUIRE_RELEASE
.- Parameters:
proposedLeaseId
- the proposed lease id to set.- Returns:
- the updated DataLakeFileAppendOptions object.
-