// SetCacheLength sets the CacheLength field's value.
753
func (s *RtmpGroupSettings) SetCacheLength(v int64) *RtmpGroupSettings {
	s.CacheLength = &v
	return s
}
940099
func (s *CacheCluster) SetNumCacheNodes(v int64) *CacheCluster {
	s.NumCacheNodes = &v
	return s
}
835948
func (s *PurchaseReservedCacheNodesOfferingOutput) SetReservedCacheNode(v *ReservedCacheNode) *PurchaseReservedCacheNodesOfferingOutput {
	s.ReservedCacheNode = v
	return s
}
400966
func (s *ReplicationGroup) SetCacheNodeType(v string) *ReplicationGroup {
	s.CacheNodeType = &v
	return s
}
465581
func (bg *Reader) SetCache(c Cache) {
	bg.mu.Lock()
	bg.cache = c
	bg.mu.Unlock()
}
851360
func (i18n *I18n) SetCacheStore(cacheStore cache.CacheStoreInterface) {
	i18n.cacheStore = cacheStore
	i18n.loadToCacheStore()
}
587989
func (user *User) SetCache(key string, val interface{}, ttl time.Duration) error {
	expiresAt := time.Now().Add(ttl)

	serviceID := user.ctx.getServiceID()
	key = strings.ToLower(key)

	if val == nil {
		err := user.ctx.db.C("users_cache").Remove(bson.M{"userid": user.ID, "service": serviceID, "key": key})
		return err
	}
	_, err := user.ctx.db.C("users_cache").Upsert(bson.M{"userid": user.ID, "service": serviceID, "key": key}, bson.M{"$set": bson.M{"val": val, "expiresat": expiresAt}})
	if err != nil {
		// workaround for WiredTiger bug: https://jira.mongodb.org/browse/SERVER-14322
		if mgo.IsDup(err) {
			return user.ctx.db.C("users_cache").Update(bson.M{"userid": user.ID, "service": serviceID, "key": key}, bson.M{"$set": bson.M{"val": val, "expiresat": expiresAt}})
		}
		log.WithError(err).WithField("key", key).Error("Can't set user cache value")
	}
	return err
}
855142
func (s *CacheNode) SetCacheNodeId(v string) *CacheNode {
	s.CacheNodeId = &v
	return s
}
866143
func (c *ConfigLocal) SetMDCache(m MDCache) {
	c.lock.Lock()
	defer c.lock.Unlock()
	c.mdcache = m
}
756891
func (s *ModifyReplicationGroupInput) SetCacheNodeType(v string) *ModifyReplicationGroupInput {
	s.CacheNodeType = &v
	return s
}
1374840
func (s *MethodSetting) SetCachingEnabled(v bool) *MethodSetting {
	s.CachingEnabled = &v
	return s
}
985199
func (s *CacheNode) SetCacheNodeStatus(v string) *CacheNode {
	s.CacheNodeStatus = &v
	return s
}
857170
func (s *RegisterCACertificateInput) SetCaCertificate(v string) *RegisterCACertificateInput {
	s.CaCertificate = &v
	return s
}
1141703
func (s *ModifyCacheClusterOutput) SetCacheCluster(v *CacheCluster) *ModifyCacheClusterOutput {
	s.CacheCluster = v
	return s
}
697785
func cacheExpiry(c context.Context) time.Duration {
	rnd := time.Duration(mathrand.Int63n(c, int64(time.Minute)))
	return 4*time.Minute + rnd
}
1246860
func (m *MultiLRUCache) SetExpireGracePeriod(p time.Duration) {
	for _, c := range m.cache {
		c.ExpireGracePeriod = p
	}
}
908887
func (s *NodeGroupMember) SetCacheNodeId(v string) *NodeGroupMember {
	s.CacheNodeId = &v
	return s
}