DataLakeFileFlushOptions Class

  • java.lang.Object
    • com.azure.storage.file.datalake.options.DataLakeFileFlushOptions

public class DataLakeFileFlushOptions

Optional parameters for appending data to a file when calling flush() on DataLakeFileClient and DataLakeFileAsyncClient

Constructor Summary

Constructor Description
DataLakeFileFlushOptions()

Method Summary

Modifier and Type Method and Description
LeaseAction getLeaseAction()

Get lease action set on file.

Integer getLeaseDuration()
PathHttpHeaders getPathHttpHeaders()

Optional standard HTTP header properties for the file.

String getProposedLeaseId()

Gets proposed lease id.

DataLakeRequestConditions getRequestConditions()

Optional DataLakeRequestConditions conditions that are set on the flush of this file.

Boolean isClose()

Azure Storage Events allow applications to receive notifications when files change.

Boolean isUncommittedDataRetained()

If "true", uncommitted data is retained after the flush operation completes; otherwise, the uncommitted data is deleted after the flush operation.

DataLakeFileFlushOptions setClose(Boolean close)

Sets whether file stream has been closed.

DataLakeFileFlushOptions setLeaseAction(LeaseAction leaseAction)

Get lease action set on file.

DataLakeFileFlushOptions setLeaseDuration(Integer leaseDurationInSeconds)

Sets the lease duration.

DataLakeFileFlushOptions setPathHttpHeaders(PathHttpHeaders pathHttpHeaders)

Optional standard HTTP header properties that can be set for the file.

DataLakeFileFlushOptions setProposedLeaseId(String proposedLeaseId)

Sets the proposed lease id.

DataLakeFileFlushOptions setRequestConditions(DataLakeRequestConditions requestConditions)

Optional DataLakeRequestConditions conditions to add on the flush of this file.

DataLakeFileFlushOptions setUncommittedDataRetained(Boolean retainUncommittedData)

Sets whether uncommitted data should be retained.

Methods inherited from java.lang.Object

Constructor Details

DataLakeFileFlushOptions

public DataLakeFileFlushOptions()

Method Details

getLeaseAction

public LeaseAction getLeaseAction()

Get lease action set on file. ACQUIRE will attempt to acquire a new lease on the file, with DataLakeFileFlushOptions#proposedLeaseId as the lease ID. ACQUIRE_RELEASE will attempt to acquire a new lease on the file, with DataLakeFileFlushOptions#proposedLeaseId as the lease ID. The lease will be released once the Append operation is complete. AUTO_RENEW will attempt to renew the lease specified by getLeaseId(). RELEASE will attempt to release the least specified by getLeaseId().

Returns:

The LeaseAction set on the file.

getLeaseDuration

public Integer getLeaseDuration()

Returns:

the lease duration in seconds.

getPathHttpHeaders

public PathHttpHeaders getPathHttpHeaders()

Optional standard HTTP header properties for the file.

Returns:

the PathHttpHeaders for this file.

getProposedLeaseId

public String getProposedLeaseId()

Gets proposed lease id. Valid with ACQUIRE and ACQUIRE_RELEASE.

Returns:

the proposed lease id.

getRequestConditions

public DataLakeRequestConditions getRequestConditions()

Optional DataLakeRequestConditions conditions that are set on the flush of this file.

Returns:

isClose

public Boolean isClose()

Azure Storage Events allow applications to receive notifications when files change. When Azure Storage Events are enabled, a file changed event is raised. This event has a property indicating whether this is the final change to distinguish the difference between an intermediate flush to a file stream and the final close of a file stream. The close query parameter is valid only when the action is "flush" and change notifications are enabled. If the value of close is "true" and the flush operation completes successfully, the service raises a file change notification with a property indicating that this is the final update (the file stream has been closed). If "false" a change notification is raised indicating the file has changed. The default is false. This query parameter is set to true by the Hadoop ABFS driver to indicate that the file stream has been closed.

