// deletePUID locks the cache in order to delete the puid from puidcache.
183393
func (c *cache) deletePUIDEntry(puid string) {
	c.Lock()
	defer c.Unlock()

	delete(c.puidCache, puid)
}
1082311
func (store *KapacitorStore) Delete(ctx context.Context, kap chronograf.Server) error {
	if store.Kapacitor == nil || store.Kapacitor.ID != kap.ID {
		return fmt.Errorf("unable to find Kapacitor with id %d", kap.ID)
	}
	store.Kapacitor = nil
	return nil
}
1365642
func (cache *diskBlockCacheWrapped) Delete(ctx context.Context,
	blockIDs []kbfsblock.ID, cacheType DiskBlockCacheType) (
	numRemoved int, sizeRemoved int64, err error) {
	// This is a write operation but we are only reading the pointers to the
	// caches. So we use a read lock.
	cache.mtx.RLock()
	defer cache.mtx.RUnlock()
	if cacheType == DiskBlockAnyCache || cacheType == DiskBlockSyncCache {
		numRemoved, sizeRemoved, err = cache.syncCache.Delete(ctx, blockIDs)
		if err != nil {
			return 0, 0, err
		}
		if cacheType == DiskBlockSyncCache {
			return numRemoved, sizeRemoved, err
		}
	}

	wsNumRemoved, wsSizeRemoved, err := cache.workingSetCache.Delete(
		ctx, blockIDs)
	if err != nil {
		return 0, 0, err
	}
	return wsNumRemoved + numRemoved, wsSizeRemoved + sizeRemoved, nil
}
900197
func (c *Client) LinodeDelete(linodeID int, skipChecks *bool) error {
	args := make(map[string]interface{})
	args["LinodeID"] = linodeID
	args["skipChecks"] = skipChecks

	_, err := c.apiCall("linode.delete", args)
	if err != nil {
		return err
	}

	return nil
}
1182720
func (e *Store) Delete(id string, pid int) {
	e.Lock()
	delete(e.byID, id)
	e.Unlock()
}
989522
func (s *Store) Delete(id packet.ID) {
	s.Lock()
	defer s.Unlock()

	delete(s.store, id)
}
408659
func (c *cachedFS) Delete(ctx context.Context, path string) error {
	err := c.cache.Delete(ctx, path)
	if err != nil && !IsNotExist(err) {
		return err
	}
	return c.src.Delete(ctx, path)
}
760230
func (c *idCache) allocateID() ID {
	for id := range c.ids {
		delete(c.ids, id)
		return id
	}

	return NoID
}
1300815
func (c *cache) updatePUIDCache(podNamespace string, podName string, puID string, dockerRuntime policy.RuntimeReader, kubernetesRuntime policy.RuntimeReader) {
	if podNamespace == "" || podName == "" || puID == "" {
		return
	}

	c.Lock()
	defer c.Unlock()

	kubeIdentifier := kubePodIdentifier(podName, podNamespace)

	puidEntry, ok := c.puidCache[puID]
	if !ok {
		puidEntry = &puidCacheEntry{}
		c.puidCache[puID] = puidEntry
	}
	puidEntry.kubeIdentifier = kubeIdentifier
	puidEntry.dockerRuntime = dockerRuntime
	puidEntry.kubernetesRuntime = kubernetesRuntime

	podEntry, ok := c.podCache[kubeIdentifier]
	if !ok {
		podEntry = &podCacheEntry{}
		podEntry.puIDs = map[string]bool{}
		c.podCache[kubeIdentifier] = podEntry
	}
	podEntry.puIDs[puID] = true

}
1320541
func (c *Cache) Delete(key string) (err error) {
	return c.caches(c.Name, "items", key).Req("DELETE", nil, nil)
}
1018399
func (c *Cache) Delete(keys [][]byte) {
	c.DeleteRange(keys, math.MinInt64, math.MaxInt64)
}
729766
func (t *timedCache) Delete(key string) error {
	return t.store.Delete(&cacheEntry{
		key: key,
	})
}
392995
func (r *RuneBuffer) Delete() {
	if r.idx == len(r.buf) {
		return
	}
	r.buf = append(r.buf[:r.idx], r.buf[r.idx+1:]...)
}
650876
func (t *LinodeConfigService) Delete(linodeId int, configId int) (*LinodeConfigResponse, error) {
	u := &url.Values{}
	u.Add("LinodeID", strconv.Itoa(linodeId))
	u.Add("ConfigID", strconv.Itoa(configId))
	v := LinodeConfigResponse{}
	if err := t.client.do("linode.config.delete", u, &v.Response); err != nil {
		return nil, err
	}

	if err := json.Unmarshal(v.RawData, &v.LinodeConfigId); err != nil {
		return nil, err
	}
	return &v, nil
}
471665
func (l *LFUNoTS) Delete(key string) error {
	res, err := l.cache.Get(key)
	if err != nil && err != ErrNotFound {
		return err
	}

	// we dont need to delete if already doesn't exist
	if err == ErrNotFound {
		return nil
	}

	ci := res.(*cacheItem)

	l.remove(ci, ci.freqElement)
	l.currentSize--
	return l.cache.Delete(key)
}
595147
func (s *Config) doUpdatePU(contextID string, pu *policy.PUInfo) error {

	s.Lock()

	data, err := s.versionTracker.LockedModify(contextID, revert, 1)
	if err != nil {
		return fmt.Errorf("unable to find pu %s in cache: %s", contextID, err)
	}

	c := data.(*cacheData)
	if err := s.impl.UpdateRules(c.version, contextID, pu, c.containerInfo); err != nil {
		// Try to clean up, even though this is fatal and it will most likely fail
		s.Unlock()
		s.Unsupervise(contextID) // nolint
		return err
	}

	// Updated the policy in the cached processing unit.
	c.containerInfo.Policy = pu.Policy

	s.Unlock()
	return nil
}
800285
func (c *MemcacheCacher) Delete(key string) error {
	return c.c.Delete(key)
}