Documentation ¶
Index ¶
- Constants
- type ConsumerInfo
- func (ci *ConsumerInfo) CreateForestConsumer(forestName string, resourceNames map[string][]string) (*core.ForestConsumer, error)
- func (ci *ConsumerInfo) CreateTreeConsumer(treeName string, resourceNames []string) (*core.Consumer, error)
- func (ci *ConsumerInfo) GetID() string
- func (ci *ConsumerInfo) String() string
- type Manager
- func (m *Manager) AddConsumer(consumerInfo *ConsumerInfo) (bool, error)
- func (m *Manager) AddForest(forestName string) error
- func (m *Manager) AddTreeByName(treeName string) (string, error)
- func (m *Manager) AddTreeFromString(treeSring string) (string, error)
- func (m *Manager) AddTreeFromStruct(jQuotaTree utils.JQuotaTree) (string, error)
- func (m *Manager) AddTreeToForest(forestName string, treeName string) error
- func (m *Manager) Allocate(treeName string, consumerID string) (response *core.AllocationResponse, err error)
- func (m *Manager) AllocateForest(forestName string, consumerID string) (response *core.AllocationResponse, err error)
- func (m *Manager) DeAllocate(treeName string, consumerID string) bool
- func (m *Manager) DeAllocateForest(forestName string, consumerID string) bool
- func (m *Manager) DeleteForest(forestName string) error
- func (m *Manager) DeleteTree(treeName string) error
- func (m *Manager) DeleteTreeFromForest(forestName string, treeName string) error
- func (m *Manager) GetAllConsumerIDs() []string
- func (m *Manager) GetForestController(forestName string) *core.ForestController
- func (m *Manager) GetForestNames() []string
- func (m *Manager) GetForestTreeNames() map[string][]string
- func (m *Manager) GetMode() Mode
- func (m *Manager) GetModeString() string
- func (m *Manager) GetTreeCache(treeName string) *core.TreeCache
- func (m *Manager) GetTreeController(treeName string) *core.Controller
- func (m *Manager) GetTreeNames() []string
- func (m *Manager) IsAllocated(treeName string, consumerID string) bool
- func (m *Manager) IsAllocatedForest(forestName string, consumerID string) bool
- func (m *Manager) RemoveConsumer(consumerID string) (bool, error)
- func (m *Manager) SetMode(mode Mode) bool
- func (m *Manager) String() string
- func (m *Manager) TryAllocate(treeName string, consumerID string) (response *core.AllocationResponse, err error)
- func (m *Manager) TryAllocateForest(forestName string, consumerID string) (response *core.AllocationResponse, err error)
- func (m *Manager) UndoAllocate(treeName string, consumerID string) (err error)
- func (m *Manager) UndoAllocateForest(forestName string, consumerID string) (err error)
- func (m *Manager) UpdateAll() (treeUnallocatedConsumerIDs map[string][]string, ...)
- func (m *Manager) UpdateForest(forestName string) (unallocatedConsumerIDs []string, ...)
- func (m *Manager) UpdateTree(treeName string) (unallocatedConsumerIDs []string, response *core.TreeCacheCreateResponse, ...)
- type Mode
Constants ¶
const ( // Normal operation: consumers allocated/deallocated; tree updates in cache Normal = iota // Maintenance operation: consumers forced allocated; tree updates in cache Maintenance )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsumerInfo ¶
type ConsumerInfo struct {
// contains filtered or unexported fields
}
ConsumerInfo : A consumer model including specifications
func NewConsumerInfo ¶
func NewConsumerInfo(consumerStruct utils.JConsumer) (*ConsumerInfo, error)
NewConsumerInfo : create a new ConsumerInfo from Json struct
func NewConsumerInfoFromFile ¶
func NewConsumerInfoFromFile(consumerFileName string) (*ConsumerInfo, error)
NewConsumerInfoFromFile : create a new ConsumerInfo from Json file
func NewConsumerInfoFromString ¶
func NewConsumerInfoFromString(consumerString string) (*ConsumerInfo, error)
NewConsumerInfoFromString : create a new ConsumerInfo from Json string
func (*ConsumerInfo) CreateForestConsumer ¶
func (ci *ConsumerInfo) CreateForestConsumer(forestName string, resourceNames map[string][]string) (*core.ForestConsumer, error)
CreateForestConsumer : create a forest consumer for a given forest
func (*ConsumerInfo) CreateTreeConsumer ¶
func (ci *ConsumerInfo) CreateTreeConsumer(treeName string, resourceNames []string) (*core.Consumer, error)
CreateTreeConsumer : create a tree consumer for a given tree
func (*ConsumerInfo) GetID ¶
func (ci *ConsumerInfo) GetID() string
GetID : get the ID of the consumer
func (*ConsumerInfo) String ¶
func (ci *ConsumerInfo) String() string
String : a print out of the consumer info
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager : A quota manager of quota trees; This should be the main interface to quota management
func (*Manager) AddConsumer ¶
func (m *Manager) AddConsumer(consumerInfo *ConsumerInfo) (bool, error)
AddConsumer : add a consumer info
func (*Manager) AddTreeByName ¶
AddTreeByName : add an empty tree with a given name
func (*Manager) AddTreeFromString ¶
AddTreeFromString : add a quota tree from the string JSON representation of the tree
func (*Manager) AddTreeFromStruct ¶
func (m *Manager) AddTreeFromStruct(jQuotaTree utils.JQuotaTree) (string, error)
AddTreeFromStruct : add a quota tree from the JSON struct of the tree
func (*Manager) AddTreeToForest ¶
AddTreeToForest : add an already defined tree to a forest
func (*Manager) Allocate ¶
func (m *Manager) Allocate(treeName string, consumerID string) (response *core.AllocationResponse, err error)
Allocate : allocate a consumer on a tree
func (*Manager) AllocateForest ¶
func (m *Manager) AllocateForest(forestName string, consumerID string) (response *core.AllocationResponse, err error)
AllocateForest : allocate a consumer on a forest
func (*Manager) DeAllocate ¶
DeAllocate : de-allocate a consumer from a tree
func (*Manager) DeAllocateForest ¶
DeAllocateForest : de-allocate a consumer from a forest
func (*Manager) DeleteForest ¶
DeleteForest : delete a forest
func (*Manager) DeleteTree ¶
DeleteTree : delete a quota tree
func (*Manager) DeleteTreeFromForest ¶
DeleteTreeFromForest : delete a tree from a forest
func (*Manager) GetAllConsumerIDs ¶
GetAllConsumerIDs : get IDs of all consumers added
func (*Manager) GetForestController ¶ added in v1.34.0
func (m *Manager) GetForestController(forestName string) *core.ForestController
GetForestController : get the forest controller for a given forest
func (*Manager) GetForestNames ¶
GetForestNames : get the names of all forests
func (*Manager) GetForestTreeNames ¶
GetForestTreeNames : get the tree names for all forests
func (*Manager) GetModeString ¶
GetMode : get the mode of the quota manager
func (*Manager) GetTreeCache ¶
GetTreeCache : get the tree cache corresponding to a tree; nil if does not exist
func (*Manager) GetTreeController ¶ added in v1.34.0
func (m *Manager) GetTreeController(treeName string) *core.Controller
GetTreeController : get the tree controller for a given tree
func (*Manager) GetTreeNames ¶
GetTreeNames : get the names of all the trees
func (*Manager) IsAllocated ¶
IsAllocated : check if a consumer is allocated on a tree
func (*Manager) IsAllocatedForest ¶
IsAllocatedForest : check if a consumer is allocated on a forest
func (*Manager) RemoveConsumer ¶
RemoveConsumer : remove a consumer info, does not de-allocate any currently allocated consumers
func (*Manager) TryAllocate ¶ added in v1.34.0
func (m *Manager) TryAllocate(treeName string, consumerID string) (response *core.AllocationResponse, err error)
TryAllocate : try allocating a consumer on a tree
func (*Manager) TryAllocateForest ¶ added in v1.34.0
func (m *Manager) TryAllocateForest(forestName string, consumerID string) (response *core.AllocationResponse, err error)
TryAllocateForest : allocate a consumer on a forest
func (*Manager) UndoAllocate ¶ added in v1.34.0
UndoAllocate : undo the most recent allocation trial on a tree
func (*Manager) UndoAllocateForest ¶ added in v1.34.0
UndoAllocate : undo the most recent allocation trial on a tree
func (*Manager) UpdateAll ¶
func (m *Manager) UpdateAll() (treeUnallocatedConsumerIDs map[string][]string, treeResponse map[string]*core.TreeCacheCreateResponse, forestUnallocatedConsumerIDs map[string][]string, forestResponse map[string]map[string]*core.TreeCacheCreateResponse, err error)
UpdateAll : update all trees and forests from caches
func (*Manager) UpdateForest ¶
func (m *Manager) UpdateForest(forestName string) (unallocatedConsumerIDs []string, response map[string]*core.TreeCacheCreateResponse, err error)
UpdateForest : update forest from cache
func (*Manager) UpdateTree ¶
func (m *Manager) UpdateTree(treeName string) (unallocatedConsumerIDs []string, response *core.TreeCacheCreateResponse, err error)
UpdateTree : update tree from cache