placement

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket added in v1.1.0

type Bucket struct {
	SegmentCount   int
	ClassExemplars []string
}

Bucket stores the number of segments (and some exemplars) for each piece count.

func (*Bucket) Increment added in v1.1.0

func (b *Bucket) Increment(classExemplar string)

Increment increments the bucket counters.

func (*Bucket) Reset added in v1.1.0

func (b *Bucket) Reset()

Reset resets the bucket counters.

type Histogram added in v1.1.0

type Histogram struct {
	// pieceCount -> {number of segments, exemplars}
	Buckets []*Bucket
	// pieceCount * -1 -> {number of segments, exemplars}
	NegativeBuckets []*Bucket
}

func (*Histogram) AddPieceCount added in v1.1.0

func (h *Histogram) AddPieceCount(pieceCount int, classExemplar string)

AddPieceCount adds a piece count to the histogram.

func (*Histogram) Reset added in v1.1.0

func (h *Histogram) Reset()

Reset resets the histogram counters.

type List

type List struct {
	PlacementConfig string   `usage:"location of the placement file"`
	Placement       int      `usage:"placement to use"`
	Attributes      []string `` /* 133-byte string literal not displayed */
	Filter          string   `usage:"additional display only node filter"`
}

func (List) Run

func (s List) Run() error

type NamedNodeAttribute added in v1.1.0

type NamedNodeAttribute struct {
	Name      string
	Attribute nodeselection.NodeAttribute
}

type Nodes

type Nodes struct {
	Selector         []string
	Filter           string
	PlacementConfig  string
	Placement        int
	OnlineWindow     time.Duration `default:"4h"`
	MinimumDiskSpace memory.Size   `default:"500GB"`
}

func (Nodes) Run

func (s Nodes) Run() error

type Placement

type Placement struct {
	Select     Select     `cmd:"" help:"select given number of nodes from DB, matching the placement rule"`
	SelectPool SelectPool `cmd:"" help:"select given number of nodes from DB, printing simplified pool stat"`
	Nodes      Nodes      `cmd:"" help:"load the upload cache and print out statistics"`
	List       List       `cmd:"" help:"list nodes available for selection"`
	Tags       Tags       `cmd:"" help:"report current tag distribution"`
	QueryTags  QueryTags  `cmd:"" help:"generate query for tags"`
	Simulate   Simulate   `cmd:"" help:"selection simulation with histogram"`
	Score      Score      `cmd:"" help:"print out node scores"`
}

type QueryTags added in v1.3.0

type QueryTags struct {
}

func (QueryTags) Run added in v1.3.0

func (q QueryTags) Run() error

type Score added in v1.3.0

type Score struct {
	Placement storj.PlacementConstraint
	Filter    string `default:"tag(\"1111111111111111111111111111111VyS547o\",\"soc2\",\"true\")"`
	Score     string `default:"node_value(\"free_disk\")"`
}

func (*Score) Run added in v1.3.0

func (n *Score) Run() (err error)

type Select

type Select struct {
	PlacementConfig string
	Placement       int
	NodeNo          int    `default:"110"`
	Selector        string `default:"wallet"`
	Number          int    `default:"1"`
	Durability      string `usage:"node attribute to calculate the durability risk for"`
	Invariant       bool   `usage:"Check invariant for all selections"`
}

func (Select) Run

func (s Select) Run() error

type SelectPool added in v1.3.0

type SelectPool struct {
	PlacementConfig string
	Placement       storj.PlacementConstraint
	Selector        string
}

func (*SelectPool) Run added in v1.3.0

func (n *SelectPool) Run() (err error)

type Simulate

type Simulate struct {
	Selector string
	Filter   string
	NodeNo   int `default:"110"`
	Number   int `default:"1"`
}

func (Simulate) Run

func (s Simulate) Run() error

type Tags added in v1.3.0

type Tags struct {
	ValueTags   []string `` /* 141-byte string literal not displayed */
	CategoryTag string   `usage:"node tags to categorize nodes" default:"tag:server_group"`
	Filter      string   `` /* 146-byte string literal not displayed */
}

func (Tags) Run added in v1.3.0

func (s Tags) Run() error

Jump to

Keyboard shortcuts

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