Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for KeepOnly (0.33 sec)

  1. pkg/controller/util/selectors/bimultimap.go

    	m.mux.RLock()
    	defer m.mux.RUnlock()
    
    	_, exists := m.selectingObjects[key]
    	return exists
    }
    
    // KeepOnly retains only the specified labeled objects and deletes the
    // rest. Like calling Delete for all keys not specified.
    func (m *BiMultimap) KeepOnly(keys []Key) {
    	m.mux.Lock()
    	defer m.mux.Unlock()
    
    	keyMap := make(map[Key]bool)
    	for _, k := range keys {
    		keyMap[k] = true
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 21:41:32 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  2. pkg/kubelet/cm/cpumanager/topology/topology.go

    }
    
    // CPUInfo contains the NUMA, socket, and core IDs associated with a CPU.
    type CPUInfo struct {
    	NUMANodeID int
    	SocketID   int
    	CoreID     int
    }
    
    // KeepOnly returns a new CPUDetails object with only the supplied cpus.
    func (d CPUDetails) KeepOnly(cpus cpuset.CPUSet) CPUDetails {
    	result := CPUDetails{}
    	for cpu, info := range d {
    		if cpus.Contains(cpu) {
    			result[cpu] = info
    		}
    	}
    	return result
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 03 16:26:09 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  3. pkg/controller/util/selectors/bimultimap_test.go

    func deleteAll(m *BiMultimap) {
    	for key := range m.labeledObjects {
    		m.Delete(key)
    	}
    	for key := range m.selectingObjects {
    		m.DeleteSelector(key)
    	}
    }
    
    func keepOnly(keys ...Key) operation {
    	return func(m *BiMultimap) {
    		m.KeepOnly(keys)
    	}
    }
    
    func keepOnlySelectors(keys ...Key) operation {
    	return func(m *BiMultimap) {
    		m.KeepOnlySelectors(keys)
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 13 01:56:36 UTC 2022
    - 16.9K bytes
    - Viewed (0)
  4. pkg/kubelet/cm/cpumanager/topology/topology_test.go

    		cpus: cpuset.New(3),
    		want: CPUDetails{},
    	}}
    
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			got := details.KeepOnly(tt.cpus)
    			if !reflect.DeepEqual(got, tt.want) {
    				t.Errorf("KeepOnly() = %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func TestCPUDetailsNUMANodes(t *testing.T) {
    
    	tests := []struct {
    		name    string
    		details CPUDetails
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 03 16:26:09 UTC 2023
    - 31.7K bytes
    - Viewed (0)
  5. pkg/kubelet/cm/cpumanager/cpu_assignment.go

    }
    
    func newCPUAccumulator(topo *topology.CPUTopology, availableCPUs cpuset.CPUSet, numCPUs int) *cpuAccumulator {
    	acc := &cpuAccumulator{
    		topo:          topo,
    		details:       topo.CPUDetails.KeepOnly(availableCPUs),
    		numCPUsNeeded: numCPUs,
    		result:        cpuset.New(),
    	}
    
    	if topo.NumSockets >= topo.NumNUMANodes {
    		acc.numaOrSocketsFirst = &numaFirst{acc}
    	} else {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Jan 25 23:56:21 UTC 2024
    - 36.3K bytes
    - Viewed (0)
  6. pkg/controller/podautoscaler/horizontal.go

    		if !ok {
    			continue
    		}
    		for _, hpa := range selectingHpas {
    			hpas[hpa] = struct{}{}
    		}
    	}
    	// Clean up all added pods.
    	a.hpaSelectors.KeepOnly([]selectors.Key{})
    
    	hpaList := []selectors.Key{}
    	for hpa := range hpas {
    		hpaList = append(hpaList, hpa)
    	}
    	return hpaList
    }
    
    // validateAndParseSelector verifies that:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 63.6K bytes
    - Viewed (0)
Back to top