segment

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: AGPL-3.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintBusFactor

func PrintBusFactor(nodes []*nodeselection.SelectedNode, selector nodeselection.NodeAttribute, threshold int)

func ReadSegmentFile added in v1.19.0

func ReadSegmentFile(path string) (metabase.Segment, error)

ReadSegmentFile reads and unmarshals a SegmentFile from the given path.

Types

type AliasPiece added in v1.19.0

type AliasPiece struct {
	Number int `yaml:"number"`
	Alias  int `yaml:"alias"`
}

type Availability

type Availability struct {
	StreamID string `arg:""`
	util.DialerHelper
	Keys string `required:""`
}

Availability reports the status / availability of one single segment.

func (*Availability) Run

func (s *Availability) Run() error

type Checksum added in v1.10.0

type Checksum struct {
	db.WithDatabase
	StreamID  string `arg:""`
	PieceInfo bool   `help:"Print additional information (with using db / segment list) "`
}

func (*Checksum) Run added in v1.10.0

func (s *Checksum) Run() error

type Classify

type Classify struct {
	db.WithDatabase
	placement.WithPlacement
	StreamID       string `arg:""`
	PlacementCheck bool   `help:"Check placement rules" default:"true"`
}

func (*Classify) Run

func (s *Classify) Run() error

type Decrypt added in v1.10.0

type Decrypt struct {
	StreamID string `arg:""`
	Bucket   string
	Key      string
	db.WithDatabase
	ProjectID uuid.UUID
}

func (*Decrypt) Run added in v1.10.0

func (s *Decrypt) Run() error

type Download

type Download struct {
	util.DialerHelper
	db.WithDatabase
	StreamID       string `arg:""`
	Keys           string `required:""`
	NodeInfo       bool
	SegmentMetafil string `help:"Path to segment metafile to read segment info from instead of metabase"`
}

func (*Download) Run

func (s *Download) Run() error

type ECDecode

type ECDecode struct {
	StreamID    string `arg:""`
	Incremental bool   `help:"if true, segment will be decoded only if the file doesn't exist'"`
	Correct     bool
	K           int `help:"The k number of RS code, default is 29" default:"29"`
}

func (*ECDecode) Run

func (s *ECDecode) Run() error

type ECRepair added in v1.19.0

type ECRepair struct {
	StreamID string `arg:""`
	K        int    `help:"The k number of RS code, default is 29" default:"29"`
}

func (*ECRepair) Run added in v1.19.0

func (s *ECRepair) Run() error

type Histogram

type Histogram struct {
	db.WithDatabase
	Selector string
	StreamID string `arg:""`
}

func (Histogram) Run

func (h Histogram) Run() error

type Nodes

type Nodes struct {
	db.WithDatabase
	NodeIDs string `arg:""`
	Verbose bool   `default:"true"`
}

func (Nodes) Run

func (h Nodes) Run() error

type Piece added in v1.19.0

type Piece struct {
	Number      int          `yaml:"number"`
	StorageNode storj.NodeID `yaml:"storagenode"`
}

type PieceList

type PieceList struct {
	StreamID string `arg:""`
	util.DialerHelper
	Keys string
}

PieceList reports the status / availability of one single segment.

func (*PieceList) Run

func (s *PieceList) Run() error

type Redundancy added in v1.19.0

type Redundancy struct {
	Algorithm      int `yaml:"algorithm"`
	ShareSize      int `yaml:"sharesize"`
	RequiredShares int `yaml:"requiredshares"`
	RepairShares   int `yaml:"repairshares"`
	OptimalShares  int `yaml:"optimalshares"`
	TotalShares    int `yaml:"totalshares"`
}

type Report added in v1.2.0

type Report struct {
	db.WithDatabase
	File    string        `arg:""`
	NodeID  *storj.NodeID `help:"optional node ID to filter segments if they are not part of the segment today"`
	InPlace bool          `help:"rewrite the input with actualized data"`
}

func (*Report) Run added in v1.2.0

func (s *Report) Run() error

type Segment

type Segment struct {
	Histogram    Histogram    `cmd:"" help:"diversity histogram of a segment"`
	List         PieceList    `cmd:"" help:"list piece locations in a csv for one single segment"`
	Availability Availability `cmd:"" help:"test availability of the segment with calling exists endpoints"`
	Classify     Classify     `cmd:"" help:"execute piece classification on segment"`
	Download     Download     `cmd:"" help:"download all the available pieces ASAP"`
	Ecdecode     ECDecode     `cmd:"" help:"decode original segment from downloaded pieces"`
	Ecrepair     ECRepair     `cmd:"" help:"try to localize EC problems with ignoring different pieces"`
	Show         Show         `cmd:"" help:"show information about the segment"`
	Report       Report       `cmd:"" help:"show segments based on segment id list"`
	Nodes        Nodes        `cmd:"" help:"print details of nodes"`
	Checksum     Checksum     `cmd:"" help:"Check checksum of the downloaded segment"`
	Decrypt      Decrypt      `cmd:"" help:"Decrypt segment with the provided keys"`
	Smoketest    Smoketest    `cmd:"" help:"Download Hash of the pieces and check if they are zero"`
}

Segment contains command which uses direct database connection.

type SegmentFile added in v1.19.0

type SegmentFile struct {
	StreamID uuid.UUID `yaml:"streamid"`
	Position struct {
		Part  int `yaml:"part"`
		Index int `yaml:"index"`
	} `yaml:"position"`
	CreatedAt     time.Time     `yaml:"createdat"`
	ExpiresAt     *time.Time    `yaml:"expiresat"`
	RepairedAt    *time.Time    `yaml:"repairedat"`
	RootPieceID   storj.PieceID `yaml:"rootpieceid"`
	EncryptedSize int64         `yaml:"encryptedsize"`
	PlainOffset   int64         `yaml:"plainoffset"`
	PlainSize     int64         `yaml:"plainsize"`
	AliasPieces   []AliasPiece  `yaml:"aliaspieces"`
	Redundancy    Redundancy    `yaml:"redundancy"`
	Pieces        []Piece       `yaml:"pieces"`
	Placement     int           `yaml:"placement"`
	Source        string        `yaml:"source"`
}

func (*SegmentFile) ToMetabaseSegment added in v1.19.0

func (sf *SegmentFile) ToMetabaseSegment() metabase.Segment

ToMetabaseSegment converts a *SegmentFile to a metabase.Segment.

type Show

type Show struct {
	StreamID string `arg:""`
	db.WithDatabase
}

func (*Show) Run

func (s *Show) Run() error

type Smoketest added in v1.12.0

type Smoketest struct {
	db.WithDatabase
	util.DialerHelper
	WithStreamIDs

	Offset int
	Keys   string `required:"" help:"the satellite identity directory"`
}

func (*Smoketest) Run added in v1.12.0

func (s *Smoketest) Run() error

type WithStreamIDs added in v1.12.0

type WithStreamIDs struct {
	StreamID string `arg:""`
}

func (WithStreamIDs) ForEach added in v1.12.0

func (w WithStreamIDs) ForEach(callback func(streamID string) error) error

Jump to

Keyboard shortcuts

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