MCPcopy Create free account
hub / github.com/AbelChe/evil_minio / isCacheExclude

Method isCacheExclude

cmd/disk-cache.go:523–535  ·  view source on GitHub ↗

Returns true if object should be excluded from cache

(bucket, object string)

Source from the content-addressed store, hash-verified

521
522// Returns true if object should be excluded from cache
523func (c *cacheObjects) isCacheExclude(bucket, object string) bool {
524 // exclude directories from cache
525 if strings.HasSuffix(object, SlashSeparator) {
526 return true
527 }
528 for _, pattern := range c.exclude {
529 matchStr := fmt.Sprintf("%s/%s", bucket, object)
530 if ok := wildcard.MatchSimple(pattern, matchStr); ok {
531 return true
532 }
533 }
534 return false
535}
536
537// choose a cache deterministically based on hash of bucket,object. The hash index is treated as
538// a hint. In the event that the cache drive at hash index is offline, treat the list of cache drives

Callers 8

DeleteObjectMethod · 0.95
GetObjectNInfoMethod · 0.95
GetObjectInfoMethod · 0.95
CopyObjectMethod · 0.95
PutObjectMethod · 0.95
NewMultipartUploadMethod · 0.95
PutObjectPartMethod · 0.95
TestCacheExclusionFunction · 0.95

Calls 1

MatchSimpleMethod · 0.45

Tested by 1

TestCacheExclusionFunction · 0.76