job

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FakeActiveSideDirectMethodInvocationClientIdentity added in v0.7.4

func FakeActiveSideDirectMethodInvocationClientIdentity(jobId endpoint.JobID) string

The active side of a replication uses one end (sender or receiver) directly by method invocation, without going through a transport that provides a client identity. However, in order to avoid the need to distinguish between direct-method-invocating clients and RPC client, we use an invalid client identity as a sentinel value.

Types

type ActiveSide

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

func (*ActiveSide) Name

func (j *ActiveSide) Name() string

func (*ActiveSide) OwnedDatasetSubtreeRoot

func (j *ActiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)

func (*ActiveSide) RegisterMetrics

func (j *ActiveSide) RegisterMetrics(registerer prometheus.Registerer)

func (*ActiveSide) Run

func (j *ActiveSide) Run(ctx context.Context, cron *cron.Cron)

func (*ActiveSide) Running added in v0.8.1

func (j *ActiveSide) Running() (d time.Duration, ok bool)

func (*ActiveSide) SenderConfig added in v0.7.4

func (j *ActiveSide) SenderConfig() *endpoint.SenderConfig

func (*ActiveSide) Shutdown added in v0.7.10

func (j *ActiveSide) Shutdown()

func (*ActiveSide) Status

func (j *ActiveSide) Status() *Status

type ActiveSideState

type ActiveSideState int
const (
	ActiveSideReplicating ActiveSideState = 1 << iota
	ActiveSidePruneSender
	ActiveSidePruneReceiver
	ActiveSideDone // also errors
)

func ActiveSideStateString

func ActiveSideStateString(s string) (ActiveSideState, error)

ActiveSideStateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ActiveSideStateValues

func ActiveSideStateValues() []ActiveSideState

ActiveSideStateValues returns all values of the enum

func (ActiveSideState) IsAActiveSideState

func (i ActiveSideState) IsAActiveSideState() bool

IsAActiveSideState returns "true" if the value is listed in the enum definition. "false" otherwise

func (ActiveSideState) String

func (i ActiveSideState) String() string

type ActiveSideStatus

type ActiveSideStatus struct {
	CronSpec   string
	SleepUntil time.Time
	StartedAt  time.Time

	Replication                    *report.Report
	PruningSender, PruningReceiver *pruner.Report
	Snapshotting                   *snapper.Report
	// contains filtered or unexported fields
}

func (*ActiveSideStatus) Cron added in v0.8.0

func (self *ActiveSideStatus) Cron() string

func (*ActiveSideStatus) Error added in v0.7.4

func (self *ActiveSideStatus) Error() string

func (*ActiveSideStatus) Progress added in v0.8.1

func (self *ActiveSideStatus) Progress() (expected, completed uint64)

func (*ActiveSideStatus) Running added in v0.7.4

func (self *ActiveSideStatus) Running() (d time.Duration, ok bool)

func (*ActiveSideStatus) SleepingUntil added in v0.8.0

func (self *ActiveSideStatus) SleepingUntil() time.Time

func (*ActiveSideStatus) Steps added in v0.8.1

func (self *ActiveSideStatus) Steps() (expected, step int)

type Internal added in v0.8.3

type Internal interface {
	Name() string
	Run(ctx context.Context, cron *cron.Cron)
	RegisterMetrics(registerer prometheus.Registerer)
	Shutdown()
}

type Job

type Job interface {
	Internal

	Status() *Status
	// Jobs that return a subtree of the dataset hierarchy
	// must return the root of that subtree as rfs and ok = true
	OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)
	SenderConfig() *endpoint.SenderConfig
}

func JobsFromConfig

func JobsFromConfig(c *config.Config, parseFlags config.ParseFlags) ([]Job, error)

type JobStatus added in v0.8.0

type JobStatus interface {
	Error() string
	Running() (time.Duration, bool)
	Cron() string
	SleepingUntil() time.Time
	Steps() (expected, step int)
	Progress() (expected, completed uint64)
}

type Logger

type Logger = logger.Logger

func GetLogger

func GetLogger(ctx context.Context) Logger

type PassiveSide

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

func (*PassiveSide) Name

func (j *PassiveSide) Name() string

func (*PassiveSide) OwnedDatasetSubtreeRoot

func (j *PassiveSide) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)

func (*PassiveSide) RegisterMetrics

func (*PassiveSide) RegisterMetrics(registerer prometheus.Registerer)

func (*PassiveSide) Run

func (j *PassiveSide) Run(ctx context.Context, cron *cron.Cron)

func (*PassiveSide) SenderConfig added in v0.7.4

func (j *PassiveSide) SenderConfig() *endpoint.SenderConfig

func (*PassiveSide) Shutdown added in v0.7.10

func (j *PassiveSide) Shutdown()

func (*PassiveSide) Status

func (s *PassiveSide) Status() *Status

type PassiveStatus

type PassiveStatus struct {
	Snapper *snapper.Report
}

func (*PassiveStatus) Cron added in v0.8.0

func (self *PassiveStatus) Cron() string

func (*PassiveStatus) Error added in v0.7.4

func (self *PassiveStatus) Error() string

func (*PassiveStatus) Progress added in v0.8.1

func (self *PassiveStatus) Progress() (uint64, uint64)

func (*PassiveStatus) Running added in v0.7.4

func (self *PassiveStatus) Running() (time.Duration, bool)

func (*PassiveStatus) SleepingUntil added in v0.8.0

func (self *PassiveStatus) SleepingUntil() time.Time

func (*PassiveStatus) Steps added in v0.8.1

func (self *PassiveStatus) Steps() (expected, step int)

type ReceivingJobConfig added in v0.7.4

type ReceivingJobConfig interface {
	GetRootFS() string
	GetAppendClientIdentity() bool
	GetRecvOptions() *config.RecvOptions
}

type SendingJobConfig added in v0.7.4

type SendingJobConfig interface {
	GetFilesystems() config.FilesystemsFilter
	GetSendOptions() *config.SendOptions // must not be nil
}

type SnapJob

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

func (*SnapJob) Name

func (j *SnapJob) Name() string

func (*SnapJob) OwnedDatasetSubtreeRoot

func (j *SnapJob) OwnedDatasetSubtreeRoot() (rfs *zfs.DatasetPath, ok bool)

func (*SnapJob) RegisterMetrics

func (j *SnapJob) RegisterMetrics(registerer prometheus.Registerer)

func (*SnapJob) Run

func (j *SnapJob) Run(ctx context.Context, cron *cron.Cron)

func (*SnapJob) SenderConfig added in v0.7.4

func (j *SnapJob) SenderConfig() *endpoint.SenderConfig

func (*SnapJob) Shutdown added in v0.7.10

func (j *SnapJob) Shutdown()

func (*SnapJob) Status

func (j *SnapJob) Status() *Status

func (*SnapJob) Type

func (j *SnapJob) Type() Type

type SnapJobStatus

type SnapJobStatus struct {
	Pruning      *pruner.Report
	Snapshotting *snapper.Report // may be nil
}

func (*SnapJobStatus) Cron added in v0.8.0

func (self *SnapJobStatus) Cron() string

func (*SnapJobStatus) Error added in v0.7.4

func (self *SnapJobStatus) Error() string

func (*SnapJobStatus) Progress added in v0.8.1

func (self *SnapJobStatus) Progress() (uint64, uint64)

func (*SnapJobStatus) Running added in v0.7.4

func (self *SnapJobStatus) Running() (d time.Duration, ok bool)

func (*SnapJobStatus) SleepingUntil added in v0.8.0

func (self *SnapJobStatus) SleepingUntil() time.Time

func (*SnapJobStatus) Steps added in v0.8.1

func (self *SnapJobStatus) Steps() (expected, step int)

type Status

type Status struct {
	Type        Type
	JobSpecific JobStatus
}

func (*Status) CanSignal added in v0.8.0

func (s *Status) CanSignal() string

func (*Status) Cron added in v0.8.0

func (s *Status) Cron() string

func (*Status) Error added in v0.7.4

func (s *Status) Error() string

func (*Status) Internal added in v0.8.0

func (s *Status) Internal() bool

func (*Status) MarshalJSON

func (s *Status) MarshalJSON() ([]byte, error)

func (*Status) Progress added in v0.8.1

func (s *Status) Progress() (uint64, uint64)

func (*Status) Running added in v0.7.4

func (s *Status) Running() (time.Duration, bool)

func (*Status) SleepingUntil added in v0.8.0

func (s *Status) SleepingUntil() time.Time

func (*Status) Steps added in v0.8.1

func (s *Status) Steps() (expected, step int)

func (*Status) UnmarshalJSON

func (s *Status) UnmarshalJSON(in []byte) (err error)

type Type

type Type string
const (
	TypeInternal Type = "internal"
	TypeSnap     Type = "snap"
	TypePush     Type = "push"
	TypeSink     Type = "sink"
	TypePull     Type = "pull"
	TypeSource   Type = "source"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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