Documentation
¶
Index ¶
- type AssigningResourceBindingCache
- func (b *AssigningResourceBindingCache) Add(binding *workv1alpha2.ResourceBinding)
- func (b *AssigningResourceBindingCache) GetBindings() map[string]*workv1alpha2.ResourceBinding
- func (b *AssigningResourceBindingCache) OnBindingDelete(binding *workv1alpha2.ResourceBinding)
- func (b *AssigningResourceBindingCache) OnBindingUpdate(binding *workv1alpha2.ResourceBinding)
- type Cache
- type Snapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssigningResourceBindingCache ¶ added in v1.17.0
type AssigningResourceBindingCache struct {
sync.RWMutex
// contains filtered or unexported fields
}
AssigningResourceBindingCache acts as a temporary buffer for ResourceBindings that have new scheduling decisions ("assigning" state) but are not yet fully reflected in the local Informer cache or member clusters.
func (*AssigningResourceBindingCache) Add ¶ added in v1.17.0
func (b *AssigningResourceBindingCache) Add(binding *workv1alpha2.ResourceBinding)
Add records a ResourceBinding that has a new scheduling decision committed to the API server. This binding is considered to be in an "assigning" state and will be served by the scheduler as the intended state until its full reflection in the Informer cache and member clusters.
func (*AssigningResourceBindingCache) GetBindings ¶ added in v1.17.0
func (b *AssigningResourceBindingCache) GetBindings() map[string]*workv1alpha2.ResourceBinding
GetBindings returns all currently cached ResourceBindings that are in the "assigning" state, providing the scheduler with the most up-to-date view of pending assignments.
func (*AssigningResourceBindingCache) OnBindingDelete ¶ added in v1.17.0
func (b *AssigningResourceBindingCache) OnBindingDelete(binding *workv1alpha2.ResourceBinding)
OnBindingDelete is called when a delete event for a ResourceBinding is received from the Informer.
func (*AssigningResourceBindingCache) OnBindingUpdate ¶ added in v1.17.0
func (b *AssigningResourceBindingCache) OnBindingUpdate(binding *workv1alpha2.ResourceBinding)
OnBindingUpdate is called when an update event for a ResourceBinding is received from the Informer. It removes the binding from this temporary cache if the Informer's version has caught up to or surpassed the version we recorded, indicating that the scheduling decision is now reflected in the Informer's state. This means the binding is no longer in the "assigning" state from the cache's perspective.
type Cache ¶
type Cache interface {
AddCluster(cluster *clusterv1alpha1.Cluster)
UpdateCluster(cluster *clusterv1alpha1.Cluster)
DeleteCluster(cluster *clusterv1alpha1.Cluster)
// Snapshot returns a snapshot of the current clusters info
Snapshot() Snapshot
// ResourceBindingIndexer returns the indexer for ResourceBindings, used for advanced scheduling logic.
ResourceBindingIndexer() cache.Indexer
// AssigningResourceBindings returns a cache for ResourceBindings that are in the "assigning" state.
// After the control plane generates scheduling results and commits them to the API server,
// there is a period before these results are fully propagated to and reflected in the member clusters.
// This cache stores these "assigning" bindings to provide the scheduler with a more accurate and
// immediate view of the intended state, enabling more precise decision-making during subsequent scheduling cycles.
AssigningResourceBindings() *AssigningResourceBindingCache
}
Cache is an interface for scheduler internal cache.
func NewCache ¶
func NewCache(clusterLister clusterlister.ClusterLister, resourceBindingIndexer cache.Indexer) Cache
NewCache instantiates a cache used only by scheduler.
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is a snapshot of cache ClusterInfo. The scheduler takes a snapshot at the beginning of each scheduling cycle and uses it for its operations in that cycle.
func NewEmptySnapshot ¶
func NewEmptySnapshot() Snapshot
NewEmptySnapshot initializes a Snapshot struct and returns it.
func (*Snapshot) GetCluster ¶ added in v0.9.0
func (s *Snapshot) GetCluster(clusterName string) *framework.ClusterInfo
GetCluster returns the given clusters.
func (*Snapshot) GetClusters ¶
func (s *Snapshot) GetClusters() []*framework.ClusterInfo
GetClusters returns all the clusters.
func (*Snapshot) GetReadyClusterNames ¶ added in v0.8.0
GetReadyClusterNames returns the clusterNames in ready status.
func (*Snapshot) GetReadyClusters ¶ added in v0.3.0
func (s *Snapshot) GetReadyClusters() []*framework.ClusterInfo
GetReadyClusters returns the clusters in ready status.
func (*Snapshot) NumOfClusters ¶
NumOfClusters returns the number of clusters.