Returns:

whether the file stream has been closed.

isUncommittedDataRetained

public Boolean isUncommittedDataRetained()

If "true", uncommitted data is retained after the flush operation completes; otherwise, the uncommitted data is deleted after the flush operation. The default is false. Data at offsets less than the specified position are written to the file when flush succeeds, but this optional parameter allows data after the flush position to be retained for a future flush operation.

Returns:

whether to retain uncommitted data.

setClose

public DataLakeFileFlushOptions setClose(Boolean close)

Sets whether file stream has been closed. Azure Storage Events allow applications to receive notifications when files change. When Azure Storage Events are enabled, a file changed event is raised. This event has a property indicating whether this is the final change to distinguish the difference between an intermediate flush to a file stream and the final close of a file stream. The close query parameter is valid only when the action is "flush" and change notifications are enabled. If the value of close is "true" and the flush operation completes successfully, the service raises a file change notification with a property indicating that this is the final update (the file stream has been closed). If "false" a change notification is raised indicating the file has changed. The default is false. This query parameter is set to true by the Hadoop ABFS driver to indicate that the file stream has been closed.

Parameters:

close - boolean flag to indicate whether file stream has been closed.

Returns:

the updated DataLakeFileFlushOptions object.

setLeaseAction

public DataLakeFileFlushOptions setLeaseAction(LeaseAction leaseAction)

Get lease action set on file. ACQUIRE will attempt to acquire a new lease on the file, with DataLakeFileFlushOptions#proposedLeaseId as the lease ID. ACQUIRE_RELEASE will attempt to acquire a new lease on the file, with DataLakeFileFlushOptions#proposedLeaseId as the lease ID. The lease will be released once the Append operation is complete. AUTO_RENEW will attempt to renew the lease specified by getLeaseId(). RELEASE will attempt to release the least specified by getLeaseId().

Parameters:

leaseAction - the LeaseAction to set on the file.

Returns:

the updated DataLakeFileFlushOptions object.

setLeaseDuration

public DataLakeFileFlushOptions setLeaseDuration(Integer leaseDurationInSeconds)

Sets the lease duration. 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.

Parameters:

leaseDurationInSeconds - the new lease duration.

Returns:

the updated DataLakeFileFlushOptions object.

setPathHttpHeaders

public DataLakeFileFlushOptions setPathHttpHeaders(PathHttpHeaders pathHttpHeaders)

Optional standard HTTP header properties that can be set for the file.

Parameters:

pathHttpHeaders - PathHttpHeaders to be set for this file.

Returns:

the updated DataLakeFileFlushOptions object.

setProposedLeaseId

public DataLakeFileFlushOptions setProposedLeaseId(String proposedLeaseId)

Sets the proposed lease id. Valid with ACQUIRE and ACQUIRE_RELEASE.

Parameters:

proposedLeaseId - the proposed lease id to set.

Returns:

the updated DataLakeFileFlushOptions object.

setRequestConditions

public DataLakeFileFlushOptions setRequestConditions(DataLakeRequestConditions requestConditions)

Optional DataLakeRequestConditions conditions to add on the flush of this file.

Parameters:

requestConditions - DataLakeRequestConditions to set on this file.

Returns:

the updated DataLakeFileFlushOptions object.

setUncommittedDataRetained

public DataLakeFileFlushOptions setUncommittedDataRetained(Boolean retainUncommittedData)

Sets whether uncommitted data should be retained. If "true", uncommitted data is retained after the flush operation completes; otherwise, the uncommitted data is deleted after the flush operation. The default is false. Data at offsets less than the specified position are written to the file when flush succeeds, but this optional parameter allows data after the flush position to be retained for a future flush operation.

Parameters:

retainUncommittedData - boolean flag to indicate whether uncommitted data should be retained.

Returns:

the updated DataLakeFileFlushOptions object.

Applies to