Documentation ¶
Index ¶
- Constants
- func ActualLRPIndexDir(processGuid string, index int32) string
- func ActualLRPProcessDir(processGuid string) string
- func ActualLRPSchemaPath(processGuid string, index int32) string
- func CalculateConvergence(logger lager.Logger, clock clock.Clock, ...) *models.ConvergenceChanges
- func DesiredLRPRunInfoSchemaPath(processGuid string) string
- func DesiredLRPSchedulingInfoSchemaPath(processGuid string) string
- func DomainSchemaPath(domain string) string
- func ErrorFromEtcdError(logger lager.Logger, err error) error
- func EvacuatingActualLRPSchemaPath(processGuid string, index int32) string
- func TaskSchemaPath(task *models.Task) string
- func TaskSchemaPathByGuid(taskGuid string) string
- type DesiredComponents
- type DesiredEventCache
- type ETCDDB
- func (db *ETCDDB) ActualLRPGroupByProcessGuidAndIndex(logger lager.Logger, processGuid string, index int32) (*models.ActualLRPGroup, error)
- func (db *ETCDDB) ActualLRPGroups(logger lager.Logger, filter models.ActualLRPFilter) ([]*models.ActualLRPGroup, error)
- func (db *ETCDDB) ActualLRPGroupsByProcessGuid(logger lager.Logger, processGuid string) ([]*models.ActualLRPGroup, error)
- func (db *ETCDDB) CancelTask(logger lager.Logger, taskGuid string) error
- func (db *ETCDDB) ClaimActualLRP(logger lager.Logger, processGuid string, index int32, ...) error
- func (db *ETCDDB) CompleteTask(logger lager.Logger, taskGuid, cellId string, failed bool, ...) error
- func (db *ETCDDB) ConvergeLRPs(logger lager.Logger)
- func (db *ETCDDB) ConvergeTasks(logger lager.Logger, ...)
- func (db *ETCDDB) CrashActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) error
- func (db *ETCDDB) DeleteTask(logger lager.Logger, taskGuid string) error
- func (db *ETCDDB) DesireLRP(logger lager.Logger, desiredLRP *models.DesiredLRP) error
- func (db *ETCDDB) DesireTask(logger lager.Logger, taskDef *models.TaskDefinition, taskGuid, domain string) error
- func (db *ETCDDB) DesiredLRPByProcessGuid(logger lager.Logger, processGuid string) (*models.DesiredLRP, error)
- func (db *ETCDDB) DesiredLRPSchedulingInfos(logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRPSchedulingInfo, error)
- func (db *ETCDDB) DesiredLRPs(logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRP, error)
- func (db *ETCDDB) Domains(logger lager.Logger) ([]string, error)
- func (db *ETCDDB) EncryptionKeyLabel(logger lager.Logger) (string, error)
- func (db *ETCDDB) EvacuateClaimedActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) (keepContainer bool, modelErr error)
- func (db *ETCDDB) EvacuateCrashedActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) (bool, error)
- func (db *ETCDDB) EvacuateRunningActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) (keepContainer bool, modelErr error)
- func (db *ETCDDB) EvacuateStoppedActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) (bool, error)
- func (db *ETCDDB) FailActualLRP(logger lager.Logger, key *models.ActualLRPKey, errorMessage string) error
- func (db *ETCDDB) FailTask(logger lager.Logger, taskGuid, failureReason string) error
- func (db *ETCDDB) GatherActualLRPs(logger lager.Logger, guids map[string]struct{}, lmc *LRPMetricCounter) (map[string]map[int32]*models.ActualLRP, error)
- func (db *ETCDDB) GatherAndPruneDesiredLRPs(logger lager.Logger, guids map[string]struct{}, lmc *LRPMetricCounter) (map[string]*models.DesiredLRP, error)
- func (db *ETCDDB) GatherAndPruneLRPs(logger lager.Logger) (*models.ConvergenceInput, error)
- func (db *ETCDDB) RemoveActualLRP(logger lager.Logger, processGuid string, index int32) error
- func (db *ETCDDB) RemoveDesiredLRP(logger lager.Logger, processGuid string) error
- func (db *ETCDDB) RemoveEvacuatingActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) error
- func (db *ETCDDB) ResolveConvergence(logger lager.Logger, desiredLRPs map[string]*models.DesiredLRP, ...)
- func (db *ETCDDB) ResolvingTask(logger lager.Logger, taskGuid string) error
- func (db *ETCDDB) RetireActualLRP(logger lager.Logger, key *models.ActualLRPKey) error
- func (db *ETCDDB) SetEncryptionKeyLabel(logger lager.Logger, keyLabel string) error
- func (db *ETCDDB) SetVersion(logger lager.Logger, version *models.Version) error
- func (db *ETCDDB) StartActualLRP(logger lager.Logger, key *models.ActualLRPKey, ...) error
- func (db *ETCDDB) StartTask(logger lager.Logger, taskGuid, cellID string) (bool, error)
- func (db *ETCDDB) TaskByGuid(logger lager.Logger, taskGuid string) (*models.Task, error)
- func (db *ETCDDB) Tasks(logger lager.Logger, filter models.TaskFilter) ([]*models.Task, error)
- func (db *ETCDDB) UpdateDesiredLRP(logger lager.Logger, processGuid string, update *models.DesiredLRPUpdate) error
- func (db *ETCDDB) UpsertDomain(logger lager.Logger, domain string, ttl uint32) error
- func (db *ETCDDB) Version(logger lager.Logger) (*models.Version, error)
- func (db *ETCDDB) WatchForActualLRPChanges(logger lager.Logger, created func(*models.ActualLRPGroup), ...) (chan<- bool, <-chan error)
- func (db *ETCDDB) WatchForDesiredLRPChanges(logger lager.Logger, created func(*models.DesiredLRP), ...) (chan<- bool, <-chan error)
- func (db *ETCDDB) WatchForTaskChanges(logger lager.Logger, created func(*models.Task), ...) (chan<- bool, <-chan error)
- type ETCDMetrics
- type ETCDOptions
- type LRPMetricCounter
- type StoreClient
Constants ¶
const ( V1SchemaRoot = "/v1/" VersionKey = "/version" EncryptionKeyLabelKey = "/encryption-key" DomainSchemaRoot = V1SchemaRoot + "domain" ActualLRPSchemaRoot = V1SchemaRoot + "actual" ActualLRPInstanceKey = "instance" ActualLRPEvacuatingKey = "evacuating" DesiredLRPComponentsSchemaRoot = V1SchemaRoot + "desired_lrp" DesiredLRPSchedulingInfoKey = "schedule" DesiredLRPSchedulingInfoSchemaRoot = DesiredLRPComponentsSchemaRoot + "/" + DesiredLRPSchedulingInfoKey DesiredLRPRunInfoKey = "run" DesiredLRPRunInfoSchemaRoot = DesiredLRPComponentsSchemaRoot + "/" + DesiredLRPRunInfoKey TaskSchemaRoot = V1SchemaRoot + "task" )
const ( ETCDErrKeyNotFound = 100 ETCDErrIndexComparisonFailed = 101 ETCDErrKeyExists = 105 ETCDErrIndexCleared = 401 )
const NO_TTL = 0
Variables ¶
This section is empty.
Functions ¶
func ActualLRPIndexDir ¶
func ActualLRPProcessDir ¶
func ActualLRPSchemaPath ¶
func CalculateConvergence ¶
func CalculateConvergence( logger lager.Logger, clock clock.Clock, restartCalculator models.RestartCalculator, input *models.ConvergenceInput, ) *models.ConvergenceChanges
func DomainSchemaPath ¶
func TaskSchemaPath ¶
func TaskSchemaPathByGuid ¶
Types ¶
type DesiredComponents ¶
type DesiredComponents struct { *models.DesiredLRPSchedulingInfo *models.DesiredLRPRunInfo }
type DesiredEventCache ¶
type DesiredEventCache map[string]DesiredComponents
func NewDesiredEventCache ¶
func NewDesiredEventCache() DesiredEventCache
func (DesiredEventCache) AddRunInfo ¶
func (d DesiredEventCache) AddRunInfo(logger lager.Logger, runInfo *models.DesiredLRPRunInfo) (*models.DesiredLRP, bool)
func (DesiredEventCache) AddSchedulingInfo ¶
func (d DesiredEventCache) AddSchedulingInfo(logger lager.Logger, schedulingInfo *models.DesiredLRPSchedulingInfo) (*models.DesiredLRP, bool)
type ETCDDB ¶
type ETCDDB struct {
// contains filtered or unexported fields
}
func NewETCD ¶
func NewETCD( serializationFormat *format.Format, convergenceWorkersSize int, updateWorkersSize int, desiredLRPCreationTimeout time.Duration, cryptor encryption.Cryptor, storeClient StoreClient, auctioneerClient auctioneer.Client, serviceClient bbs.ServiceClient, clock clock.Clock, repClientFactory rep.ClientFactory, taskCC taskworkpool.TaskCompletionClient, ) *ETCDDB
func (*ETCDDB) ActualLRPGroupByProcessGuidAndIndex ¶
func (*ETCDDB) ActualLRPGroups ¶
func (db *ETCDDB) ActualLRPGroups(logger lager.Logger, filter models.ActualLRPFilter) ([]*models.ActualLRPGroup, error)
func (*ETCDDB) ActualLRPGroupsByProcessGuid ¶
func (*ETCDDB) CancelTask ¶
The cell calls this when the user requested to cancel the task stagerTaskBBS will retry this repeatedly if it gets a StoreTimeout error (up to N seconds?) Will fail if the task has already been cancelled or completed normally
func (*ETCDDB) ClaimActualLRP ¶
func (*ETCDDB) CompleteTask ¶
func (db *ETCDDB) CompleteTask(logger lager.Logger, taskGuid, cellId string, failed bool, failureReason, result string) error
The cell calls this when it has finished running the task (be it success or failure) stagerTaskBBS will retry this repeatedly if it gets a StoreTimeout error (up to N seconds?) This really really shouldn't fail. If it does, blog about it and walk away. If it failed in a consistent way (i.e. key already exists), there's probably a flaw in our design.
func (*ETCDDB) ConvergeLRPs ¶
func (*ETCDDB) ConvergeTasks ¶
func (*ETCDDB) CrashActualLRP ¶
func (db *ETCDDB) CrashActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, errorMessage string) error
func (*ETCDDB) DeleteTask ¶
The stager calls this when it wants to signal that it has received a completion and is handling it stagerTaskBBS will retry this repeatedly if it gets a StoreTimeout error (up to N seconds?) If this fails, the stager should assume that someone else is handling the completion and should bail
func (*ETCDDB) DesireLRP ¶
DesireLRP creates a DesiredLRPSchedulingInfo and a DesiredLRPRunInfo. In order to ensure that the complete model is available and there are no races in Desired Watches, DesiredLRPRunInfo is created before DesiredLRPSchedulingInfo.
func (*ETCDDB) DesireTask ¶
func (*ETCDDB) DesiredLRPByProcessGuid ¶
func (*ETCDDB) DesiredLRPSchedulingInfos ¶
func (db *ETCDDB) DesiredLRPSchedulingInfos(logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRPSchedulingInfo, error)
func (*ETCDDB) DesiredLRPs ¶
func (db *ETCDDB) DesiredLRPs(logger lager.Logger, filter models.DesiredLRPFilter) ([]*models.DesiredLRP, error)
func (*ETCDDB) EncryptionKeyLabel ¶
func (*ETCDDB) EvacuateClaimedActualLRP ¶
func (db *ETCDDB) EvacuateClaimedActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey) (keepContainer bool, modelErr error)
func (*ETCDDB) EvacuateCrashedActualLRP ¶
func (db *ETCDDB) EvacuateCrashedActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, errorMessage string) (bool, error)
func (*ETCDDB) EvacuateRunningActualLRP ¶
func (db *ETCDDB) EvacuateRunningActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, netInfo *models.ActualLRPNetInfo, ttl uint64) (keepContainer bool, modelErr error)
func (*ETCDDB) EvacuateStoppedActualLRP ¶
func (db *ETCDDB) EvacuateStoppedActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey) (bool, error)
func (*ETCDDB) FailActualLRP ¶
func (*ETCDDB) GatherActualLRPs ¶
func (*ETCDDB) GatherAndPruneDesiredLRPs ¶
func (db *ETCDDB) GatherAndPruneDesiredLRPs(logger lager.Logger, guids map[string]struct{}, lmc *LRPMetricCounter) (map[string]*models.DesiredLRP, error)
func (*ETCDDB) GatherAndPruneLRPs ¶
func (*ETCDDB) RemoveActualLRP ¶
func (*ETCDDB) RemoveDesiredLRP ¶
RemoveDesiredLRP deletes the DesiredLRPSchedulingInfo and the DesiredLRPRunInfo from the database. We delete DesiredLRPSchedulingInfo first because the system uses it to determine wheter the lrp is present. In the event that only the RunInfo fails to delete, the orphaned DesiredLRPRunInfo will be garbage collected later by convergence.
func (*ETCDDB) RemoveEvacuatingActualLRP ¶
func (db *ETCDDB) RemoveEvacuatingActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey) error
func (*ETCDDB) ResolveConvergence ¶
func (db *ETCDDB) ResolveConvergence(logger lager.Logger, desiredLRPs map[string]*models.DesiredLRP, changes *models.ConvergenceChanges)
func (*ETCDDB) ResolvingTask ¶
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 (*ETCDDB) RetireActualLRP ¶
func (*ETCDDB) SetEncryptionKeyLabel ¶
func (*ETCDDB) SetVersion ¶
func (*ETCDDB) StartActualLRP ¶
func (db *ETCDDB) StartActualLRP(logger lager.Logger, key *models.ActualLRPKey, instanceKey *models.ActualLRPInstanceKey, netInfo *models.ActualLRPNetInfo) error
func (*ETCDDB) TaskByGuid ¶
func (*ETCDDB) UpdateDesiredLRP ¶
func (*ETCDDB) UpsertDomain ¶
func (*ETCDDB) WatchForActualLRPChanges ¶
func (db *ETCDDB) WatchForActualLRPChanges(logger lager.Logger, created func(*models.ActualLRPGroup), changed func(*models.ActualLRPChange), deleted func(*models.ActualLRPGroup), ) (chan<- bool, <-chan error)
func (*ETCDDB) WatchForDesiredLRPChanges ¶
func (db *ETCDDB) WatchForDesiredLRPChanges(logger lager.Logger, created func(*models.DesiredLRP), changed func(*models.DesiredLRPChange), deleted func(*models.DesiredLRP), ) (chan<- bool, <-chan error)
type ETCDMetrics ¶
type ETCDMetrics struct {
// contains filtered or unexported fields
}
func NewETCDMetrics ¶
func NewETCDMetrics(logger lager.Logger, etcdOptions *ETCDOptions) (*ETCDMetrics, error)
func (*ETCDMetrics) Send ¶
func (t *ETCDMetrics) Send()
type ETCDOptions ¶
type LRPMetricCounter ¶
type LRPMetricCounter struct {
// contains filtered or unexported fields
}
func (LRPMetricCounter) Send ¶
func (lmc LRPMetricCounter) Send(logger lager.Logger)
type StoreClient ¶
type StoreClient interface { Get(key string, sort bool, recursive bool) (*etcd.Response, error) Set(key string, value []byte, ttl uint64) (*etcd.Response, error) Create(key string, value []byte, ttl uint64) (*etcd.Response, error) Delete(key string, recursive bool) (*etcd.Response, error) DeleteDir(key string) (*etcd.Response, error) CompareAndSwap(key string, value []byte, ttl uint64, prevIndex uint64) (*etcd.Response, error) CompareAndDelete(key string, prevIndex uint64) (*etcd.Response, error) Watch(prefix string, waitIndex uint64, recursive bool, receiver chan *etcd.Response, stop chan bool) (*etcd.Response, error) }
func NewStoreClient ¶
func NewStoreClient(client *etcd.Client) StoreClient
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
test
|
|