File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
pkg/quotaplugins/quota-forest/quota-manager/quota/core Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,15 @@ func (qt *QuotaTree) GetQuotaSize() int {
209209 return len (qt .resourceNames )
210210}
211211
212+ // GetNodes : get a map of all quota nodes in the tree
213+ func (qt * QuotaTree ) GetNodes () map [string ]* QuotaNode {
214+ nodeMap := make (map [string ]* QuotaNode )
215+ for _ , n := range qt .Tree .GetNodeListBFS () {
216+ nodeMap [n .GetID ()] = (* QuotaNode )(unsafe .Pointer (n ))
217+ }
218+ return nodeMap
219+ }
220+
212221// StringSimply :
213222func (qt * QuotaTree ) StringSimply () string {
214223 var b bytes.Buffer
Original file line number Diff line number Diff line change @@ -138,6 +138,11 @@ func (controller *Controller) DeAllocate(consumerID string) bool {
138138 return false
139139}
140140
141+ // GetConsumers : get a map of consumers in controller
142+ func (controller * Controller ) GetConsumers () map [string ]* Consumer {
143+ return controller .consumers
144+ }
145+
141146// GetPreemptedConsumers : get a list of the preempted consumer IDs
142147func (controller * Controller ) GetPreemptedConsumers () []string {
143148 return controller .preemptedConsumers
You can’t perform that action at this time.
0 commit comments