Setup the context for no aggressive caching
<p>
This is mainly useful for internal use inside RavenDB, when we are executing
queries that have been marked with WaitForNonStaleResults, we temporarily disable
aggressive caching.
766441
public CleanCloseable disableAggressiveCaching(String databaseName) {
        assertInitialized();
        RequestExecutor re = getRequestExecutor(ObjectUtils.firstNonNull(databaseName, getDatabase()));
        AggressiveCacheOptions old = re.aggressiveCaching.get();
        re.aggressiveCaching.set(null);

        return () -> re.aggressiveCaching.set(old);
    }
770957
function(fnc, cacheId, delay, scope, parameters, strategy) {
            var self = this,
                LOOP = "loop";

            if (!fnc) {
                return;
            }

            cacheId = cacheId || fnc.toString();
            scope = scope || this;
            parameters = parameters || [];
            strategy = strategy || LOOP;

            if (delay === 0) {
                // immediately invoke function
                fnc.apply(scope, parameters);
                return;
            }

            delay = delay || 300;
            if (this.$debounceTimeoutMap[cacheId]) {
                // timer registered

                if (strategy === LOOP) {
                    return;
                }

                clearTimeout(this.$debounceTimeoutMap[cacheId]);
            }

            this.$debounceTimeoutMap[cacheId] = setTimeout(function() {
                delete self.$debounceTimeoutMap[cacheId];
                fnc.apply(scope, parameters);
            }, delay);
        }
772480
public ContextPropertiesCache put(String key, String value) {
    checkArgument(key != null, "Key of context property must not be null");
    checkArgument(value != null, "Value of context property must not be null");
    props.put(key, value);
    return this;
  }
223148
public static void init(Context context, String name, int version, int cacheSize) {
		init(context, name, version, cacheSize, LogLevel.NONE);
	}
587444
@Override
  protected void configureQuery(@SuppressWarnings("rawtypes") AbstractQuery query, Resource resource) {
    Context.getCommandContext()
      .getAuthorizationManager()
      .configureQuery(query, resource);
  }
829660
public void configureExecutionQuery(AbstractQuery query) {
    configureQuery(query);
    CompositePermissionCheck permissionCheck = new PermissionCheckBuilder()
        .disjunctive()
        .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
        .atomicCheck(PROCESS_DEFINITION, "P.KEY_", READ_INSTANCE)
        .build();
    addPermissionCheck(query.getAuthCheck(), permissionCheck);
  }
767873
public static void setAccessContextOnThread(AccessContext accessContext) {
        if (accessContext == null) {
            String msg = "The argument[accessContext] must not be null.";
            throw new IllegalArgumentException(msg);
        }
        Stack<AccessContext> stack = threadLocal.get();
        if (stack == null) {
            stack = new Stack<AccessContext>();
            threadLocal.set(stack);
        }
        stack.add(accessContext);
    }
365458
@Override
    public CacheConfiguration<K, V> removeCacheEntryListenerConfiguration(
            CacheEntryListenerConfiguration<K, V> cacheEntryListenerConfiguration) {
        checkNotNull(cacheEntryListenerConfiguration, "CacheEntryListenerConfiguration can't be null");
        DeferredValue<CacheEntryListenerConfiguration<K, V>> lazyConfig =
                DeferredValue.withValue(cacheEntryListenerConfiguration);
        listenerConfigurations.remove(lazyConfig);
        return this;
    }
1362648
public static void popContext() {
        Deque<RpcInternalContext> deque = DEQUE_LOCAL.get();
        if (deque != null) {
            RpcInternalContext context = deque.peek();
            if (context != null) {
                LOCAL.set(deque.pop());
            }
        }
    }
