sqldb

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: 19 Imported by: 0

Documentation

Index

Constants

View Source
const EncryptionKeyID = "encryption_key_label"
View Source
const (
	Truncated = "(truncated)"
)
View Source
const VersionID = "version"

Variables

This section is empty.

Functions

This section is empty.

Types

type SQLDB

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

func NewSQLDB

func NewSQLDB(
	db helpers.QueryableDB,
	convergenceWorkersSize int,
	updateWorkersSize int,
	cryptor encryption.Cryptor,
	guidProvider guidprovider.GUIDProvider,
	clock clock.Clock,
	flavor string,
	metronClient loggingclient.IngressClient,
) *SQLDB

func (*SQLDB) ActualLRPs

func (db *SQLDB) ActualLRPs(ctx context.Context, logger lager.Logger, filter models.ActualLRPFilter) ([]*models.ActualLRP, error)

func (*SQLDB) CancelTask

func (db *SQLDB) CancelTask(ctx context.Context, logger lager.Logger, taskGuid string) (*models.Task, *models.Task, string, error)

func (*SQLDB) ChangeActualLRPPresence

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

func (*SQLDB) ClaimActualLRP

func (db *SQLDB) ClaimActualLRP(ctx context.Context, logger lager.Logger, processGuid string, index int32, instanceKey *models.ActualLRPInstanceKey) (*models.ActualLRP, *models.ActualLRP, error)

func (*SQLDB) CompleteTask

func (db *SQLDB) CompleteTask(ctx context.Context, logger lager.Logger, taskGuid, cellID string, failed bool, failureReason, taskResult string) (*models.Task, *models.Task, error)

func (*SQLDB) ConvergeLRPs

func (sqldb *SQLDB) ConvergeLRPs(ctx context.Context, logger lager.Logger, cellSet models.CellSet) db.ConvergenceResult

func (*SQLDB) ConvergeTasks

func (sqldb *SQLDB) ConvergeTasks(ctx context.Context, logger lager.Logger, cellSet models.CellSet, kickTasksDuration, expirePendingTaskDuration, expireCompletedTaskDuration time.Duration) db.TaskConvergenceResult

func (*SQLDB) CountActualLRPsByState

func (db *SQLDB) CountActualLRPsByState(ctx context.Context, logger lager.Logger) (claimedCount, unclaimedCount, runningCount, crashedCount, crashingDesiredCount int)

func (*SQLDB) CountDesiredInstances

func (db *SQLDB) CountDesiredInstances(ctx context.Context, logger lager.Logger) int

func (*SQLDB) CrashActualLRP

func (db *SQLDB) CrashActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, crashReason string) (*models.ActualLRP, *models.ActualLRP, bool, error)

func (*SQLDB) CreateConfigurationsTable

func (db *SQLDB) CreateConfigurationsTable(ctx context.Context, logger lager.Logger) error

func (*SQLDB) CreateUnclaimedActualLRP

func (db *SQLDB) CreateUnclaimedActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey) (*models.ActualLRP, error)

func (*SQLDB) DeleteTask

func (db *SQLDB) DeleteTask(ctx context.Context, logger lager.Logger, taskGuid string) (*models.Task, error)

func (*SQLDB) DesireLRP

func (db *SQLDB) DesireLRP(ctx context.Context, logger lager.Logger, desiredLRP *models.DesiredLRP) error

func (*SQLDB) DesireTask

func (db *SQLDB) DesireTask(ctx context.Context, logger lager.Logger, taskDef *models.TaskDefinition, taskGuid, domain string) (*models.Task, error)

func (*SQLDB) DesiredLRPByProcessGuid

func (db *SQLDB) DesiredLRPByProcessGuid(ctx context.Context, logger lager.Logger, processGuid string) (*models.DesiredLRP, error)

func (*SQLDB) DesiredLRPSchedulingInfos

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

func (*SQLDB) DesiredLRPs

func (db *SQLDB) DesiredLRPs(ctx context.Context, logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRP, error)

func (*SQLDB) EncryptionKeyLabel

func (db *SQLDB) EncryptionKeyLabel(ctx context.Context, logger lager.Logger) (string, error)

