databricks

package
v0.40.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func (d *Backend) AcquireLock(ctx context.Context, contents *core.LockState) error

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

func (d *Backend) PrepareBackend(ctx context.Context, lockId string) error

Configure the backend by setting the workspace client and lock file.

func (*Backend) RefreshDuration

func (d *Backend) RefreshDuration() time.Duration

func (*Backend) ReleaseLock

func (d *Backend) ReleaseLock(ctx context.Context, leaseId string) error

func (*Backend) RenewLock

func (d *Backend) RenewLock(ctx context.Context, leaseId string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL