db

package
v0.0.0-...-2942e7d Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActualLRPDB

type ActualLRPDB interface {
	ActualLRPs(ctx context.Context, logger lager.Logger, filter models.ActualLRPFilter) ([]*models.ActualLRP, error)
	CreateUnclaimedActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey) (after *models.ActualLRP, err error)
	UnclaimActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey) (before *models.ActualLRP, after *models.ActualLRP, err error)
	ClaimActualLRP(ctx context.Context, logger lager.Logger, processGuid string, index int32, instanceKey *models.ActualLRPInstanceKey) (before *models.ActualLRP, after *models.ActualLRP, err error)
	StartActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, netInfo *models.ActualLRPNetInfo) (before *models.ActualLRP, after *models.ActualLRP, err error)
	CrashActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, crashReason string) (before *models.ActualLRP, after *models.ActualLRP, shouldRestart bool, err error)
	FailActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, placementError string) (before *models.ActualLRP, after *models.ActualLRP, err error)
	RemoveActualLRP(ctx context.Context, logger lager.Logger, processGuid string, index int32, instanceKey *models.ActualLRPInstanceKey) error

	ChangeActualLRPPresence(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, from, to models.ActualLRP_Presence) (before *models.ActualLRP, after *models.ActualLRP, err error)

	CountActualLRPsByState(ctx context.Context, logger lager.Logger) (int, int, int, int, int)
	CountDesiredInstances(ctx context.Context, logger lager.Logger) int
}

type CompleteTaskWork

type CompleteTaskWork func(logger lager.Logger, taskDB TaskDB, task *models.Task) func()

type ConvergenceResult

type ConvergenceResult struct {
	MissingLRPKeys               []*models.ActualLRPKeyWithSchedulingInfo
	UnstartedLRPKeys             []*models.ActualLRPKeyWithSchedulingInfo
	SuspectKeysWithExistingCells []*models.ActualLRPKey
	SuspectLRPKeysToRetire       []*models.ActualLRPKey
	SuspectRunningKeys           []*models.ActualLRPKey
	SuspectClaimedKeys           []*models.ActualLRPKey
	KeysToRetire                 []*models.ActualLRPKey
	KeysWithMissingCells         []*models.ActualLRPKeyWithSchedulingInfo
	MissingCellIds               []string
	Events                       []models.Event
	InstanceEvents               []models.Event
}

type DesiredLRPDB

type DesiredLRPDB interface {
	DesiredLRPs(ctx context.Context, logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRP, error)
	DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logger, processGuid string) (*models.DesiredLRP, error)

	DesiredLRPSchedulingInfos(ctx context.Context, logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRPSchedulingInfo, error)

	DesireLRP(ctx context.Context, logger lager.Logger, desiredLRP *models.DesiredLRP) error
	UpdateDesiredLRP(ctx context.Context, logger lager.Logger, processGuid string, update *models.DesiredLRPUpdate) (beforeDesiredLRP *models.DesiredLRP, err error)
	RemoveDesiredLRP(ctx context.Context, logger lager.Logger, processGuid string) error
}

type DomainDB

type DomainDB interface {
	FreshDomains(ctx context.Context, logger lager.Logger) ([]string, error)
	UpsertDomain(ctx context.Context, lgger lager.Logger, domain string, ttl uint32) error
}

type EncryptionDB

type EncryptionDB interface {
	EncryptionKeyLabel(ctx context.Context, logger lager.Logger) (string, error)
	SetEncryptionKeyLabel(ctx context.Context, logger lager.Logger, encryptionKeyLabel string) error
	PerformEncryption(ctx context.Context, logger lager.Logger) error
}

type EvacuationDB

type EvacuationDB interface {
	RemoveEvacuatingActualLRP(context.Context, lager.Logger, *models.ActualLRPKey, *models.ActualLRPInstanceKey) error
	EvacuateActualLRP(context.Context, lager.Logger, *models.ActualLRPKey, *models.ActualLRPInstanceKey, *models.ActualLRPNetInfo) (actualLRP *models.ActualLRP, err error)
}

type LRPDB

type LRPDB interface {
	ActualLRPDB
	DesiredLRPDB

	ConvergeLRPs(ctx context.Context, logger lager.Logger, cellSet models.CellSet) ConvergenceResult
}

type SuspectDB

type SuspectDB interface {
	RemoveSuspectActualLRP(context.Context, lager.Logger, *models.ActualLRPKey) (*models.ActualLRP, error)
}

type TaskConvergenceResult

type TaskConvergenceResult struct {
	TasksToAuction  []*auctioneer.TaskStartRequest
	TasksToComplete []*models.Task
	Events          []models.Event

	Metrics TaskMetrics
}

type TaskDB

type TaskDB interface {
	Tasks(ctx context.Context, logger lager.Logger, filter models.TaskFilter) ([]*models.Task, error)
	TaskByGuid(ctx context.Context, logger lager.Logger, taskGuid string) (*models.Task, error)

	DesireTask(ctx context.Context, logger lager.Logger, taskDefinition *models.TaskDefinition, taskGuid, domain string) (*models.Task, error)
	StartTask(ctx context.Context, logger lager.Logger, taskGuid, cellId string) (before *models.Task, after *models.Task, shouldStart bool, rr error)
	CancelTask(ctx context.Context, logger lager.Logger, taskGuid string) (before *models.Task, after *models.Task, cellID string, err error)
	FailTask(ctx context.Context, logger lager.Logger, taskGuid, failureReason string) (before *models.Task, after *models.Task, err error)
	RejectTask(ctx context.Context, logger lager.Logger, taskGuid, rejectionReason string) (before *models.Task, after *models.Task, err error)
	CompleteTask(ctx context.Context, logger lager.Logger, taskGuid, cellId string, failed bool, failureReason, result string) (before *models.Task, after *models.Task, err error)
	ResolvingTask(ctx context.Context, logger lager.Logger, taskGuid string) (before *models.Task, after *models.Task, err error)
	DeleteTask(ctx context.Context, logger lager.Logger, taskGuid string) (task *models.Task, err error)

	ConvergeTasks(ctx context.Context, logger lager.Logger, cellSet models.CellSet, kickTaskDuration, expirePendingTaskDuration, expireCompletedTaskDuration time.Duration) TaskConvergenceResult
}

type TaskMetrics

type TaskMetrics struct {
	TasksPending   int
	TasksRunning   int
	TasksCompleted int
	TasksResolving int
	TasksPruned    uint64
	TasksKicked    uint64
}

type VersionDB

type VersionDB interface {
	Version(ctx context.Context, logger lager.Logger) (*models.Version, error)
	SetVersion(ctx context.Context, logger lager.Logger, version *models.Version) error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.
fakesqldriver/fakesqldriverfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
helpers/helpersfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
helpers/monitor/monitorfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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