func (c *Cache) UpdateEndpointPortCache(endpointsNN types.NamespacedName, epCache *EndpointPortCache) {
	c.lock.Lock()
	defer c.lock.Unlock()

	prevNumEndpoints := 0
	if existingEPCache, ok := c.cache[endpointsNN]; ok {
		prevNumEndpoints = existingEPCache.numEndpoints()
	}

	currNumEndpoints := epCache.numEndpoints()
	// To keep numEndpoints up to date, add the difference between the number of
	// endpoints in the provided spCache and any spCache it might be replacing.
	c.numEndpoints = c.numEndpoints + currNumEndpoints - prevNumEndpoints

	c.cache[endpointsNN] = epCache
	c.updateMetrics()
}
// UpdateEndpointPortCache updates a EndpointPortCache in the global cache for a
// given Service and updates the corresponding metrics.
// Parameters:
// * endpointsNN refers to a NamespacedName representing the Endpoints resource.
// * epCache refers to a EndpointPortCache for the specified Endpoints reosource.
UpdateEndpointPortCache updates a EndpointPortCache in the global cache for a
given Service and updates the corresponding metrics.
Parameters:
endpointsNN refers to a NamespacedName representing the Endpoints resource.
epCache refers to a EndpointPortCache for the specified Endpoints reosource.
// UpdateEndpointPortCache updates a EndpointPortCache in the global cache for a // given Service and updates the corresponding metrics . // Parameters : // * endpointsNN refers to a NamespacedName representing the Endpoints resource . // * epCache refers to a EndpointPortCache for the specified Endpoints reosource .
func (c *Cache) UpdateEndpointPortCache(endpointsNN types.NamespacedName, epCache *EndpointPortCache) {
	c.lock.Lock()
	defer c.lock.Unlock()
	prevNumEndpoints := 0
	if existingEPCache, ok := c.cache[endpointsNN]; ok {
		prevNumEndpoints = existingEPCache.numEndpoints()
	}
	currNumEndpoints := epCache.numEndpoints()
	c.numEndpoints = c.numEndpoints + currNumEndpoints - prevNumEndpoints
	c.cache[endpointsNN] = epCache
	c.updateMetrics()
}
func ( c * Cache ) UpdateEndpointPortCache ( endpointsNN types . NamespacedName , epCache * EndpointPortCache ) { c . lock . Lock ( ) defer c . lock . Unlock ( ) prevNumEndpoints := 0 if existingEPCache , ok := c . cache [ endpointsNN ] ; ok { prevNumEndpoints = existingEPCache . numEndpoints ( ) } currNumEndpoints := epCache . numEndpoints ( ) c . numEndpoints = c . numEndpoints + currNumEndpoints - prevNumEndpoints c . cache [ endpointsNN ] = epCache c . updateMetrics ( ) }
UpdateEndpointPortCache updates a EndpointPortCache in the global cache for a
given Service and updates the corresponding metrics.
UpdateEndpointPortCache updates a EndpointPortCache in the global cache for a given Service and updates the corresponding metrics .
// To keep numEndpoints up to date, add the difference between the number of // endpoints in the provided spCache and any spCache it might be replacing.