cgroup

package
v1.36.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CgroupResource

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

CgroupResource represents Cgroup resource

func NewCgroupResource

func NewCgroupResource(taskARN string,
	control control.Control,
	ioutil ioutilwrapper.IOUtil,
	cgroupRoot string,
	cgroupMountPath string,
	resourceSpec specs.LinuxResources) *CgroupResource

NewCgroupResource is used to return an object that implements the Resource interface

func (*CgroupResource) ApplyTransition

func (cgroup *CgroupResource) ApplyTransition(nextState resourcestatus.ResourceStatus) error

ApplyTransition calls the function required to move to the specified status

func (*CgroupResource) Cleanup

func (cgroup *CgroupResource) Cleanup() error

Cleanup removes the cgroup root created for the task

func (*CgroupResource) Create

func (cgroup *CgroupResource) Create() error

Create creates cgroup root for the task

func (*CgroupResource) DesiredTerminal

func (cgroup *CgroupResource) DesiredTerminal() bool

DesiredTerminal returns true if the cgroup's desired status is REMOVED

func (*CgroupResource) GetCgroupMountPath

func (cgroup *CgroupResource) GetCgroupMountPath() string

GetCgroupMountPath returns cgroup mount path of the resource

func (*CgroupResource) GetCgroupRoot

func (cgroup *CgroupResource) GetCgroupRoot() string

GetCgroupRoot returns cgroup root of the resource

func (*CgroupResource) GetCreatedAt

func (cgroup *CgroupResource) GetCreatedAt() time.Time

GetCreatedAt sets the timestamp for resource's creation time

func (*CgroupResource) GetDesiredStatus

func (cgroup *CgroupResource) GetDesiredStatus() resourcestatus.ResourceStatus

GetDesiredStatus safely returns the desired status of the task

func (*CgroupResource) GetKnownStatus

func (cgroup *CgroupResource) GetKnownStatus() resourcestatus.ResourceStatus

GetKnownStatus safely returns the currently known status of the task

func (*CgroupResource) GetName

func (cgroup *CgroupResource) GetName() string

GetName safely returns the name of the resource

func (*CgroupResource) GetTerminalReason

func (cgroup *CgroupResource) GetTerminalReason() string

GetTerminalReason returns an error string to propagate up through to task state change messages

func (*CgroupResource) Initialize

func (cgroup *CgroupResource) Initialize(resourceFields *taskresource.ResourceFields,
	taskKnownStatus status.TaskStatus,
	taskDesiredStatus status.TaskStatus)

Initialize initializes the resource fileds in cgroup

func (*CgroupResource) KnownCreated

func (cgroup *CgroupResource) KnownCreated() bool

KnownCreated returns true if the cgroup's known status is CREATED

func (*CgroupResource) MarshalJSON

func (cgroup *CgroupResource) MarshalJSON() ([]byte, error)

MarshalJSON marshals CgroupResource object using duplicate struct CgroupResourceJSON

func (*CgroupResource) NextKnownState

func (cgroup *CgroupResource) NextKnownState() resourcestatus.ResourceStatus

NextKnownState returns the state that the resource should progress to based on its `KnownState`.

func (*CgroupResource) SetAppliedStatus

func (cgroup *CgroupResource) SetAppliedStatus(status resourcestatus.ResourceStatus) bool

SetAppliedStatus sets the applied status of resource and returns whether the resource is already in a transition

func (*CgroupResource) SetCreatedAt

func (cgroup *CgroupResource) SetCreatedAt(createdAt time.Time)

SetCreatedAt sets the timestamp for resource's creation time

func (*CgroupResource) SetDesiredStatus

func (cgroup *CgroupResource) SetDesiredStatus(status resourcestatus.ResourceStatus)

SetDesiredStatus safely sets the desired status of the resource

func (*CgroupResource) SetIOUtil

func (cgroup *CgroupResource) SetIOUtil(ioutil ioutilwrapper.IOUtil)

func (*CgroupResource) SetKnownStatus

func (cgroup *CgroupResource) SetKnownStatus(status resourcestatus.ResourceStatus)

SetKnownStatus safely sets the currently known status of the resource

func (*CgroupResource) StatusString

func (cgroup *CgroupResource) StatusString(status resourcestatus.ResourceStatus) string

StatusString returns the string of the cgroup resource status

func (*CgroupResource) SteadyState

func (cgroup *CgroupResource) SteadyState() resourcestatus.ResourceStatus

SteadyState returns the transition state of the resource defined as "ready"

func (*CgroupResource) TerminalStatus

func (cgroup *CgroupResource) TerminalStatus() resourcestatus.ResourceStatus

TerminalStatus returns the last transition state of cgroup

func (*CgroupResource) UnmarshalJSON

func (cgroup *CgroupResource) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals CgroupResource object using duplicate struct CgroupResourceJSON

type CgroupStatus

type CgroupStatus resourcestatus.ResourceStatus

CgroupStatus defines resource statuses for cgroups

const (
	// CgroupStatusNone is the zero state of a task resource
	CgroupStatusNone CgroupStatus = iota
	// CgroupCreated represents a task resource which has been created
	CgroupCreated
	// CgroupRemoved represents a task resource which has been cleaned up
	CgroupRemoved
)

func (*CgroupStatus) MarshalJSON

func (cs *CgroupStatus) MarshalJSON() ([]byte, error)

MarshalJSON overrides the logic for JSON-encoding the ResourceStatus type

func (CgroupStatus) String

func (cs CgroupStatus) String() string

String returns a human readable string representation of this object

func (*CgroupStatus) UnmarshalJSON

func (cs *CgroupStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the logic for parsing the JSON-encoded ResourceStatus data

Directories

Path Synopsis
factory/mock
Package mock_cgroups is a generated GoMock package.
Package mock_cgroups is a generated GoMock package.
factory/mock_factory
Package mock_factory is a generated GoMock package.
Package mock_factory is a generated GoMock package.
mock_control
Package mock_control is a generated GoMock package.
Package mock_control is a generated GoMock package.

Jump to

Keyboard shortcuts

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