495768
public static void addCacheControlAndEtagToResult(Result result, String etag, ApplicationConfiguration configuration) {
        String maxAge = configuration.getWithDefault(HTTP_CACHE_CONTROL_MAX_AGE,
                HTTP_CACHE_CONTROL_DEFAULT);

        if ("0".equals(maxAge)) {
            result.with(HeaderNames.CACHE_CONTROL, "no-cache");
        } else {
            result.with(HeaderNames.CACHE_CONTROL, "max-age=" + maxAge);
        }

        // Use etag on demand:
        boolean useEtag = configuration.getBooleanWithDefault(HTTP_USE_ETAG,
                HTTP_USE_ETAG_DEFAULT);

        if (useEtag) {
            result.with(HeaderNames.ETAG, etag);
        }
    }
1077815
@Override
    public Item process(Context context, CachingOptions cachingOptions, Item item) {
        for (String xpathQuery : metaDataNodesXPathQueries) {
            String metaDataValue = item.queryDescriptorValue(xpathQuery);
            if (StringUtils.isNotEmpty(metaDataValue)) {
                item.setProperty(xpathQuery, metaDataValue);
            }
        }

        return item;
    }
436717
@Override
	public void cacheResult(List<CPInstance> cpInstances) {
		for (CPInstance cpInstance : cpInstances) {
			if (entityCache.getResult(
						CPInstanceModelImpl.ENTITY_CACHE_ENABLED,
						CPInstanceImpl.class, cpInstance.getPrimaryKey()) == null) {
				cacheResult(cpInstance);
			}
			else {
				cpInstance.resetOriginalValues();
			}
		}
	}
1360530
public CachedInstanceQuery getCachedQuery4Request()
    {
        if (this.query == null) {
            try {
                this.query = CachedInstanceQuery.get4Request(this.typeUUID)
                                .setIncludeChildTypes(isIncludeChildTypes())
                                .setCompanyDependent(isCompanyDependent());
                prepareQuery();
            } catch (final EFapsException e) {
                QueryBuilder.LOG.error("Could not open InstanceQuery for uuid: {}", this.typeUUID);
            }
        }
        return (CachedInstanceQuery) this.query;
    }
554576
public function ensureProductionSettings() : void
    {
        $queryCacheImpl = $this->getQueryCacheImpl();

        if (! $queryCacheImpl) {
            throw QueryCacheNotConfigured::create();
        }

        if ($queryCacheImpl instanceof ArrayCache) {
            throw QueryCacheUsesNonPersistentCache::fromDriver($queryCacheImpl);
        }

        $metadataCacheImpl = $this->getMetadataCacheImpl();

        if (! $metadataCacheImpl) {
            throw MetadataCacheNotConfigured::create();
        }

        if ($metadataCacheImpl instanceof ArrayCache) {
            throw MetadataCacheUsesNonPersistentCache::fromDriver($metadataCacheImpl);
        }

        if ($this->getProxyManagerConfiguration()->getGeneratorStrategy() instanceof EvaluatingGeneratorStrategy) {
            throw ProxyClassesAlwaysRegenerating::create();
        }
    }
809331
function setCachedMountContext(blockchain_id, datastore_context) {

   let userData = getUserData();
   if (!userData.datastore_contexts) {
      userData.datastore_contexts = {};
   }

   userData.datastore_contexts[blockchain_id] = datastore_context;
   setUserData(userData);
}
1155616
private static void setCache(CmsObject cms, CmsXmlContainerPage xmlCntPage, boolean keepEncoding) {

        if (xmlCntPage.getFile() instanceof I_CmsHistoryResource) {
            return;
        }
        boolean online = cms.getRequestContext().getCurrentProject().isOnlineProject();
        getCache().setCacheContainerPage(
            getCache().getCacheKey(xmlCntPage.getFile().getStructureId(), keepEncoding),
            xmlCntPage,
            online);
    }
28702
def _create_execution_context(self):
        
        if hasattr(self, '_database_link'):
            # client side partitioning query
            return base_execution_context._MultiCollectionQueryExecutionContext(self._client, self._options, self._database_link, self._query, self._partition_key)
        else:
            # 
            return execution_dispatcher._ProxyQueryExecutionContext(self._client, self._collection_link, self._query, self._options, self._fetch_function)