rangedloop

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Error = errs.Class("rs")

Functions

func Run

func Run(satelliteConn *pgx.Conn, loop RangedLoop) error

Types

type Bucket

type Bucket struct {
	ID   []byte
	Name []byte
}

type Checker added in v1.10.0

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

func NewChecker added in v1.10.0

func NewChecker(allNodes []nodeselection.SelectedNode, threshold int) *Checker

func (*Checker) Finish added in v1.10.0

func (c *Checker) Finish(ctx context.Context) error

func (*Checker) Fork added in v1.10.0

func (c *Checker) Fork(ctx context.Context) (rangedloop.Partial, error)

func (*Checker) Join added in v1.10.0

func (c *Checker) Join(ctx context.Context, partial rangedloop.Partial) error

func (*Checker) Start added in v1.10.0

func (c *Checker) Start(ctx context.Context, time time.Time) error

type CheckerFork added in v1.10.0

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

func (*CheckerFork) Process added in v1.10.0

func (c *CheckerFork) Process(ctx context.Context, segments []rangedloop.Segment) error

type CheckerLoop added in v1.14.0

type CheckerLoop struct {
	WithRangedLoop
	CheckerThreshold *int `help:"set a normalized health threshold to do a durability check"`
}

func (CheckerLoop) Run added in v1.14.0

func (c CheckerLoop) Run() error

type Count

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

func NewCount

func NewCount() *Count

func (*Count) Finish

func (c *Count) Finish(ctx context.Context) error

func (*Count) Fork

func (c *Count) Fork(ctx context.Context) (rangedloop.Partial, error)

func (*Count) Join

func (c *Count) Join(ctx context.Context, partial rangedloop.Partial) error

func (*Count) Process

func (c *Count) Process(ctx context.Context, segments []rangedloop.Segment) error

func (*Count) Start

func (c *Count) Start(ctx context.Context, time time.Time) error

func (*Count) Stats

func (c *Count) Stats(cb func(key monkit.SeriesKey, field string, val float64))

type DurabilityLoop added in v1.14.0

type DurabilityLoop struct {
	WithRangedLoop
}

func (DurabilityLoop) Run added in v1.14.0

func (d DurabilityLoop) Run() error

type FindSegment added in v1.18.0

type FindSegment struct {
	WithRangedLoop
	SegmentID uuid.UUID `arg:"" help:"set a SegmentID to find and export segments"`
}

func (*FindSegment) Finish added in v1.18.0

func (c *FindSegment) Finish(ctx context.Context) error

func (*FindSegment) Fork added in v1.18.0

func (*FindSegment) Join added in v1.18.0

func (c *FindSegment) Join(ctx context.Context, partial rangedloop.Partial) error

func (*FindSegment) Run added in v1.18.0

func (c *FindSegment) Run() error

func (*FindSegment) Start added in v1.18.0

func (c *FindSegment) Start(ctx context.Context, time time.Time) error

type FindSegmentPartial added in v1.18.0

type FindSegmentPartial struct {
	StreamID uuid.UUID
}

func (*FindSegmentPartial) Process added in v1.18.0

func (s *FindSegmentPartial) Process(ctx context.Context, segments []rangedloop.Segment) error

type FullScan

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

func NewFullScan

func NewFullScan(db *metabase.DB, scanType string) *FullScan

func (*FullScan) CreateRanges

func (f *FullScan) CreateRanges(_ context.Context, nRanges int, batchSize int) ([]rangedloop.SegmentProvider, error)

type FullSelectedNode

type FullSelectedNode struct {
	nodeselection.SelectedNode
	Email  string
	Wallet string
}

func GetParticipatingNodes

func GetParticipatingNodes(ctx context.Context, db tagsql.DB) (records []*FullSelectedNode, err error)

GetParticipatingNodes returns all known participating nodes (this includes all known nodes excluding nodes that have been disqualified or gracefully exited).

type Node

type Node struct {
	NodeID    storj.NodeID
	Address   string
	Email     string
	Country   location.CountryCode
	LastNet   string
	UpdatedAt time.Time
}

type NodeSpace added in v1.14.0

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

func NewNodeSpace added in v1.14.0

func NewNodeSpace(placement storj.PlacementConstraint, expiration time.Time) *NodeSpace

func (*NodeSpace) Finish added in v1.14.0

func (p *NodeSpace) Finish(ctx context.Context) error

func (*NodeSpace) Fork added in v1.14.0

func (p *NodeSpace) Fork(ctx context.Context) (rangedloop.Partial, error)

func (*NodeSpace) Join added in v1.14.0

func (p *NodeSpace) Join(ctx context.Context, partial rangedloop.Partial) error

func (*NodeSpace) Start added in v1.14.0

