Share via


DataLakeLeaseClient Class

Definition

The DataLakeLeaseClient allows you to manipulate Azure Storage leases on paths.

public class DataLakeLeaseClient
type DataLakeLeaseClient = class
Public Class DataLakeLeaseClient
Inheritance
DataLakeLeaseClient

Constructors

DataLakeLeaseClient()

Initializes a new instance of the DataLakeLeaseClient class for mocking.

DataLakeLeaseClient(DataLakeFileSystemClient, String)

Initializes a new instance of the DataLakeLeaseClient class.

DataLakeLeaseClient(DataLakePathClient, String)

Initializes a new instance of the DataLakeLeaseClient class.

Fields

InfiniteLeaseDuration

The TimeSpan representing an infinite lease duration.

Properties

LeaseId

Gets the Lease ID for this lease.

Uri

Gets the URI of the object being leased.

Methods

Acquire(TimeSpan, RequestConditions, CancellationToken)

The Acquire(TimeSpan, RequestConditions, CancellationToken) operation acquires a lease on the path or file system. The lease duration must be between 15 to 60 seconds, or infinite (-1).

If the file system does not have an active lease, the Data Lake service creates a lease on the path or file system and returns it. If the file system has an active lease, you can only request a new lease using the active lease ID as LeaseId, but you can specify a new duration.

For more information, see Lease Container.

AcquireAsync(TimeSpan, RequestConditions, CancellationToken)

The AcquireAsync(TimeSpan, RequestConditions, CancellationToken) operation acquires a lease on the path or file system. The lease duration must be between 15 to 60 seconds, or infinite (-1).

If the file system does not have an active lease, the Data Lake service creates a lease on the file system or path and returns it. If the file system has an active lease, you can only request a new lease using the active lease ID as LeaseId, but you can specify a new duration.

For more information, see Lease Container.

Break(Nullable<TimeSpan>, RequestConditions, CancellationToken)

The Break(Nullable<TimeSpan>, RequestConditions, CancellationToken) operation breaks the path or file system's previously-acquired lease (if it exists).

Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID. When a lease is broken, the lease break breakPeriod is allowed to elapse, during which time no lease operation except Break(Nullable<TimeSpan>, RequestConditions, CancellationToken) and Release(RequestConditions, CancellationToken) can be performed on the path or file system. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired.

A lease that has been broken can also be released. A client can immediately acquire a path or file system lease that has been released.

For more information, see Lease Container.

BreakAsync(Nullable<TimeSpan>, RequestConditions, CancellationToken)

The BreakAsync(Nullable<TimeSpan>, RequestConditions, CancellationToken) operation breaks the path or file system's previously-acquired lease (if it exists).

Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID. When a lease is broken, the lease break breakPeriod is allowed to elapse, during which time no lease operation except BreakAsync(Nullable<TimeSpan>, RequestConditions, CancellationToken) and ReleaseAsync(RequestConditions, CancellationToken) can be performed on the path or file system. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired.

A lease that has been broken can also be released. A client can immediately acquire a path or file system lease that has been released.

For more information, see Lease Container.

Change(String, RequestConditions, CancellationToken)

The Change(String, RequestConditions, CancellationToken) operation changes the lease of an active lease. A change must include the current LeaseId and a new proposedId.

For more information, see Lease Container.

ChangeAsync(String, RequestConditions, CancellationToken)

The ChangeAsync(String, RequestConditions, CancellationToken) operation changes the lease of an active lease. A change must include the current LeaseId and a new proposedId.

For more information, see Lease Container.

Release(RequestConditions, CancellationToken)

The Release(RequestConditions, CancellationToken) operation releases the file system or path's previously-acquired lease.

The lease may be released if the LeaseId matches that associated with the file system or path. Releasing the lease allows another client to immediately acquire the lease for the file system or path as soon as the release is complete.

For more information, see Lease Container.

ReleaseAsync(RequestConditions, CancellationToken)

The ReleaseAsync(RequestConditions, CancellationToken) operation releases the file system or path's previously-acquired lease.

The lease may be released if the LeaseId matches that associated with the file system or path. Releasing the lease allows another client to immediately acquire the lease for the file system or path as soon as the release is complete.

For more information, see Lease Container.

Renew(RequestConditions, CancellationToken)

The Renew(RequestConditions, CancellationToken) operation renews the path or file system's previously-acquired lease.

The lease can be renewed if the leaseId matches that associated with the path or file system. Note that the lease may be renewed even if it has expired as long as the path or file system has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets.

For more information, see Lease Container.

RenewAsync(RequestConditions, CancellationToken)

The RenewAsync(RequestConditions, CancellationToken) operation renews the path or file system's previously-acquired lease.

The lease can be renewed if the leaseId matches that associated with the path or file system. Note that the lease may be renewed even if it has expired as long as the path or file system has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets.

For more information, see Lease Container.

Applies to