Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 118 for cache (0.26 sec)

  1. internal/cachevalue/cache.go

    // `.TnitOnce`.
    func New[T any]() *Cache[T] {
    	return &Cache[T]{}
    }
    
    // NewFromFunc allocates a new cached value instance and initializes it with an
    // update function, making it ready for use.
    func NewFromFunc[T any](ttl time.Duration, opts Opts, update func() (T, error)) *Cache[T] {
    	return &Cache[T]{
    		ttl:      ttl,
    		updateFn: update,
    		opts:     opts,
    	}
    }
    
    // InitOnce initializes the cache with a TTL and an update function. It is
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Mar 01 16:00:42 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  2. internal/config/cache/cache.go

    	BlockSize = "block_size"
    
    	EnvEnable    = "MINIO_CACHE_ENABLE"
    	EnvEndpoint  = "MINIO_CACHE_ENDPOINT"
    	EnvBlockSize = "MINIO_CACHE_BLOCK_SIZE"
    )
    
    // DefaultKVS - default KV config for cache settings
    var DefaultKVS = config.KVS{
    	config.KV{
    		Key:   Enable,
    		Value: "off",
    	},
    	config.KV{
    		Key:   Endpoint,
    		Value: "",
    	},
    	config.KV{
    		Key:   BlockSize,
    		Value: "",
    	},
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  3. internal/cachevalue/cache_test.go

    )
    
    func TestCache(t *testing.T) {
    	cache := New[time.Time]()
    	t.Parallel()
    	cache.InitOnce(2*time.Second, Opts{},
    		func() (time.Time, error) {
    			return time.Now(), nil
    		},
    	)
    
    	t1, _ := cache.Get()
    
    	t2, _ := cache.Get()
    
    	if !t1.Equal(t2) {
    		t.Fatalf("expected time to be equal: %s != %s", t1, t2)
    	}
    
    	time.Sleep(3 * time.Second)
    	t3, _ := cache.Get()
    
    	if t1.Equal(t3) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Feb 28 17:09:09 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  4. cni/pkg/nodeagent/pod_cache.go

    				Netns:    existing.Netns,
    			}
    			// already in cache
    			return existing.Netns
    		}
    		log.Debug("netns inode mismatch, using the new one")
    	}
    
    	p.addToCacheUnderLock(uid, workload)
    	return workload.Netns
    }
    
    // Update the cache with the given uid and nspath. Return the Netns for the given uid.
    // If uid is already present, a cached Netns is returned, and the given nspath is ignored.
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  5. cmd/data-usage-cache.go

    // dataUsageCacheV2 contains a cache of data usage entries version 2.
    type dataUsageCacheV2 struct {
    	Info  dataUsageCacheInfo
    	Cache map[string]dataUsageEntryV2
    }
    
    // dataUsageCacheV3 contains a cache of data usage entries version 3.
    type dataUsageCacheV3 struct {
    	Info  dataUsageCacheInfo
    	Cache map[string]dataUsageEntryV3
    }
    
    // dataUsageCacheV4 contains a cache of data usage entries version 4.
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 41.4K bytes
    - Viewed (1)
  6. cmd/metrics-v3-cache.go

    )
    
    // metricsCache - cache for metrics.
    //
    // When serving metrics, this cache is passed to the MetricsLoaderFn.
    //
    // This cache is used for metrics that would result in network/storage calls.
    type metricsCache struct {
    	dataUsageInfo       *cachevalue.Cache[DataUsageInfo]
    	esetHealthResult    *cachevalue.Cache[HealthResult]
    	driveMetrics        *cachevalue.Cache[storageMetrics]
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Apr 23 23:56:12 GMT 2024
    - 7.9K bytes
    - Viewed (0)
  7. cni/pkg/nodeagent/pod_cache_test.go

    	found := false
    	snap := p.ReadCurrentPodSnapshot()
    	for k, v := range snap {
    		if k == "123" && v == (WorkloadInfo{}) {
    			found = true
    		}
    	}
    	if !found {
    		t.Fatalf("expected pod 123 to be in the cache")
    	}
    }
    
    func TestUpsertPodCacheWithLiveNetns(t *testing.T) {
    	p := newPodNetnsCache(openNsTestOverride)
    
    	pod := &corev1.Pod{ObjectMeta: metav1.ObjectMeta{UID: "testUID"}}
    	ns := newFakeNsInode(inc(), 1)
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  8. cmd/data-usage-cache_gen.go

    				return
    			}
    		case "Cache":
    			var zb0002 uint32
    			zb0002, err = dc.ReadMapHeader()
    			if err != nil {
    				err = msgp.WrapError(err, "Cache")
    				return
    			}
    			if z.Cache == nil {
    				z.Cache = make(map[string]dataUsageEntry, zb0002)
    			} else if len(z.Cache) > 0 {
    				for key := range z.Cache {
    					delete(z.Cache, key)
    				}
    			}
    			for zb0002 > 0 {
    				zb0002--
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Mar 21 17:21:35 GMT 2024
    - 100.8K bytes
    - Viewed (0)
  9. cmd/data-usage-cache_test.go

    Krishnan Parthasarathi <******@****.***> 1705132268 -0800
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Jan 13 07:51:08 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  10. cmd/data-usage-cache_gen_test.go

    Krishnan Parthasarathi <******@****.***> 1705132268 -0800
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Jan 13 07:51:08 GMT 2024
    - 28.1K bytes
    - Viewed (0)
Back to top