Documentation
¶
Index ¶
- func SelectWithReplicaset()
- func Unique(attr nodeselection.NodeAttribute) func([]*nodeselection.SelectedNode, *nodeselection.SelectedNode) bool
- type BitShift
- type Bucket
- type Download
- type DownloadPool
- type Fair
- type FairTracker
- type Histogram
- type List
- type NamedNodeAttribute
- type NodeList
- type Nodes
- type Noop
- type NoopFailureTracker
- type Placement
- type QueryTags
- type Replicaset
- type Replicasets
- type Score
- type Select
- type SelectPool
- type Simulate
- type Tags
- type TrackerWrap
- type WithPlacement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SelectWithReplicaset ¶ added in v1.6.0
func SelectWithReplicaset()
func Unique ¶ added in v1.6.0
func Unique(attr nodeselection.NodeAttribute) func([]*nodeselection.SelectedNode, *nodeselection.SelectedNode) bool
Types ¶
type BitShift ¶ added in v1.5.0
type BitShift struct {
// contains filtered or unexported fields
}
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
Bucket stores the number of segments (and some exemplars) for each piece count.
type Download ¶ added in v1.15.0
type DownloadPool ¶ added in v1.15.0
type DownloadPool struct {
util.DialerHelper
util.Loop
db.WithDatabase
WithPlacement
NodeURL storj.NodeURL
Bucket string `arg:""`
EncryptedKey string `arg:""`
DesiredNodes int `default:"39"`
Selector string `default:"tag:provider"`
Debug bool
Placement int
}
func (*DownloadPool) Run ¶ added in v1.15.0
func (n *DownloadPool) Run() (err error)
type Fair ¶ added in v1.5.0
type Fair struct {
// contains filtered or unexported fields
}
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
AddPieceCount adds a piece count to the histogram.
type List ¶
type List struct {
db.WithDatabase
WithPlacement
Placement int `help:"placement to use"`
Attributes []string `help:"node attributes to print out"`
Filter string `help:"additional display only node filter"`
}
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 Noop ¶ added in v1.5.0
type Noop struct {
}
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 NoopFailureTracker ¶ added in v1.7.0
type NoopFailureTracker struct {
}
func (*NoopFailureTracker) Get ¶ added in v1.7.0
func (n *NoopFailureTracker) Get(node *nodeselection.SelectedNode) float64
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"`
Replicasets Replicasets `cmd:"" help:"experiments with replicasets"`
DownloadPool DownloadPool `cmd:"" help:"test download pool, with requesting downloads from satellite and classify received nodes"`
Download Download `cmd:"" help:"initiate a download request and print out the selected nodes (using satellite)"`
}
type QueryTags ¶ added in v1.3.0
type QueryTags struct {
Tags []string `help:"the tags to query for, separated by commas"`
SelfSignedTags []string `help:"the self signed tags to query for, separated by commas"`
QueryEnd string `help:"the query end, default is empty"`
Fields []string `help:"the node table fields to return (node_id is always added)" default:""`
}
type Replicaset ¶ added in v1.6.0
type Replicaset struct {
RequiredNodes int
Nodes []*nodeselection.SelectedNode
Invariant func([]*nodeselection.SelectedNode, *nodeselection.SelectedNode) bool
}
func InitReplicasets ¶ added in v1.6.0
func InitReplicasets(nodes []*nodeselection.SelectedNode, required int, invariant func([]*nodeselection.SelectedNode, *nodeselection.SelectedNode) bool) []*Replicaset
func (*Replicaset) IsFull ¶ added in v1.6.0
func (r *Replicaset) IsFull() bool
func (*Replicaset) Len ¶ added in v1.6.0
func (r *Replicaset) Len() int
func (*Replicaset) Offer ¶ added in v1.6.0
func (r *Replicaset) Offer(node *nodeselection.SelectedNode) bool
type Replicasets ¶ added in v1.6.0
type Replicasets struct {
db.WithDatabase
Attribute string `default:"tag:host"`
Filter string
}
func (Replicasets) Run ¶ added in v1.6.0
func (r Replicasets) Run() error
type Score ¶ added in v1.3.0
type Score struct {
db.WithDatabase
Filter string `default:""`
Score string `default:"node_value(\"free_disk\")"`
}
type Select ¶
type Select struct {
WithPlacement
db.WithDatabase
Placement int
NodeNo int `default:"110"`
Selector string `default:"wallet"`
Number int `default:"1"`
Durability string `help:"node attribute to calculate the durability risk for"`
Invariant bool `help:"Check invariant for all selections"`
}
type SelectPool ¶ added in v1.3.0
type SelectPool struct {
WithPlacement
db.WithDatabase
Placement storj.PlacementConstraint
Selector string
CSV bool
Tracker string `default:"noop"`
Rps int `default:"400"`
K int `default:"1000000"`
FakeNodes int `default:"0" help:"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 Tags ¶ added in v1.3.0
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 `help:"location of the placement file" yaml:"placement-config"`
}
func (WithPlacement) GetPlacement ¶ added in v1.5.0
func (w WithPlacement) GetPlacement(environment nodeselection.PlacementConfigEnvironment) (nodeselection.PlacementDefinitions, error)
Click to show internal directories.
Click to hide internal directories.