Cache the given shard.
762361
private void cacheShardValue(TableDefinition tableDef,
                                 Integer         shardNumber,
                                 Date            shardStart) {
        // Get or create the app name -> table map
        String appName = tableDef.getAppDef().getAppName();
        Map<String, Map<Integer, Date>> tableShardNumberMap = m_appShardMap.get(appName);
        if (tableShardNumberMap == null) {
            tableShardNumberMap = new HashMap<String, Map<Integer,Date>>();
            m_appShardMap.put(appName, tableShardNumberMap);
        }
        
        // Get or create the table name -> shard number map
        String tableName = tableDef.getTableName();
        Map<Integer, Date> shardNumberMap = tableShardNumberMap.get(tableName);
        if (shardNumberMap == null) {
            shardNumberMap = new HashMap<Integer, Date>();
            tableShardNumberMap.put(tableName, shardNumberMap);
        }
        
        // Add the shard number -> start date
        shardNumberMap.put(shardNumber, shardStart);
        m_logger.debug("Sharding date for {}.{} shard #{} set to: {} ({})",
                       new Object[]{appName, tableName, shardNumber, shardStart.getTime(), Utils.formatDateUTC(shardStart)});
    }
687007
def FlushCache(self):
    """"""
    self._cache = b''
    self._cache_start_offset = None
    self._cache_end_offset = None
    self._ResetDecompressorState()
1297379
def save(self, expires=None):
        """"""

        if expires is None:
            expires = self.expires
        s = self.serialize()
        key = self._key(self._all_keys())
        _cache.set(key, s, expires)
973751
def cache(cache_directory_path):
    """"""
    if not cache_directory_path:
        click.secho(dtool_config.utils.get_cache(
            CONFIG_PATH,
        ))
    else:
        click.secho(dtool_config.utils.set_cache(
            CONFIG_PATH,
            cache_directory_path
        ))
17002
def cache_incr(self, key):
        
        cache.set(key, cache.get(key, 0) + 1, self.expire_after())
970765
def set_hash(self, algo, digest):
        """"""
        self.algo = algo
        self.digest = digest
1163069
def cache_generator(self, key, generator):
        """"""
        results = []
        for result in generator:
            results.append(result)
            yield result

        self.inferred[key] = tuple(results)
789879
def memoize(f):
    """"""
    def _c(*args, **kwargs):
        if not hasattr(f, 'cache'):
            f.cache = dict()
        key = (args, tuple(kwargs))
        if key not in f.cache:
            f.cache[key] = f(*args, **kwargs)
        return f.cache[key]
    return wraps(f)(_c)
896503
def _set_cache_(self, attr):
        """"""
        if attr == "size":
            oinfo = self.repo.odb.info(self.binsha)
            self.size = oinfo.size
            # assert oinfo.type == self.type, _assertion_msg_format % (self.binsha, oinfo.type, self.type)
        else:
            super(Object, self)._set_cache_(attr)
173179
def cache_page(page_cache, page_hash, cache_size):
    """"""
    page_cache.append(page_hash)
    if len(page_cache) > cache_size:
        page_cache.pop(0)
897343
public void cache(Integer key, Object value) {
        synchronized (this) {
            Integer curkey = keys.get(value);
            // Already cached?
            if (curkey != null) return;
            cache.put(key, value);
            keys.put(value, key);
        }
    }
384140
protected final void cacheClear() {

        int i = sysTables.length;

        while (i-- > 0) {
            Table t = sysTables[i];

            if (t != null) {
                t.clearAllData(session);
            }

            sysTableSessions[i] = null;
        }

        isDirty = false;
    }
1090426
def cache_set(self, to_cache):
        
        self.cache.set(self.cache_key, to_cache, self.expire_time)
20105
def distribute(self, cache):
        
        data = self._features_as_kv()
        for key in data.keys():
            cache.batch_set(data[key])
512755
def _update_descriptor(self, state, allocation):
        ''''''
        if state.descriptor.shard is None or state.descriptor.shard == 'lobby':
            own_shard = state.agent.get_shard_id()
            state.descriptor.shard = own_shard
        state.descriptor.resources = allocation.alloc
        f = fiber.succeed(state.descriptor)
        f.add_callback(state.agent.save_document)
        f.add_callback(self._store_descriptor)
        return f
572007
protected void putIntoCache(List<HalResource<?>> notCachedResources) {
    Cache cache = getCache();
    for (HalResource<?> notCachedResource : notCachedResources) {
      cache.put(getResourceId(notCachedResource), notCachedResource);
    }
  }
493187
function ShardTable(shardCount) {
    return (target) => {
        const args = {
            shardCount,
            className: target.name,
        };
        if (args.className.indexOf('_') < 0) {
            EntityStorage_1.EntityStorage.instance.shardTableMetadataStorage[target.name] = args;
        }
    };
}