Documentation ¶
Index ¶
- Constants
- func ReservedSubtract(key string, value value_t, reserved value_t) value_t
- func ReservedSum(key string, values []value_t) value_t
- func ToHostCandidate(c interface{}) (*candidatecache.HostDesc, error)
- func ToHostCandidates(cs []core.Candidater) ([]*candidatecache.HostDesc, error)
- type BaremetalCandidateManagerImplProvider
- func (p *BaremetalCandidateManagerImplProvider) GetCandidate(id string) (interface{}, error)
- func (p *BaremetalCandidateManagerImplProvider) LoadCandidates() ([]interface{}, error)
- func (p *BaremetalCandidateManagerImplProvider) ReloadAllCandidates() ([]interface{}, error)
- func (p *BaremetalCandidateManagerImplProvider) ReloadCandidates(ids []string) ([]interface{}, error)
- type CandidateGetArgs
- type CandidateIdMap
- type CandidateItem
- type CandidateManager
- func (cm *CandidateManager) AddImpl(name string, impl *CandidateManagerImpl)
- func (cm *CandidateManager) CleanDirtyCandidatesOnce(keys []string)
- func (cm *CandidateManager) DirtyPoolHas(id string) bool
- func (cm *CandidateManager) GetCandidate(id string, resType string) (interface{}, error)
- func (cm *CandidateManager) GetCandidates(args CandidateGetArgs) ([]core.Candidater, error)
- func (cm *CandidateManager) GetCandidatesByIds(resType string, ids []string) ([]core.Candidater, error)
- func (cm *CandidateManager) GetData(name string) ([]interface{}, error)
- func (cm *CandidateManager) Reload(resType string, candidateIds []string) ([]interface{}, error)
- func (cm *CandidateManager) ReloadAll(resType string) ([]interface{}, error)
- func (cm *CandidateManager) Run()
- func (cm *CandidateManager) SetCandidatesDirty(scs []*core.SelectedCandidate)
- type CandidateManagerImpl
- func (impl *CandidateManagerImpl) GetCandidate(id string) (interface{}, error)
- func (impl *CandidateManagerImpl) GetCandidates() ([]interface{}, error)
- func (impl *CandidateManagerImpl) Reload(ids []string) ([]interface{}, error)
- func (impl *CandidateManagerImpl) ReloadAll() ([]interface{}, error)
- func (impl *CandidateManagerImpl) Run()
- type CandidateManagerImplProvider
- type DataManager
- type DefaultResAlgorithm
- type GroupGuestRelation
- type GroupResAlgorithm
- type GroupResAlgorithmResult
- type HostCandidateManagerImplProvider
- func (p *HostCandidateManagerImplProvider) GetCandidate(id string) (interface{}, error)
- func (p *HostCandidateManagerImplProvider) LoadCandidates() ([]interface{}, error)
- func (p *HostCandidateManagerImplProvider) ReloadAllCandidates() ([]interface{}, error)
- func (p *HostCandidateManagerImplProvider) ReloadCandidates(ids []string) ([]interface{}, error)
- type IsolatedDeviceResAlgorithm
- type IsolatedDeviceResAlgorithmResult
- type KeyValue
- type NetworkManager
- func (m *NetworkManager) CleanVpc()
- func (m *NetworkManager) ExistsVpcNetwork(networkId, candidateId string) *synccache.SchedNetworkBuildResult
- func (m *NetworkManager) GetReservecPorts(id string) int64
- func (m *NetworkManager) GetVpcNetwork(networkId string) *VpcNetwork
- func (m *NetworkManager) IsUnknown(id string) bool
- func (m *NetworkManager) LoadUnknownNetworks(ids []string)
- type NetworksResAlgorithm
- type NetworksResAlgorithmResult
- type ResAlgorithm
- type ReservedItem
- func (item *ReservedItem) Get(key string, def_value value_t) value_t
- func (item *ReservedItem) GetAll() (values map[string]interface{})
- func (item *ReservedItem) Set(key string, value value_t)
- func (item *ReservedItem) SetAll(values map[string]interface{})
- func (item *ReservedItem) ToDict() map[string]interface{}
- type ReservedPool
- func (pool *ReservedPool) Add(sessionID string, candidateID string, reservedItem *ReservedItem)
- func (pool *ReservedPool) GetReservedItem(candidateID string) *ReservedItem
- func (pool *ReservedPool) GetSessionItem(sessionID string) *SessionItem
- func (pool *ReservedPool) InSession(candidateId string) bool
- func (pool *ReservedPool) RemoveSession(sessionID string) bool
- func (pool *ReservedPool) Start()
- func (pool *ReservedPool) ToDict() interface{}
- type ReservedPoolManager
- func (pm *ReservedPoolManager) GetPool(name string) (*ReservedPool, error)
- func (pm *ReservedPoolManager) InSession(resType string, candidateId string) bool
- func (pm *ReservedPoolManager) RemoveSession(sessionId string) bool
- func (pm *ReservedPoolManager) SearchReservedPoolBySessionID(sessionId string) (*ReservedPool, error)
- type SessionItem
- type VpcNetwork
- type VpcNetworks
Constants ¶
View Source
const (
SessionExpiredTime = 30 * 60 // Seconds
)
Variables ¶
This section is empty.
Functions ¶
func ReservedSubtract ¶
func ReservedSubtract(key string, value value_t, reserved value_t) value_t
func ReservedSum ¶
func ReservedSum(key string, values []value_t) value_t
func ToHostCandidate ¶
func ToHostCandidate(c interface{}) (*candidatecache.HostDesc, error)
func ToHostCandidates ¶
func ToHostCandidates(cs []core.Candidater) ([]*candidatecache.HostDesc, error)
Types ¶
type BaremetalCandidateManagerImplProvider ¶
type BaremetalCandidateManagerImplProvider struct {
// contains filtered or unexported fields
}
func (*BaremetalCandidateManagerImplProvider) GetCandidate ¶
func (p *BaremetalCandidateManagerImplProvider) GetCandidate(id string) (interface{}, error)
func (*BaremetalCandidateManagerImplProvider) LoadCandidates ¶
func (p *BaremetalCandidateManagerImplProvider) LoadCandidates() ([]interface{}, error)
func (*BaremetalCandidateManagerImplProvider) ReloadAllCandidates ¶
func (p *BaremetalCandidateManagerImplProvider) ReloadAllCandidates() ([]interface{}, error)
func (*BaremetalCandidateManagerImplProvider) ReloadCandidates ¶
func (p *BaremetalCandidateManagerImplProvider) ReloadCandidates( ids []string) ([]interface{}, error)
type CandidateGetArgs ¶
type CandidateIdMap ¶
type CandidateItem ¶
func NewCandidateItem ¶
func NewCandidateItem(candidateID string) *CandidateItem
type CandidateManager ¶
type CandidateManager struct {
// contains filtered or unexported fields
}
func NewCandidateManager ¶
func NewCandidateManager(dataManager *DataManager, stopCh <-chan struct{}) *CandidateManager
func (*CandidateManager) AddImpl ¶
func (cm *CandidateManager) AddImpl(name string, impl *CandidateManagerImpl)
func (*CandidateManager) CleanDirtyCandidatesOnce ¶
func (cm *CandidateManager) CleanDirtyCandidatesOnce(keys []string)
func (*CandidateManager) DirtyPoolHas ¶
func (cm *CandidateManager) DirtyPoolHas(id string) bool
func (*CandidateManager) GetCandidate ¶
func (cm *CandidateManager) GetCandidate(id string, resType string) (interface{}, error)
func (*CandidateManager) GetCandidates ¶
func (cm *CandidateManager) GetCandidates(args CandidateGetArgs) ([]core.Candidater, error)
func (*CandidateManager) GetCandidatesByIds ¶
func (cm *CandidateManager) GetCandidatesByIds(resType string, ids []string) ([]core.Candidater, error)
func (*CandidateManager) GetData ¶
func (cm *CandidateManager) GetData(name string) ([]interface{}, error)
func (*CandidateManager) Reload ¶
func (cm *CandidateManager) Reload(resType string, candidateIds []string) ( []interface{}, error)
func (*CandidateManager) ReloadAll ¶
func (cm *CandidateManager) ReloadAll(resType string) ([]interface{}, error)
func (*CandidateManager) Run ¶
func (cm *CandidateManager) Run()
func (*CandidateManager) SetCandidatesDirty ¶
func (cm *CandidateManager) SetCandidatesDirty(scs []*core.SelectedCandidate)
type CandidateManagerImpl ¶
type CandidateManagerImpl struct {
// contains filtered or unexported fields
}
func NewCandidateManagerImpl ¶
func NewCandidateManagerImpl(provider CandidateManagerImplProvider, stopCh <-chan struct{}, ) *CandidateManagerImpl
func (*CandidateManagerImpl) GetCandidate ¶
func (impl *CandidateManagerImpl) GetCandidate(id string) (interface{}, error)
func (*CandidateManagerImpl) GetCandidates ¶
func (impl *CandidateManagerImpl) GetCandidates() ([]interface{}, error)
func (*CandidateManagerImpl) Reload ¶
func (impl *CandidateManagerImpl) Reload(ids []string) ([]interface{}, error)
func (*CandidateManagerImpl) ReloadAll ¶
func (impl *CandidateManagerImpl) ReloadAll() ([]interface{}, error)
func (*CandidateManagerImpl) Run ¶
func (impl *CandidateManagerImpl) Run()
type DataManager ¶
type DataManager struct { DBCacheGroup cache.CacheGroup SyncCacheGroup cache.CacheGroup CandidateGroup cache.CacheGroup }
func NewDataManager ¶
func NewDataManager(stopCh <-chan struct{}) *DataManager
func (*DataManager) Run ¶
func (m *DataManager) Run()
type DefaultResAlgorithm ¶
type DefaultResAlgorithm struct { }
func (*DefaultResAlgorithm) Subtract ¶
func (al *DefaultResAlgorithm) Subtract(sum value_t, value value_t) value_t
func (*DefaultResAlgorithm) Sum ¶
func (al *DefaultResAlgorithm) Sum(values []value_t) value_t
type GroupGuestRelation ¶
type GroupGuestRelation struct {
Data map[string]*candidatecache.GroupCount
}
type GroupResAlgorithm ¶
type GroupResAlgorithm struct { }
func (*GroupResAlgorithm) Subtract ¶
func (al *GroupResAlgorithm) Subtract(sum value_t, value value_t) value_t
func (*GroupResAlgorithm) Sum ¶
func (al *GroupResAlgorithm) Sum(values []value_t) value_t
type GroupResAlgorithmResult ¶
type GroupResAlgorithmResult struct {
Groups []*candidatecache.GroupCounts
}
func NewGroupResAlgorithmResult ¶
func NewGroupResAlgorithmResult() *GroupResAlgorithmResult
func (*GroupResAlgorithmResult) ExistsGroup ¶
func (r *GroupResAlgorithmResult) ExistsGroup(groupId string) bool
func (*GroupResAlgorithmResult) GuestCountOfGroup ¶
func (r *GroupResAlgorithmResult) GuestCountOfGroup(groupId string) int64
type HostCandidateManagerImplProvider ¶
type HostCandidateManagerImplProvider struct {
// contains filtered or unexported fields
}
func (*HostCandidateManagerImplProvider) GetCandidate ¶
func (p *HostCandidateManagerImplProvider) GetCandidate(id string) (interface{}, error)
func (*HostCandidateManagerImplProvider) LoadCandidates ¶
func (p *HostCandidateManagerImplProvider) LoadCandidates() ([]interface{}, error)
func (*HostCandidateManagerImplProvider) ReloadAllCandidates ¶
func (p *HostCandidateManagerImplProvider) ReloadAllCandidates() ([]interface{}, error)
func (*HostCandidateManagerImplProvider) ReloadCandidates ¶
func (p *HostCandidateManagerImplProvider) ReloadCandidates( ids []string) ([]interface{}, error)
type IsolatedDeviceResAlgorithm ¶
type IsolatedDeviceResAlgorithm struct { }
func (*IsolatedDeviceResAlgorithm) Subtract ¶
func (al *IsolatedDeviceResAlgorithm) Subtract(sum value_t, value value_t) value_t
func (*IsolatedDeviceResAlgorithm) Sum ¶
func (a *IsolatedDeviceResAlgorithm) Sum(values []value_t) value_t
type NetworkManager ¶
type NetworkManager struct {
// contains filtered or unexported fields
}
func NewNetworkManager ¶
func NewNetworkManager(dataManager *DataManager, reservedPoolManager *ReservedPoolManager) *NetworkManager
func (*NetworkManager) CleanVpc ¶
func (m *NetworkManager) CleanVpc()
func (*NetworkManager) ExistsVpcNetwork ¶
func (m *NetworkManager) ExistsVpcNetwork(networkId, candidateId string, ) *synccache.SchedNetworkBuildResult
func (*NetworkManager) GetReservecPorts ¶
func (m *NetworkManager) GetReservecPorts(id string) int64
func (*NetworkManager) GetVpcNetwork ¶
func (m *NetworkManager) GetVpcNetwork(networkId string) *VpcNetwork
func (*NetworkManager) IsUnknown ¶
func (m *NetworkManager) IsUnknown(id string) bool
func (*NetworkManager) LoadUnknownNetworks ¶
func (m *NetworkManager) LoadUnknownNetworks(ids []string)
type NetworksResAlgorithm ¶
type NetworksResAlgorithm struct { }
func (*NetworksResAlgorithm) Subtract ¶
func (a *NetworksResAlgorithm) Subtract(sum value_t, value value_t) value_t
func (*NetworksResAlgorithm) Sum ¶
func (a *NetworksResAlgorithm) Sum(values []value_t) value_t
type ResAlgorithm ¶
type ResAlgorithm interface { Sum(values []value_t) value_t Subtract(sum value_t, value value_t) value_t }
func GetResAlgorithm ¶
func GetResAlgorithm(res_name string) ResAlgorithm
type ReservedItem ¶
type ReservedItem struct { CandidateId string sync.RWMutex // contains filtered or unexported fields }
ReservedItem
func NewReservedItem ¶
func NewReservedItem(candidateID string) *ReservedItem
func (*ReservedItem) Get ¶
func (item *ReservedItem) Get(key string, def_value value_t) value_t
func (*ReservedItem) GetAll ¶
func (item *ReservedItem) GetAll() (values map[string]interface{})
func (*ReservedItem) Set ¶
func (item *ReservedItem) Set(key string, value value_t)
func (*ReservedItem) SetAll ¶
func (item *ReservedItem) SetAll(values map[string]interface{})
func (*ReservedItem) ToDict ¶
func (item *ReservedItem) ToDict() map[string]interface{}
type ReservedPool ¶
func NewReservedPool ¶
func NewReservedPool(name string, stopCh <-chan struct{}) *ReservedPool
func (*ReservedPool) Add ¶
func (pool *ReservedPool) Add(sessionID string, candidateID string, reservedItem *ReservedItem)
func (*ReservedPool) GetReservedItem ¶
func (pool *ReservedPool) GetReservedItem(candidateID string) *ReservedItem
func (*ReservedPool) GetSessionItem ¶
func (pool *ReservedPool) GetSessionItem(sessionID string) *SessionItem
func (*ReservedPool) InSession ¶
func (pool *ReservedPool) InSession(candidateId string) bool
func (*ReservedPool) RemoveSession ¶
func (pool *ReservedPool) RemoveSession(sessionID string) bool
func (*ReservedPool) Start ¶
func (pool *ReservedPool) Start()
func (*ReservedPool) ToDict ¶
func (pool *ReservedPool) ToDict() interface{}
type ReservedPoolManager ¶
Reserved pool manager is mainly to cloud resources to do state updates, currently divided into host, baemetal there are three network resources management.
func NewReservedPoolManager ¶
func NewReservedPoolManager(stopCh <-chan struct{}) *ReservedPoolManager
func (*ReservedPoolManager) GetPool ¶
func (pm *ReservedPoolManager) GetPool(name string) (*ReservedPool, error)
func (*ReservedPoolManager) InSession ¶
func (pm *ReservedPoolManager) InSession(resType string, candidateId string) bool
func (*ReservedPoolManager) RemoveSession ¶
func (pm *ReservedPoolManager) RemoveSession(sessionId string) bool
func (*ReservedPoolManager) SearchReservedPoolBySessionID ¶
func (pm *ReservedPoolManager) SearchReservedPoolBySessionID(sessionId string) ( *ReservedPool, error)
type SessionItem ¶
func NewSessionItem ¶
func NewSessionItem() *SessionItem
func (*SessionItem) AllCandidateIDs ¶
func (si *SessionItem) AllCandidateIDs() []string
func (*SessionItem) ToDict ¶
func (si *SessionItem) ToDict() map[string]interface{}
type VpcNetwork ¶
type VpcNetwork struct { Data CandidateIdMap Network *synccache.SchedNetworkBuildResult }
func NewVpcNetwork ¶
func NewVpcNetwork() *VpcNetwork
type VpcNetworks ¶
type VpcNetworks struct { Data map[string]*VpcNetwork // contains filtered or unexported fields }
func NewVpcNetworks ¶
func NewVpcNetworks() *VpcNetworks
func (*VpcNetworks) Append ¶
func (vns *VpcNetworks) Append(candidateId string, networks []*synccache.SchedNetworkBuildResult)
func (*VpcNetworks) Exists ¶
func (vns *VpcNetworks) Exists(networkId, candidateId string, ) *synccache.SchedNetworkBuildResult
func (*VpcNetworks) Get ¶
func (vns *VpcNetworks) Get(networkId string) *VpcNetwork
Click to show internal directories.
Click to hide internal directories.