Documentation ¶
Index ¶
- type Backend
- func (d *Backend) AcquireLock(ctx context.Context, contents *core.LockState) error
- func (d *Backend) PrepareBackend(ctx context.Context, lockId string) error
- func (d *Backend) RefreshDuration() time.Duration
- func (d *Backend) ReleaseLock(ctx context.Context, leaseId string) error
- func (d *Backend) RenewLock(ctx context.Context, leaseId string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend stores locks in the Databricks workspace. All locks are stored in a fixed directory, and each lock is stored in a file named after the lock ID. The workspace client is shared by all locks.
func (*Backend) AcquireLock ¶
Check if the lock file exists, and if it does, check if the lease is still valid. If it doesn't exist, create it. If it is valid, return an error. If it is not valid, delete the lock file and create a new one.
func (*Backend) PrepareBackend ¶
Configure the backend by setting the workspace client and lock file.
func (*Backend) RefreshDuration ¶
func (*Backend) ReleaseLock ¶
func (*Backend) RenewLock ¶
Check if the lock file exists, and if it does, check if the lease is still valid. If it doesn't exist or is invalid, fail (the lock should be kept valid the entire time it is in use). If it is valid and held by a different lease, return an error. Otherwise, extend the lease.