是否可以删除缓存

@param cacheDeleteKey CacheDeleteKey注解
@param arguments      参数
@param retVal         结果值
@return Can Delete
@throws Exception 异常
731
public boolean isCanDelete(CacheDeleteKey cacheDeleteKey, Object[] arguments, Object retVal) throws Exception {
        boolean rv = true;
        if (null != arguments && arguments.length > 0 && null != cacheDeleteKey.condition()
                && cacheDeleteKey.condition().length() > 0) {
            rv = this.getElValue(cacheDeleteKey.condition(), null, arguments, retVal, true, Boolean.class);
        }
        return rv;
    }
571106
def __delete(self, key):
        ''' 
        '''
        with self.get_conn() as conn:
            try:
                c = conn.cursor()
                c.execute("DELETE FROM cache_entries WHERE key = ?", (key,))
                conn.commit()
            except:
                getLogger().exception("Cannot delete")
                return None
747545
function(...args) {
      const cacheKey = keySelector(...args);

      if (isValidCacheKey(cacheKey)) {
        let cacheResponse = cache.get(cacheKey);

        if (cacheResponse === undefined) {
          cacheResponse = selectorCreator(...funcs);
          cache.set(cacheKey, cacheResponse);
        }

        return cacheResponse(...args);
      }
      console.warn(
        `[re-reselect] Invalid cache key "${cacheKey}" has been returned by keySelector function.`
      );
      return undefined;
    }
162830
public static base_response delete(nitro_service client, String selectorname) throws Exception {
		cacheselector deleteresource = new cacheselector();
		deleteresource.selectorname = selectorname;
		return deleteresource.delete_resource(client);
	}
226864
boolean tryDeleteReplica(Storable replica) throws PersistException {
        // Prevent trigger from being invoked by deleting replica.
        TriggerManager tm = mTriggerManager;
        tm.locallyDisableDelete();
        try {
            return replica.tryDelete();
        } finally {
            tm.locallyEnableDelete();
        }
    }
487072
public Serializable cached(String key, Object... args) {
        if (conf().cacheDisabled()) return null;
        ICacheService cacheService = _cacheService;
        if (args.length > 0) {
            StringBuilder sb = new StringBuilder(key);
            for (Object arg : args) {
                sb.append("-").append(arg);
            }
            key = sb.toString();
        }
        return cacheService.get(key);
    }
1331941
public int delete(DatabaseConnection databaseConnection, T data, ObjectCache objectCache) throws SQLException {
		if (mappedDelete == null) {
			mappedDelete = MappedDelete.build(dao, tableInfo);
		}
		int result = mappedDelete.delete(databaseConnection, data, objectCache);
		if (dao != null && !localIsInBatchMode.get()) {
			dao.notifyChanges();
		}
		return result;
	}
900084
public void deleteDir(String key, boolean recursive) throws EtcdClientException {
        Preconditions.checkNotNull(key);

        Map<String, String> params = new HashMap<String, String>();
        if (recursive) {
            params.put("recursive", String.valueOf(true));
        } else {
            params.put("dir", String.valueOf(true));
        }

        URI uri = buildUriWithKeyAndParams(key, params);

        HttpDelete httpDelete = new HttpDelete(uri);
        syncExecute(httpDelete, new int[]{200, 403});
    }
1205978
protected void invalidateCacheEntry(String spaceId, String key) {
        if (isCacheEnabled()) {
            removeFromCache(getCacheName(), calcCacheKey(spaceId, key));
        }
    }
435609
public static ns_ssl_certkey delete(nitro_service client, ns_ssl_certkey resource) throws Exception
	{
		resource.validate("delete");
		return ((ns_ssl_certkey[]) resource.delete_resource(client))[0];
	}
843441
@Override
    public Root delete(Root root) throws WIMException {
        Map<String, Control> ctrlMap = ControlsHelper.getControlMap(root);

        DeleteControl deleteCtrl = (DeleteControl) ctrlMap.get(SchemaConstants.DO_DELETE_CONTROL);

        boolean delDesc = false;
        if (deleteCtrl != null) {
            delDesc = deleteCtrl.isDeleteDescendants();
        }

        Entity inEntity = root.getEntities().get(0);
        IdentifierType inId = inEntity.getIdentifier();

        LdapEntry ldapEntry = iLdapConn.getEntityByIdentifier(inId, null, null, false, false);

        Root outRoot = new Root();

        List<LdapEntry> delEntries = deleteAll(ldapEntry, delDesc);
        for (int i = 0; i < delEntries.size(); i++) {
            LdapEntry delEntry = delEntries.get(i);
            createEntityFromLdapEntry(outRoot, SchemaConstants.DO_ENTITIES, delEntry, null);
            updateGroupMember(ldapEntry.getDN(), null);
            // Invalidate Attributes Cache.
            iLdapConn.invalidateAttributes(delEntry.getDN(), delEntry.getExtId(), delEntry.getUniqueName());
        }
        // Invalidate Names Cache
        iLdapConn.invalidateSearchCache();

        return outRoot;
    }
395728
@Override
	public V get(K key) throws CacheException {
		logger.debug("get key [" + key + "]");

		if (key == null) {
			return null;
		}

		try {
			Object redisCacheKey = getRedisCacheKey(key);
			byte[] rawValue = redisManager.get(keySerializer.serialize(redisCacheKey));
			if (rawValue == null) {
				return null;
			}
			V value = (V) valueSerializer.deserialize(rawValue);
			return value;
		} catch (SerializationException e) {
			throw new CacheException(e);
		}
	}
