// SetCapacity sets the cache capacity to the specified number of elements. If
// the new capacity is smaller than the current cache size, elements are
// automatically evicted until the desired size is reached.
196631
func (c *PoolInfoCache) SetCapacity(size int) error {
	if size < 2 {
		return fmt.Errorf("size %d is less than 2", size)
	}

	c.mtx.Lock()
	defer c.mtx.Unlock()
	c.maxSize = size
	for len(c.expireQueue) >= c.maxSize {
		expireHash := c.expireQueue[0]
		c.expireQueue = c.expireQueue[1:]
		delete(c.poolInfo, expireHash)
	}
	return nil
}
546156
func (s *ScalingConfigurationInfo) SetMaxCapacity(v int64) *ScalingConfigurationInfo {
	s.MaxCapacity = &v
	return s
}
1239633
func (s *RegisterScalableTargetInput) SetMinCapacity(v int64) *RegisterScalableTargetInput {
	s.MinCapacity = &v
	return s
}
907627
func (b *BlockCacheStandard) SetCleanBytesCapacity(capacity uint64) {
	atomic.StoreUint64(&b.cleanBytesCapacity, capacity)
}
395714
func (s *RootStorage) SetCapacity(v string) *RootStorage {
	s.Capacity = &v
	return s
}
681178
func (s *GetTemplateSummaryOutput) SetCapabilities(v []*string) *GetTemplateSummaryOutput {
	s.Capabilities = v
	return s
}
13568
func (s *FileSystem) SetStorageCapacity(v int64) *FileSystem {
	s.StorageCapacity = &v
	return s
}
1351956
func (s *ScalingConstraints) SetMinCapacity(v int64) *ScalingConstraints {
	s.MinCapacity = &v
	return s
}
386960
func (s *JobRun) SetAllocatedCapacity(v int64) *JobRun {
	s.AllocatedCapacity = &v
	return s
}
215268
func (s *CreateJobInput) SetMaxCapacity(v float64) *CreateJobInput {
	s.MaxCapacity = &v
	return s
}
436223
func (n *BuilderNode) SetCapacity(v int) {
	n.builder.ring.NodeToCapacity[n.index] = v
}
521077
func (s *ScalingConfiguration) SetMaxCapacity(v int64) *ScalingConfiguration {
	s.MaxCapacity = &v
	return s
}
657895
func (s *OrderableDBInstanceOption) SetMaxStorageSize(v int64) *OrderableDBInstanceOption {
	s.MaxStorageSize = &v
	return s
}
676942
func (s *Group) SetDesiredCapacity(v int64) *Group {
	s.DesiredCapacity = &v
	return s
}
469034
func (s *CreateAutoScalingGroupInput) SetDesiredCapacity(v int64) *CreateAutoScalingGroupInput {
	s.DesiredCapacity = &v
	return s
}
914530
func (s *CreateJobInput) SetAllocatedCapacity(v int64) *CreateJobInput {
	s.AllocatedCapacity = &v
	return s
}
1357217
func (s *CreateFileSystemInput) SetStorageCapacity(v int64) *CreateFileSystemInput {
	s.StorageCapacity = &v
	return s
}