kubernetes: k8s.io/kubernetes/pkg/kubelet/cm/cpuset Index | Files

package cpuset

import "k8s.io/kubernetes/pkg/kubelet/cm/cpuset"

Index

Package Files

cpuset.go

type Builder Uses

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

Builder is a mutable builder for CPUSet. Functions that mutate instances of this type are not thread-safe.

func NewBuilder Uses

func NewBuilder() Builder

NewBuilder returns a mutable CPUSet builder.

func (Builder) Add Uses

func (b Builder) Add(elems ...int)

Add adds the supplied elements to the result. Calling Add after calling Result has no effect.

func (Builder) Result Uses

func (b Builder) Result() CPUSet

Result returns the result CPUSet containing all elements that were previously added to this builder. Subsequent calls to Add have no effect.

type CPUSet Uses

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

CPUSet is a thread-safe, immutable set-like data structure for CPU IDs.

func MustParse Uses

func MustParse(s string) CPUSet

MustParse CPUSet constructs a new CPU set from a Linux CPU list formatted string. Unlike Parse, it does not return an error but rather panics if the input cannot be used to construct a CPU set.

func NewCPUSet Uses

func NewCPUSet(cpus ...int) CPUSet

NewCPUSet returns a new CPUSet containing the supplied elements.

func Parse Uses

func Parse(s string) (CPUSet, error)

Parse CPUSet constructs a new CPU set from a Linux CPU list formatted string.

See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS

func (CPUSet) Clone Uses

func (s CPUSet) Clone() CPUSet

Clone returns a copy of this CPU set.

func (CPUSet) Contains Uses

func (s CPUSet) Contains(cpu int) bool

Contains returns true if the supplied element is present in this set.

func (CPUSet) Difference Uses

func (s CPUSet) Difference(s2 CPUSet) CPUSet

Difference returns a new CPU set that contains all of the elements that are present in this set and not the supplied set, without mutating either source set.

func (CPUSet) Equals Uses

func (s CPUSet) Equals(s2 CPUSet) bool

Equals returns true if the supplied set contains exactly the same elements as this set (s IsSubsetOf s2 and s2 IsSubsetOf s).

func (CPUSet) Filter Uses

func (s CPUSet) Filter(predicate func(int) bool) CPUSet

Filter returns a new CPU set that contains all of the elements from this set that match the supplied predicate, without mutating the source set.

func (CPUSet) FilterNot Uses

func (s CPUSet) FilterNot(predicate func(int) bool) CPUSet

FilterNot returns a new CPU set that contains all of the elements from this set that do not match the supplied predicate, without mutating the source set.

func (CPUSet) Intersection Uses

func (s CPUSet) Intersection(s2 CPUSet) CPUSet

Intersection returns a new CPU set that contains all of the elements that are present in both this set and the supplied set, without mutating either source set.

func (CPUSet) IsEmpty Uses

func (s CPUSet) IsEmpty() bool

IsEmpty returns true if there are zero elements in this set.

func (CPUSet) IsSubsetOf Uses

func (s CPUSet) IsSubsetOf(s2 CPUSet) bool

IsSubsetOf returns true if the supplied set contains all the elements

func (CPUSet) Size Uses

func (s CPUSet) Size() int

Size returns the number of elements in this set.

func (CPUSet) String Uses

func (s CPUSet) String() string

String returns a new string representation of the elements in this CPU set in canonical linux CPU list format.

See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS

func (CPUSet) ToSlice Uses

func (s CPUSet) ToSlice() []int

ToSlice returns a slice of integers that contains all elements from this set.

func (CPUSet) ToSliceNoSort Uses

func (s CPUSet) ToSliceNoSort() []int

ToSliceNoSort returns a slice of integers that contains all elements from this set.

func (CPUSet) Union Uses

func (s CPUSet) Union(s2 CPUSet) CPUSet

Union returns a new CPU set that contains all of the elements from this set and all of the elements from the supplied set, without mutating either source set.

func (CPUSet) UnionAll Uses

func (s CPUSet) UnionAll(s2 []CPUSet) CPUSet

UnionAll returns a new CPU set that contains all of the elements from this set and all of the elements from the supplied sets, without mutating either source set.

Package cpuset imports 7 packages (graph) and is imported by 61 packages. Updated 2019-06-05. Refresh now. Tools for package owners.