package state

import "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state"

Index

Types

type CPUManagerCheckpoint

type CPUManagerCheckpoint struct {
	PolicyName    string            `json:"policyName"`
	DefaultCPUSet string            `json:"defaultCpuSet"`
	Entries       map[string]string `json:"entries,omitempty"`
	Checksum      checksum.Checksum `json:"checksum"`
}

CPUManagerCheckpoint struct is used to store cpu/pod assignments in a checkpoint

func NewCPUManagerCheckpoint

func NewCPUManagerCheckpoint() *CPUManagerCheckpoint

NewCPUManagerCheckpoint returns an instance of Checkpoint

func (*CPUManagerCheckpoint) MarshalCheckpoint

func (cp *CPUManagerCheckpoint) MarshalCheckpoint() ([]byte, error)

MarshalCheckpoint returns marshalled checkpoint

func (*CPUManagerCheckpoint) UnmarshalCheckpoint

func (cp *CPUManagerCheckpoint) UnmarshalCheckpoint(blob []byte) error

UnmarshalCheckpoint tries to unmarshal passed bytes to checkpoint

func (*CPUManagerCheckpoint) VerifyChecksum

func (cp *CPUManagerCheckpoint) VerifyChecksum() error

VerifyChecksum verifies that current checksum of checkpoint is valid

type ContainerCPUAssignments

type ContainerCPUAssignments map[string]cpuset.CPUSet

ContainerCPUAssignments type used in cpu manger state

func (ContainerCPUAssignments) Clone

Clone returns a copy of ContainerCPUAssignments

type Reader

type Reader interface {
	GetCPUSet(containerID string) (cpuset.CPUSet, bool)
	GetDefaultCPUSet() cpuset.CPUSet
	GetCPUSetOrDefault(containerID string) cpuset.CPUSet
	GetCPUAssignments() ContainerCPUAssignments
}

Reader interface used to read current cpu/pod assignment state

type State

type State interface {
	Reader
	// contains filtered or unexported methods
}

State interface provides methods for tracking and setting cpu/pod assignment

func NewCheckpointState

func NewCheckpointState(stateDir, checkpointName, policyName string) (State, error)

NewCheckpointState creates new State for keeping track of cpu/pod assignment with checkpoint backend

func NewFileState

func NewFileState(filePath string, policyName string) State

NewFileState creates new State for keeping track of cpu/pod assignment with file backend

func NewMemoryState

func NewMemoryState() State

NewMemoryState creates new State for keeping track of cpu/pod assignment

Source Files

checkpoint.go state.go state_checkpoint.go state_file.go state_mem.go

Directories

PathSynopsis
pkg/kubelet/cm/cpumanager/state/testing
Version
v1.13.7-beta.0
Published
May 8, 2019
Platform
js/wasm
Imports
11 packages
Last checked
3 minutes ago

Tools for package owners.