params

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidProportion = fmt.Errorf("%w: total proportion isn't 1.0", config.ErrBadConfiguration)

Functions

This section is empty.

Types

type Eviction

type Eviction interface {
	// Touch indicates the eviction that the file has been used now
	Touch(path RelativePath)

	// Store orders the eviction to Store the path.
	// returns true iff the eviction accepted the path.
	Store(path RelativePath, filesize int64) bool
}

Eviction abstracts eviction control.

type ExtParams

type ExtParams struct {
	SharedParams

	// RangeAllocationProportion is the proportion allocated to range TierFS instance.
	// The rest of the allocation is to be used by the meta-range TierFS instance.
	// TODO(itai): make this configurable for more than 2 TierFS instances.
	RangeAllocationProportion     float64
	MetaRangeAllocationProportion float64
}

func NewCommittedTierFSParams added in v0.107.1

func NewCommittedTierFSParams(c *config.Config, adapter block.Adapter) (*ExtParams, error)

NewCommittedTierFSParams returns parameters for building a tierFS. Caller must separately build and populate Adapter.

func (ExtParams) WithLogger

func (p ExtParams) WithLogger(logger logging.Logger) ExtParams

type InstanceParams

type InstanceParams struct {
	SharedParams

	// FSName is the unique filesystem name for this TierFS instance.
	// If two TierFS instances have the same name, behaviour is undefined.
	FSName string

	// DiskAllocProportion is the proportion of the SharedParams.LocalDiskParams.TotalAllocatedBytes the TierFS instance
	// is allowed to use. Each instance treats the multiplication of the two as its cap.
	DiskAllocProportion float64
}

func (InstanceParams) AllocatedBytes

func (ip InstanceParams) AllocatedBytes() int64

AllocatedBytes returns the maximum bytes an instance of TierFS is allowed to use.

type LocalDiskParams

type LocalDiskParams struct {
	// TotalAllocatedBytes is the maximum number of bytes an instance of TierFS can
	// allocate to local files.  It is not a hard limit - there may be short period of
	// times where TierFS uses more disk due to ongoing writes and slow disk cleanups.
	TotalAllocatedBytes int64

	// BaseDir names a directory for TierFS to store local copies of files.
	BaseDir string
}

LocalDiskParams is pyramid.FS params that are identical for all file-systems in a single lakeFS instance.

type RelativePath

type RelativePath string

RelativePath is the path of the file under TierFS, used in the Eviction interface.

type SharedParams

type SharedParams struct {
	// Logger receives all logs for this FS.
	Logger logging.Logger

	// Local holds all local configuration.
	Local LocalDiskParams

	// Adapter is used to write to underlying storage.
	Adapter block.Adapter

	// BlockStoragePrefix is the prefix prepended to lakeFS metadata files in
	// the blockstore.
	BlockStoragePrefix string

	// Eviction is the cache to use to evict objects from local storage.  Only
	// configurable in testing.
	Eviction Eviction

	// PebbleSSTableCacheSizeBytes is the size (in bytes) of the cache used by the Pebble
	// SSTable library.  This cache is shared between all readers active on the system.
	PebbleSSTableCacheSizeBytes int64
}

Jump to

Keyboard shortcuts

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