Documentation
¶
Index ¶
- Variables
- type Disk
- type Disks
- type EngineParams
- type NodeResource
- func (n *NodeResource) Add(n1 *NodeResource)
- func (n *NodeResource) AsRawParams() resourcetypes.RawParams
- func (n *NodeResource) DeepCopy() *NodeResource
- func (n *NodeResource) Parse(rawParams resourcetypes.RawParams) error
- func (n *NodeResource) RemoveEmpty()
- func (n *NodeResource) Sub(n1 *NodeResource)
- type NodeResourceInfo
- type NodeResourceRequest
- type VolumeBinding
- func (vb VolumeBinding) DeepCopy() *VolumeBinding
- func (vb VolumeBinding) DiskQuota(disk *Disk) *Disk
- func (vb VolumeBinding) GetMapKey() [3]string
- func (vb VolumeBinding) RequireIOPS() bool
- func (vb VolumeBinding) RequireSchedule() bool
- func (vb VolumeBinding) RequireScheduleMonopoly() bool
- func (vb VolumeBinding) RequireScheduleUnlimitedQuota() bool
- func (vb VolumeBinding) ToString(normalize bool) (volume string)
- func (vb VolumeBinding) ValidIOParameters() bool
- func (vb VolumeBinding) Validate() error
- type VolumeBindings
- func (vbs VolumeBindings) ApplyPlan(plan VolumePlan) (res VolumeBindings)
- func (vbs VolumeBindings) MarshalJSON() ([]byte, error)
- func (vbs VolumeBindings) NeedSchedule() bool
- func (vbs VolumeBindings) String() string
- func (vbs VolumeBindings) TotalSize() (total int64)
- func (vbs *VolumeBindings) UnmarshalJSON(b []byte) (err error)
- func (vbs VolumeBindings) Validate() error
- type VolumePlan
- type Volumes
- type WorkloadResource
- type WorkloadResourceRequest
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Disk ¶
type Disks ¶
type Disks []*Disk
func (Disks) GetDiskByDevice ¶
func (Disks) GetDiskByPath ¶
func (*Disks) RemoveMounts ¶
RemoveMounts remove mounts so Add / Sub won't affect the origin mounts
type EngineParams ¶
type EngineParams struct {
Volumes []string `json:"volumes"`
VolumeChanged bool `json:"volume_changed"` // indicates whether the realloc request includes new volumes
Storage int64 `json:"storage"`
IOPSOptions map[string]string `json:"iops_options"`
}
func (*EngineParams) AsRawParams ¶
func (ep *EngineParams) AsRawParams() resourcetypes.RawParams
func (*EngineParams) Parse ¶
func (ep *EngineParams) Parse(rawParams resourcetypes.RawParams) error
type NodeResource ¶
type NodeResource struct {
Volumes Volumes `json:"volumes"`
Disks Disks `json:"disks"`
Storage int64 `json:"storage"`
}
func (*NodeResource) Add ¶
func (n *NodeResource) Add(n1 *NodeResource)
func (*NodeResource) AsRawParams ¶
func (n *NodeResource) AsRawParams() resourcetypes.RawParams
func (*NodeResource) DeepCopy ¶
func (n *NodeResource) DeepCopy() *NodeResource
func (*NodeResource) Parse ¶
func (n *NodeResource) Parse(rawParams resourcetypes.RawParams) error
func (*NodeResource) RemoveEmpty ¶
func (n *NodeResource) RemoveEmpty()
func (*NodeResource) Sub ¶
func (n *NodeResource) Sub(n1 *NodeResource)
type NodeResourceInfo ¶
type NodeResourceInfo struct {
Capacity *NodeResource `json:"capacity"`
Usage *NodeResource `json:"usage"`
}
func NewNodeResourceInfo ¶ added in v0.1.4
func NewNodeResourceInfo() *NodeResourceInfo
NewNodeResourceInfo is the empty record of a node this plugin has nothing stored for.
func (*NodeResourceInfo) Validate ¶
func (n *NodeResourceInfo) Validate() error
type NodeResourceRequest ¶
type NodeResourceRequest struct {
Volumes Volumes
Storage int64
Disks Disks
RMDisks []string
RawParams resourcetypes.RawParams
}
func (*NodeResourceRequest) Parse ¶
func (n *NodeResourceRequest) Parse(rawParams resourcetypes.RawParams) (err error)
func (*NodeResourceRequest) SkipEmpty ¶
func (n *NodeResourceRequest) SkipEmpty(nodeResource *NodeResource)
SkipEmpty used for setting node resource capacity in absolute mode
type VolumeBinding ¶
type VolumeBinding struct {
Source string `json:"source"`
Destination string `json:"destination"`
Flags string `json:"flags"`
SizeInBytes int64 `json:"size_in_bytes"`
ReadIOPS int64 `json:"read_iops"`
WriteIOPS int64 `json:"write_iops"`
ReadBPS int64 `json:"read_bps"`
WriteBPS int64 `json:"write_bps"`
}
VolumeBinding src:dst[:flags][:size][:read_IOPS:write_IOPS:read_bytes:write_bytes]
func NewVolumeBinding ¶
func NewVolumeBinding(volume string) (*VolumeBinding, error)
func (VolumeBinding) DeepCopy ¶
func (vb VolumeBinding) DeepCopy() *VolumeBinding
func (VolumeBinding) DiskQuota ¶ added in v0.1.1
func (vb VolumeBinding) DiskQuota(disk *Disk) *Disk
func (VolumeBinding) GetMapKey ¶
func (vb VolumeBinding) GetMapKey() [3]string
func (VolumeBinding) RequireIOPS ¶
func (vb VolumeBinding) RequireIOPS() bool
func (VolumeBinding) RequireSchedule ¶
func (vb VolumeBinding) RequireSchedule() bool
func (VolumeBinding) RequireScheduleMonopoly ¶
func (vb VolumeBinding) RequireScheduleMonopoly() bool
func (VolumeBinding) RequireScheduleUnlimitedQuota ¶
func (vb VolumeBinding) RequireScheduleUnlimitedQuota() bool
func (VolumeBinding) ToString ¶
func (vb VolumeBinding) ToString(normalize bool) (volume string)
func (VolumeBinding) ValidIOParameters ¶
func (vb VolumeBinding) ValidIOParameters() bool
func (VolumeBinding) Validate ¶
func (vb VolumeBinding) Validate() error
type VolumeBindings ¶
type VolumeBindings []*VolumeBinding
func MergeVolumeBindings ¶
func MergeVolumeBindings(vbs1 VolumeBindings, vbs2 ...VolumeBindings) (vbs VolumeBindings)
func NewVolumeBindings ¶
func NewVolumeBindings(volumes []string) (VolumeBindings, error)
func (VolumeBindings) ApplyPlan ¶
func (vbs VolumeBindings) ApplyPlan(plan VolumePlan) (res VolumeBindings)
func (VolumeBindings) MarshalJSON ¶
func (vbs VolumeBindings) MarshalJSON() ([]byte, error)
func (VolumeBindings) NeedSchedule ¶
func (vbs VolumeBindings) NeedSchedule() bool
func (VolumeBindings) String ¶
func (vbs VolumeBindings) String() string
func (VolumeBindings) TotalSize ¶
func (vbs VolumeBindings) TotalSize() (total int64)
func (*VolumeBindings) UnmarshalJSON ¶
func (vbs *VolumeBindings) UnmarshalJSON(b []byte) (err error)
func (VolumeBindings) Validate ¶
func (vbs VolumeBindings) Validate() error
type VolumePlan ¶
type VolumePlan map[*VolumeBinding]Volumes
VolumePlan is map from volume string to volumeMap: {"AUTO:/data:rw:100": Volumes{"/sda1": 100}}
func (VolumePlan) GetVolumes ¶
func (p VolumePlan) GetVolumes(vb *VolumeBinding) (Volumes, *VolumeBinding)
GetVolumes looks up Volumes according to volume destination directory
func (VolumePlan) MarshalJSON ¶
func (p VolumePlan) MarshalJSON() ([]byte, error)
func (VolumePlan) Merge ¶
func (p VolumePlan) Merge(p2 VolumePlan)
func (VolumePlan) String ¶
func (p VolumePlan) String() string
func (*VolumePlan) UnmarshalJSON ¶
func (p *VolumePlan) UnmarshalJSON(b []byte) error
type WorkloadResource ¶
type WorkloadResource struct {
VolumesRequest VolumeBindings `json:"volumes_request"`
VolumesLimit VolumeBindings `json:"volumes_limit"`
VolumePlanRequest VolumePlan `json:"volume_plan_request"`
VolumePlanLimit VolumePlan `json:"volume_plan_limit"`
StorageRequest int64 `json:"storage_request"`
StorageLimit int64 `json:"storage_limit"`
DisksRequest Disks `json:"disks_request"`
DisksLimit Disks `json:"disks_limit"`
}
func (*WorkloadResource) AsRawParams ¶
func (w *WorkloadResource) AsRawParams() resourcetypes.RawParams
func (*WorkloadResource) Parse ¶
func (w *WorkloadResource) Parse(rawParams resourcetypes.RawParams) error
type WorkloadResourceRequest ¶
type WorkloadResourceRequest struct {
VolumesRequest VolumeBindings `json:"volumes_request"`
VolumesLimit VolumeBindings `json:"volumes_limit"`
StorageRequest int64 `json:"storage_request"`
StorageLimit int64 `json:"storage_limit"`
// contains filtered or unexported fields
}
func (*WorkloadResourceRequest) Parse ¶
func (w *WorkloadResourceRequest) Parse(rawParams resourcetypes.RawParams) (err error)
func (*WorkloadResourceRequest) SkipAddStorage ¶
func (w *WorkloadResourceRequest) SkipAddStorage()
SkipAddStorage will skip adding volume size to storage request / limit (used in realloc)
func (*WorkloadResourceRequest) Validate ¶
func (w *WorkloadResourceRequest) Validate() error
Click to show internal directories.
Click to hide internal directories.