MCPcopy
hub / github.com/grpc/grpc-go / dataCache

Struct dataCache

balancer/rls/cache.go:166–178  ·  view source on GitHub ↗

dataCache contains a cache of RLS data used by the LB policy to make routing decisions. The dataCache will be keyed by the request's path and keys, represented by the `cacheKey` type. It will maintain the cache keys in an `lru` and the cache data, represented by the `cacheEntry` type, in a native m

Source from the content-addressed store, hash-verified

164//
165// It is not safe for concurrent access.
166type dataCache struct {
167 maxSize int64 // Maximum allowed size.
168 currentSize int64 // Current size.
169 keys *lru // Cache keys maintained in lru order.
170 entries map[cacheKey]*cacheEntry
171 logger *internalgrpclog.PrefixLogger
172 shutdown *grpcsync.Event
173 rlsServerTarget string
174
175 // Read only after initialization.
176 grpcTarget string
177 uuid string
178}
179
180func newDataCache(size int64, logger *internalgrpclog.PrefixLogger, grpcTarget string) *dataCache {
181 return &dataCache{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected