Returns the read cache for this setup, creating it if necessary.

    Returns None if no read cache is configured.
344510
def get_read_cache(self):
    
    if self._options.read_from and not self._read_cache:
      cache_spec = self._resolve(self._sanitize_cache_spec(self._options.read_from))
      if cache_spec:
        with self._cache_setup_lock:
          self._read_cache = self._do_create_artifact_cache(cache_spec, 'will read from')
    return self._read_cache
944391
def get_default_driver(self):
        
        if 'default' in self._config:
            return self._config['default']

        if len(self._config['stores']) == 1:
            return list(self._config['stores'].keys())[0]

        raise RuntimeError('Missing "default" cache in configuration.')
506267
def read(cls, source, *args, **kwargs):
    
    # if reading a cache, read it now and sieve
    if io_cache.is_cache(source):
        from .cache import preformat_cache
        source = preformat_cache(source, *args[1:],
                                 start=kwargs.get('start'),
                                 end=kwargs.get('end'))

    # get join arguments
    pad = kwargs.pop('pad', None)
    gap = kwargs.pop('gap', 'raise' if pad is None else 'pad')
    joiner = _join_factory(cls, gap, pad)

    # read
    return io_read_multi(joiner, cls, source, *args, **kwargs)
883911
def tryload_cache(dpath, fname, cfgstr, verbose=None):
    
    try:
        return load_cache(dpath, fname, cfgstr, verbose=verbose)
    except IOError:
        return None
853606
def _read_cache_from_file(self):
        """"""
        cache = {}
        try:
            with(open(self._cache_file_name, 'r')) as fp:
                contents = fp.read()
                cache = simplejson.loads(contents)
        except (IOError, JSONDecodeError):
            # The file could not be read. This is not a problem if the file does not exist.
            pass

        return cache
906328
def cache(opts, serial):
    '''
    
    '''
    return LazyLoader(
        _module_dirs(opts, 'cache', 'cache'),
        opts,
        tag='cache',
        pack={'__opts__': opts, '__context__': {'serial': serial}},
    )
401042
def cache(key)
      key_hash = key2hash(key)
      read(key_hash) || (write(key_hash, yield) if block_given?)
    end
631210
def _get_default_cache_dir(self):
        

        return os.path.join(os.path.dirname(__file__), self._DATA_DIR)
533645
private void createReadCaches() {
		recalculateSizeReadCaches();
		if (log.isDebugEnabled()) {
			log.debug(this.getClass().getName() + "::createReadCaches readCacheInternal=" + readCacheInternal
					+ " readCacheLeaf=" + readCacheLeaf);
		}
		cacheInternalNodes = createCacheLRUlinked(readCacheInternal);
		cacheLeafNodes = createCacheLRUlinked(readCacheLeaf);
	}
213748
def cache(self):
        
        self.is_cached = True
        self.persist(StorageLevel.MEMORY_ONLY)
        return self
310554
def fetch(self):
        '''
        
        '''
        if self._fetched is not None:
            raise RuntimeError('fetch() was called but the previous one has '
                               'not yet been applied. Not supported')
        if self._cache:
            self._fetched = len(self._cache)
        return self._cache[0:self._fetched]
575086
def get(self, alias: str):
        
        try:
            return self._caches[alias]
        except KeyError:
            pass

        config = self.get_alias_config(alias)
        cache = _create_cache(**deepcopy(config))
        self._caches[alias] = cache
        return cache
191639
def read_cache_fixtures!
      files = cache_files
      files.each do |file|
        cache_key = get_cache_key_from_filename(file)
        responses[cache_key] = Marshal.load(File.read(file))
      end
    end
297767
def get_memory_cache(self, key=None):
        """"""
        key = self.model.hash if key is None else key
        self._results = self.memory_cache.get(key)
        return self._results
456702
async def read(self):
        
        result = await self._queue.get()

        self._can_write.set()

        if self._queue.empty():
            self._can_read.clear()

        return result
731006
private Cache<QueryCacheKey, Object> getCache() {
      final Cache<QueryCacheKey, Object> cache = lazyCache;

      //Most likely branch first:
      if (cache != null) {
         return cache;
      }
      synchronized (this) {
         if (lazyCache == null) {
            // define the query cache configuration if it does not already exist (from a previous call or manually defined by the user)
            internalCacheRegistry.registerInternalCache(QUERY_CACHE_NAME, getQueryCacheConfig().build(), EnumSet.noneOf(InternalCacheRegistry.Flag.class));
            lazyCache = cacheManager.getCache(QUERY_CACHE_NAME);
         }
         return lazyCache;
      }
   }
463465
private File getCacheDir() {
		// Get the root cache dir
		File cacheDir = new File(configuration.getOptimizerCacheDir());
		if (!cacheDir.exists()) {
			cacheDir.mkdir();
		}

		// Get the directory that represent the host directory
		// return FootprintGenerator.footprint(getMandatory(P_ROX_URL));
		File roxCacheDir = new File(cacheDir, configuration.getServerConfiguration().getBaseUrlFootprint());
		if (!roxCacheDir.exists()) {
			roxCacheDir.mkdirs();
		}
		
		return roxCacheDir;
	}