placement

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitShift added in v1.5.0

type BitShift struct {
	// contains filtered or unexported fields
}

func (*BitShift) Bump added in v1.5.0

func (b *BitShift) Bump()

func (*BitShift) Debug added in v1.5.0

func (b *BitShift) Debug()

func (*BitShift) Increment added in v1.5.0

func (b *BitShift) Increment(nodes []*nodeselection.SelectedNode, success int)

func (*BitShift) InitScoreNode added in v1.5.0

func (b *BitShift) InitScoreNode() nodeselection.ScoreNode

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 Fair added in v1.5.0

type Fair struct {
	// contains filtered or unexported fields
}

func (*Fair) Bump added in v1.5.0

func (f *Fair) Bump()

func (*Fair) Debug added in v1.5.0

func (f *Fair) Debug()

func (*Fair) Increment added in v1.5.0

func (f *Fair) Increment(nodes []*nodeselection.SelectedNode, success int)

func (*Fair) InitScoreNode added in v1.5.0

func (f *Fair) InitScoreNode() nodeselection.ScoreNode

type FairTracker added in v1.5.0

type FairTracker struct {
	// contains filtered or unexported fields
}

func NewFairTracker added in v1.5.0

func NewFairTracker() *FairTracker

func (*FairTracker) BumpGeneration added in v1.5.0

func (f *FairTracker) BumpGeneration()

func (*FairTracker) Get added in v1.5.0

func (f *FairTracker) Get(uplink storj.NodeID) func(node *nodeselection.SelectedNode) float64

func (*FairTracker) Update added in v1.5.0

func (f *FairTracker) Update(node *nodeselection.SelectedNode)

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 `usage:"node attributes to print out"`
	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 NodeList added in v1.5.0

type NodeList struct {
	Nodes []*nodeselection.SelectedNode
}

func (NodeList) SelectAllStorageNodesUpload added in v1.5.0

func (n NodeList) SelectAllStorageNodesUpload(ctx context.Context, selectionCfg overlay.NodeSelectionConfig) (reputable, new []*nodeselection.SelectedNode, err error)

type Nodes

type Nodes struct {
	WithPlacement
	Selector []string
	Filter   string

	Placement          int
	OnlineWindow       time.Duration `default:"4h"`
	MinimumDiskSpace   memory.Size   `default:"500GB"`
	IgnoreUploadFilter bool
}

func (Nodes) Run

func (s Nodes) Run() error

type Noop added in v1.5.0

type Noop struct {
}

func (*Noop) Bump added in v1.5.0

func (n *Noop) Bump()

func (*Noop) Debug added in v1.5.0

func (n *Noop) Debug()

func (*Noop) Increment added in v1.5.0

func (n *Noop) Increment(nodes []*nodeselection.SelectedNode, success int)

func (*Noop) InitScoreNode added in v1.5.0

func (n *Noop) InitScoreNode() nodeselection.ScoreNode

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 {
	WithPlacement
	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 {
	WithPlacement
	Placement storj.PlacementConstraint
	Selector  string
	CSV       bool
	Tracker   string `default:"noop"`
	Rps       int    `default:"400"`
	K         int    `default:"1000000"`
	FakeNodes int    `default:"0" usage:"Number of fake nodes to use instead of db"`
}

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 `usage:"node tags to check the value" default:""`
	CategoryTag string   `usage:"node tags to categorize nodes" default:"tag:server_group"`
	Filter      string   `usage:"additional display only node filter" default:""`
	All         bool
}

func (Tags) Run added in v1.3.0

func (s Tags) Run() error

type TrackerWrap added in v1.5.0

type TrackerWrap interface {
	Increment(nodes []*nodeselection.SelectedNode, success int)
	Bump()
	InitScoreNode() nodeselection.ScoreNode
	Debug()
}

type WithPlacement added in v1.5.0

type WithPlacement struct {
	PlacementConfig string `usage:"location of the placement file"`
}

func (WithPlacement) GetPlacement added in v1.5.0

Jump to

Keyboard shortcuts

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