Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for fnvHashFunc (0.24 sec)

  1. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_test.go

    		})
    		b.Run(fmt.Sprintf("Striped/keys=%d", numKeys), func(b *testing.B) {
    			benchmarkCache(newStripedCache(32, fnvHashFunc, func() cache { return newSimpleCache(clock.RealClock{}) }), b, numKeys)
    		})
    	}
    }
    
    func TestStripedCache(t *testing.T) {
    	testCache(newStripedCache(32, fnvHashFunc, func() cache { return newSimpleCache(clock.RealClock{}) }), t)
    }
    
    func benchmarkCache(cache cache, b *testing.B, numKeys int) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Sep 15 09:52:18 UTC 2021
    - 3.1K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_striped.go

    	c.caches[c.hashFunc(key)%c.stripeCount].set(key, value, ttl)
    }
    func (c *stripedCache) remove(key string) {
    	c.caches[c.hashFunc(key)%c.stripeCount].remove(key)
    }
    
    func fnvHashFunc(key string) uint32 {
    	f := fnv.New32()
    	f.Write([]byte(key))
    	return f.Sum32()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 22 17:16:59 UTC 2018
    - 1.6K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cached_token_authenticator.go

    		// used. Currently we advertise support 5k nodes and 10k
    		// namespaces; a 32k entry cache is therefore a 2x safety
    		// margin.
    		cache: newStripedCache(32, fnvHashFunc, func() cache { return newSimpleCache(clock) }),
    
    		hashPool: &sync.Pool{
    			New: func() interface{} {
    				return hmac.New(sha256.New, randomCacheKey)
    			},
    		},
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jul 03 16:16:51 UTC 2023
    - 9.8K bytes
    - Viewed (0)
Back to top