registry

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultKeyPrefix = "/_coreos.com/fleet/"
View Source
const (
	// ResourceMutexTTL is the number of seconds to allow a mutex to be held on a resource
	ResourceMutexTTL = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventStream

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

func NewEventStream

func NewEventStream(client *etcd.Client, registry *Registry) *EventStream

func (*EventStream) Stream

func (es *EventStream) Stream(idx uint64, eventchan chan *event.Event, stop chan bool)

type LegacyJobPayload added in v0.3.0

type LegacyJobPayload struct {
	Name string
	Unit unit.Unit
}

LegacyJobPayload deals with the legacy concept of a "JobPayload" (deprecated by Units). The associated marshaling/unmarshaling methods deal with Payloads encoded in this legacy format.

func (*LegacyJobPayload) UnmarshalJSON added in v0.3.0

func (ljp *LegacyJobPayload) UnmarshalJSON(data []byte) error

type Registry

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

func New

func New(client *etcd.Client, keyPrefix string) (registry *Registry)

func (*Registry) CheckJobPulse added in v0.3.0

func (r *Registry) CheckJobPulse(jobName string) (string, bool)

func (*Registry) ClearJobHeartbeat added in v0.3.0

func (r *Registry) ClearJobHeartbeat(jobName string)

func (*Registry) ClearJobTarget added in v0.3.0

func (r *Registry) ClearJobTarget(jobName, machID string) error

func (*Registry) CreateJob

func (r *Registry) CreateJob(j *job.Job) (err error)

CreateJob attempts to store a Job and its associated Unit in the registry

func (*Registry) CreateJobOffer

func (r *Registry) CreateJobOffer(jo *job.JobOffer) error

CreateJobOffer attempts to store a JobOffer and a reference to its associated Job in the repository

func (*Registry) CreateSignatureSet added in v0.2.0

func (r *Registry) CreateSignatureSet(ss *sign.SignatureSet) error

CreateSignatureSet stores the given SignatureSet in the repository

func (*Registry) DestroyJob added in v0.3.0

func (r *Registry) DestroyJob(jobName string)

DestroyJob removes a Job object from the repository, along with any legacy associated Payload and SignatureSet. It does not yet remove underlying Units from the repository.

func (*Registry) DestroySignatureSet added in v0.2.0

func (r *Registry) DestroySignatureSet(tag string)

DestroySignatureSet destroys the SignatureSet associated with the given tag

func (*Registry) GetActiveMachines

func (r *Registry) GetActiveMachines() []machine.MachineState

Describe all active Machines

func (*Registry) GetAllJobs

func (r *Registry) GetAllJobs() []job.Job

GetAllJobs lists all Jobs known by the Registry

func (*Registry) GetDebugInfo added in v0.2.0

func (r *Registry) GetDebugInfo() (string, error)

func (*Registry) GetJob

func (r *Registry) GetJob(jobName string) (j *job.Job)

GetJob looks for a Job of the given name in the Registry. It returns a fully hydrated Job on success, or nil on any kind of failure.

func (*Registry) GetJobTarget

func (r *Registry) GetJobTarget(jobName string) string

GetJobTarget looks up where the given job is scheduled. If the job has been scheduled, the ID the target machine is returned. Otherwise, an empty string is returned.

func (*Registry) GetJobTargetState added in v0.3.0

func (r *Registry) GetJobTargetState(jobName string) *job.JobState

func (*Registry) GetMachineState

func (r *Registry) GetMachineState(machID string) *machine.MachineState

Get Machine object from etcd

func (*Registry) GetSignatureSet added in v0.2.0

func (r *Registry) GetSignatureSet(tag string) *sign.SignatureSet

GetSignatureSet returns the SignatureSet associated with the given tag

func (*Registry) GetSignatureSetOfJob added in v0.3.0

func (r *Registry) GetSignatureSetOfJob(name string) *sign.SignatureSet

GetSignatureSetOfJob retrieves the SignatureSet associated with the given job, or nil if none can be found

func (*Registry) JobHeartbeat added in v0.3.0

func (r *Registry) JobHeartbeat(jobName, agentMachID string, ttl time.Duration) error

func (*Registry) LockJob added in v0.1.2

func (r *Registry) LockJob(jobName, context string) *TimedResourceMutex

func (*Registry) LockJobOffer added in v0.1.2

func (r *Registry) LockJobOffer(jobName, context string) *TimedResourceMutex

func (*Registry) LockMachine added in v0.1.2

func (r *Registry) LockMachine(machID, context string) *TimedResourceMutex

Attempt to acquire a lock on a given machine for a given amount of time

func (*Registry) RemoveMachineState

func (r *Registry) RemoveMachineState(machID string) error

Remove Machine object from etcd

func (*Registry) RemoveUnitState added in v0.3.0

func (r *Registry) RemoveUnitState(jobName string) error

Delete the state from the Registry for the given Job's Unit

func (*Registry) ResolveJobOffer

func (r *Registry) ResolveJobOffer(jobName string) error

func (*Registry) SaveUnitState added in v0.3.0

func (r *Registry) SaveUnitState(jobName string, unitState *unit.UnitState)

Persist the changes in a provided Machine's Job

func (*Registry) ScheduleJob

func (r *Registry) ScheduleJob(jobName string, machID string) error

func (*Registry) SetJobTargetState added in v0.3.0

func (r *Registry) SetJobTargetState(jobName string, state job.JobState) error

func (*Registry) SetMachineState

func (r *Registry) SetMachineState(ms machine.MachineState, ttl time.Duration) (uint64, error)

Push Machine object to etcd

func (*Registry) SubmitJobBid

func (r *Registry) SubmitJobBid(jb *job.JobBid)

func (*Registry) UnresolvedJobOffers

func (r *Registry) UnresolvedJobOffers() []job.JobOffer

UnresolvedJobOffers returns a list of hydrated JobOffers from the Registry

type TimedResourceMutex added in v0.1.2

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

TimedResourceMutex is a proxy to an auto-expiring mutex stored in the Registry. It assumes the mutex creator has initialized a timer.

func (*TimedResourceMutex) Unlock added in v0.1.2

func (t *TimedResourceMutex) Unlock() error

Unlock will attempt to remove the lock held on the mutex in the Registry.

Jump to

Keyboard shortcuts

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