func (p *NodeSpace) Start(ctx context.Context, time time.Time) (err error)

type NodeSpaceFork added in v1.14.0

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

func (*NodeSpaceFork) Close added in v1.14.0

func (p *NodeSpaceFork) Close() error

func (*NodeSpaceFork) Process added in v1.14.0

func (p *NodeSpaceFork) Process(ctx context.Context, segments []rangedloop.Segment) error

type Object

type Object struct {
	StreamID     []byte
	PieceAliases []byte
	ObjectKey    []byte
}

type PieceList added in v1.4.0

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

func NewPieceList added in v1.4.0

func NewPieceList(nodeIDs []storj.NodeID) *PieceList

func (*PieceList) Finish added in v1.4.0

func (p *PieceList) Finish(ctx context.Context) error

func (*PieceList) Fork added in v1.4.0

func (p *PieceList) Fork(ctx context.Context) (rangedloop.Partial, error)

func (*PieceList) Join added in v1.4.0

func (p *PieceList) Join(ctx context.Context, partial rangedloop.Partial) error

func (*PieceList) Start added in v1.4.0

func (p *PieceList) Start(ctx context.Context, time time.Time) (err error)

type PieceListFork added in v1.4.0

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

func (*PieceListFork) Close added in v1.9.0

func (p *PieceListFork) Close() error

func (*PieceListFork) Process added in v1.4.0

func (p *PieceListFork) Process(ctx context.Context, segments []rangedloop.Segment) error

type PieceListLoop added in v1.14.0

type PieceListLoop struct {
	WithRangedLoop
	NodeID string `help:"set a NodeID to generate a piece list report"`
}

func (PieceListLoop) Run added in v1.14.0

func (p PieceListLoop) Run() error

type Project

type Project struct {
	ID   []byte
	Name string
}

type RangedLoop

type RangedLoop struct {
	UsedSpace   UsedSpaceLoop `cmd:"" help:"calculate used space for a given placement constraint and expiration time"`
	Checker     CheckerLoop   `cmd:"" help:"check segment health and list segments below a given normalized health threshold"`
	PieceList   PieceListLoop `cmd:"" help:"generate a piece list report for a given NodeID or a file containing a list of NodeIDs"`
	FindSegment FindSegment   `cmd:"" help:"find and export segments for a given SegmentID"`
}

type SQLProvider

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

func (*SQLProvider) Iterate

func (s *SQLProvider) Iterate(ctx context.Context, fn func([]rangedloop.Segment) error) error

func (*SQLProvider) Range

func (s *SQLProvider) Range() rangedloop.UUIDRange

type Segment

type Segment struct {
	StreamID  []byte
	NodeAlias []byte
	Position  int
	Placement int
}

type UsedSpace added in v1.14.0

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

func NewUsedSpace added in v1.14.0

func NewUsedSpace(placement storj.PlacementConstraint, expiration time.Time) *UsedSpace

func (*UsedSpace) Finish added in v1.14.0

func (p *UsedSpace) Finish(ctx context.Context) error

func (*UsedSpace) Fork added in v1.14.0

func (p *UsedSpace) Fork(ctx context.Context) (rangedloop.Partial, error)

func (*UsedSpace) Join added in v1.14.0

func (p *UsedSpace) Join(ctx context.Context, partial rangedloop.Partial) error

func (*UsedSpace) Start added in v1.14.0

func (p *UsedSpace) Start(ctx context.Context, time time.Time) (err error)

type UsedSpaceFork added in v1.14.0

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

func (*UsedSpaceFork) Close added in v1.14.0

func (p *UsedSpaceFork) Close() error

func (*UsedSpaceFork) Process added in v1.14.0

func (p *UsedSpaceFork) Process(ctx context.Context, segments []rangedloop.Segment) error

type UsedSpaceLoop added in v1.14.0

type UsedSpaceLoop struct {
	WithRangedLoop
	Placement  *storj.PlacementConstraint `help:"set a placement constraint to calculate used space for"`
	Expiration time.Time                  `help:"set an expiration time to limit the scan to segments expiring before this time, format: 2006-01-02T15:04:05Z07:00"`
}

func (UsedSpaceLoop) Run added in v1.14.0

func (u UsedSpaceLoop) Run() error

type WithRangedLoop added in v1.14.0

type WithRangedLoop struct {
	db.WithDatabase
	ScanType  string `default:"full"`
	ScanParam int

	Parallelism int `default:"1"`

	BackupBucket string `required:"true"`
	BackupDay    string `required:"true"`
}

func (WithRangedLoop) RunLoop added in v1.14.0

func (r WithRangedLoop) RunLoop(fn func(observers []rangedloop.Observer) []rangedloop.Observer) error

Jump to

Keyboard shortcuts

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