placement

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: AGPL-3.0 Imports: 16 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"`
	Nodes    Nodes    `cmd:"" help:"load the upload cache and print out statistics"`
	List     List     `cmd:"" help:"list nodes available for selection"`
	Simulate Simulate `cmd:"" help:"selection simulation with histogram"`
}

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"`
}

func (Select) Run

func (s Select) Run() 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

Jump to

Keyboard shortcuts

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