Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupResourcesState ¶
func CleanupResourcesState() error
CleanupResourcesState deletes resources for all closed allocations.
func WipeResourcesState ¶
func WipeResourcesState() error
WipeResourcesState deletes all database contents.
Types ¶
type ResourcesWithState ¶
type ResourcesWithState struct { bun.BaseModel `bun:"table:allocation_resources,alias:al_res"` sproto.Resources `bun:"-"` Rank int `bun:"rank"` Started *sproto.ResourcesStarted `bun:"started"` Exited *sproto.ResourcesStopped `bun:"exited"` Daemon bool `bun:"daemon"` ResourceID sproto.ResourcesID `bun:"resource_id,pk,type:text"` // db only AllocationID model.AllocationID `bun:"allocation_id,type:text"` // db only // The Container state, if we're using a RM that uses containers and it was given to us. // This is a rip in the abstraction, remove eventually. Do not add usages. Container *cproto.Container `bun:"-"` }
ResourcesWithState is an sproto.Resources, along with its state that is tracked by the allocation. The state is primarily just the updates that come in about the resources.
func NewResourcesState ¶
func NewResourcesState(r sproto.Resources, rank int) ResourcesWithState
NewResourcesState creates an instance from `sproto.Resources`.
func (*ResourcesWithState) Persist ¶
func (r *ResourcesWithState) Persist() error
Persist saves the data to the database.
Click to show internal directories.
Click to hide internal directories.