func (*SQLDB) EvacuateActualLRP

func (db *SQLDB) EvacuateActualLRP(
	ctx context.Context,
	logger lager.Logger,
	lrpKey *models.ActualLRPKey,
	instanceKey *models.ActualLRPInstanceKey,
	netInfo *models.ActualLRPNetInfo,
) (*models.ActualLRP, error)

func (*SQLDB) FailActualLRP

func (db *SQLDB) FailActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, placementError string) (*models.ActualLRP, *models.ActualLRP, error)

func (*SQLDB) FailTask

func (db *SQLDB) FailTask(ctx context.Context, logger lager.Logger, taskGuid, failureReason string) (*models.Task, *models.Task, error)

func (*SQLDB) FreshDomains

func (db *SQLDB) FreshDomains(ctx context.Context, logger lager.Logger) ([]string, error)

func (*SQLDB) PerformEncryption

func (db *SQLDB) PerformEncryption(ctx context.Context, logger lager.Logger) error

func (*SQLDB) RejectTask

func (db *SQLDB) RejectTask(ctx context.Context, logger lager.Logger, taskGuid, rejectionReason string) (*models.Task, *models.Task, error)

func (*SQLDB) RemoveActualLRP

func (db *SQLDB) RemoveActualLRP(ctx context.Context, logger lager.Logger, processGuid string, index int32, instanceKey *models.ActualLRPInstanceKey) error

func (*SQLDB) RemoveDesiredLRP

func (db *SQLDB) RemoveDesiredLRP(ctx context.Context, logger lager.Logger, processGuid string) error

func (*SQLDB) RemoveEvacuatingActualLRP

func (db *SQLDB) RemoveEvacuatingActualLRP(ctx context.Context, logger lager.Logger, lrpKey *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey) error

func (*SQLDB) RemoveSuspectActualLRP

func (db *SQLDB) RemoveSuspectActualLRP(ctx context.Context, logger lager.Logger, lrpKey *models.ActualLRPKey) (*models.ActualLRP, error)

func (*SQLDB) ResolvingTask

func (db *SQLDB) ResolvingTask(ctx context.Context, logger lager.Logger, taskGuid string) (*models.Task, *models.Task, error)

The stager calls this when it wants to claim a completed task. This ensures that only one stager ever attempts to handle a completed task

func (*SQLDB) SetEncryptionKeyLabel

func (db *SQLDB) SetEncryptionKeyLabel(ctx context.Context, logger lager.Logger, label string) error

func (*SQLDB) SetVersion

func (db *SQLDB) SetVersion(ctx context.Context, logger lager.Logger, version *models.Version) error

func (*SQLDB) StartActualLRP

func (db *SQLDB) StartActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, netInfo *models.ActualLRPNetInfo) (*models.ActualLRP, *models.ActualLRP, error)

func (*SQLDB) StartTask

func (db *SQLDB) StartTask(ctx context.Context, logger lager.Logger, taskGuid, cellId string) (*models.Task, *models.Task, bool, error)

func (*SQLDB) TaskByGuid

func (db *SQLDB) TaskByGuid(ctx context.Context, logger lager.Logger, taskGuid string) (*models.Task, error)

func (*SQLDB) Tasks

func (db *SQLDB) Tasks(ctx context.Context, logger lager.Logger, filter models.TaskFilter) ([]*models.Task, error)

func (*SQLDB) UnclaimActualLRP

func (db *SQLDB) UnclaimActualLRP(ctx context.Context, logger lager.Logger, key *models.ActualLRPKey) (*models.ActualLRP, *models.ActualLRP, error)

func (*SQLDB) UpdateDesiredLRP

func (db *SQLDB) UpdateDesiredLRP(ctx context.Context, logger lager.Logger, processGuid string, update *models.DesiredLRPUpdate) (*models.DesiredLRP, error)

func (*SQLDB) UpsertDomain

func (db *SQLDB) UpsertDomain(ctx context.Context, logger lager.Logger, domain string, ttl uint32) error

func (*SQLDB) Version

func (db *SQLDB) Version(ctx context.Context, logger lager.Logger) (*models.Version, error)

Directories

Path Synopsis
fakesqldriverfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
helpersfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
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