567873
public Object proceedDeleteCacheTransactional(DeleteCacheTransactionalAopProxyChain pjp,
                                                  CacheDeleteTransactional cacheDeleteTransactional) throws Throwable {
        Object result = null;
        Set<CacheKeyTO> set0 = CacheHelper.getDeleteCacheKeysSet();
        boolean isStart = null == set0;
        if (!cacheDeleteTransactional.useCache()) {
            // 在事务环境下尽量直接去数据源加载数据，而不是从缓存中加载，减少数据不一致的可能
            CacheHelper.setCacheOpType(CacheOpType.LOAD);
        }
        boolean getError = false;
        try {
            CacheHelper.initDeleteCacheKeysSet();// 初始化Set
            result = pjp.doProxyChain();
        } catch (Throwable e) {
            getError = true;
            throw e;
        } finally {
            CacheHelper.clearCacheOpType();
            if (isStart) {
                if (getError && !cacheDeleteTransactional.deleteCacheOnError()) {
                    // do nothing
                } else {
                    clearCache();
                }
            }
        }

        return result;
    }
1008124
@Override
    protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws IOException {

        // Get the path to delete
        String path = getRelativePath(req);

        // Check if webdav is set to read only
        if (m_readOnly) {

            resp.setStatus(CmsWebdavStatus.SC_FORBIDDEN);

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_WEBDAV_READ_ONLY_0));
            }

            return;
        }

        // Check if path exists
        boolean exists = m_session.exists(path);
        if (!exists) {

            resp.setStatus(CmsWebdavStatus.SC_NOT_FOUND);

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_ITEM_NOT_FOUND_1, path));
            }

            return;
        }

        // Check if resource is locked
        if (isLocked(req)) {

            resp.setStatus(CmsWebdavStatus.SC_LOCKED);

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_ITEM_LOCKED_1, path));
            }

            return;
        }

        // Check if resources found in the tree of the path are locked
        Hashtable<String, Integer> errorList = new Hashtable<String, Integer>();

        checkChildLocks(req, path, errorList);
        if (!errorList.isEmpty()) {
            sendReport(req, resp, errorList);

            if (LOG.isDebugEnabled()) {
                Iterator<String> iter = errorList.keySet().iterator();
                while (iter.hasNext()) {
                    String errorPath = iter.next();
                    LOG.debug(Messages.get().getBundle().key(Messages.LOG_CHILD_LOCKED_1, errorPath));
                }
            }

            return;
        }

        // Delete the resource
        try {

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_DELETE_ITEM_0));
            }

            m_session.delete(path);
        } catch (CmsVfsResourceNotFoundException rnfex) {

            // should never happen
            resp.setStatus(CmsWebdavStatus.SC_NOT_FOUND);
            return;
        } catch (CmsSecurityException sex) {
            resp.setStatus(CmsWebdavStatus.SC_FORBIDDEN);

            if (LOG.isDebugEnabled()) {
                LOG.debug(Messages.get().getBundle().key(Messages.LOG_NO_PERMISSION_0));
            }

            return;
        } catch (CmsException ex) {
            resp.setStatus(CmsWebdavStatus.SC_INTERNAL_SERVER_ERROR);

            if (LOG.isErrorEnabled()) {
                LOG.error(Messages.get().getBundle().key(Messages.LOG_REPOSITORY_ERROR_2, "DELETE", path), ex);
            }

            return;
        }

        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_DELETE_SUCCESS_0));
        }

        resp.setStatus(CmsWebdavStatus.SC_NO_CONTENT);
    }
482451
function _delete (args) {
    // make sure args is object
    args = requireValidOptionalObject(args)
    // model must allow delete
    if (!defined(this.model.columns.d)) {
        throw this.error('delete not supported')
    }
    // instance must not already be deleted
    if (this.isDeleted) {
        throw this.error('record already deleted')
    }
    // check access to delete unless allow set
    if (!args.allow) {
        // get global access control instance
        var accessControl = ImmutableAccessControl.getGlobal()
        // check access
        var allow = accessControl.allowModel({
            action: 'delete',
            model: this.model.name,
            scope: this.scope,
            session: this.session,
        })
        // throw access denied error if not allowed
        if (!allow) {
            httpError(403, null, accessControl.audit)
        }
    }
    // set d(eleted) flag true
    args.delete = true
    // use update method to empty
    return this.updateMeta(args)
}
671225
@SuppressWarnings("unchecked")
    public static <T> T poll(Object key) {
        try {
            return (T) CACHE.remove(key);
        } catch (ClassCastException e) {
            System.out.print("E/Cache: Can't use cached object: wrong type");
        }
        return null;
    }
861665
@SuppressWarnings("all")
    public static Completable batchRemove(CacheConfigBean cacheConfigBean, Map<String, List<String>> batchRemoves) {
        return SingleRxXian
                .call(CacheService.CACHE_SERVICE, "cacheMapBatchRemove", new JSONObject() {{
                    put("cacheConfig", cacheConfigBean);
                    put("batchRemoves", batchRemoves);
                }})
                .map(UnitResponse::throwExceptionIfNotSuccess)
                .toCompletable();
    }