Documentation
¶
Index ¶
- Constants
- Variables
- func AllocRes(resourceType ResourceType, num int64) (int64, int64, error)
- func DefaultSeriesAllocateFunc(seriesNum int64) error
- func FreeRes(resourceType ResourceType, num, totalNum int64) error
- func InitResAllocator(threshold, minAllocNum, minShardsAllocNum, funcType int64, ...) error
- type BaseResAllocator
- type ChunkReaderResAllocator
- type ResourceManager
- type ResourceType
- type SeriesResAllocator
- type ShardParallelismAllocator
Constants ¶
View Source
const ( DefaultMaxSeriesParallelismNumRatio = 1000000 DefaultMinimumConcurrency = 1 DefaultWaitTimeOut = time.Minute )
View Source
const (
GradientDesc = iota
)
Variables ¶
View Source
var ResTypeNotFound = errors.New("resource type not found")
Functions ¶
func FreeRes ¶
func FreeRes(resourceType ResourceType, num, totalNum int64) error
func InitResAllocator ¶
func InitResAllocator(threshold, minAllocNum, minShardsAllocNum, funcType int64, resType ResourceType, maxWaitTime time.Duration) error
Types ¶
type BaseResAllocator ¶
type BaseResAllocator struct {
// contains filtered or unexported fields
}
func NewBaseResAllocator ¶
func NewBaseResAllocator(threshold, minAllocNum, funcType int64) (*BaseResAllocator, error)
func (*BaseResAllocator) Free ¶
func (p *BaseResAllocator) Free(num, totalNum int64)
type ChunkReaderResAllocator ¶
type ChunkReaderResAllocator struct {
// contains filtered or unexported fields
}
func NewChunkReaderResAllocator ¶
func NewChunkReaderResAllocator(threshold, minAllocNum, funcType int64) (*ChunkReaderResAllocator, error)
func (*ChunkReaderResAllocator) Alloc ¶
func (p *ChunkReaderResAllocator) Alloc(num int64) (int64, int64, error)
func (*ChunkReaderResAllocator) Free ¶
func (p *ChunkReaderResAllocator) Free(num, totalNum int64)
type ResourceManager ¶
type ResourceType ¶
type ResourceType int64
const ( ChunkReaderRes ResourceType = iota ShardsParallelismRes SeriesParallelismRes Bottom )
type SeriesResAllocator ¶
type SeriesResAllocator struct {
// contains filtered or unexported fields
}
func NewSeriesParallelismAllocator ¶
func NewSeriesParallelismAllocator(maxTime time.Duration, maxSeriesParallelism int64) *SeriesResAllocator
func (*SeriesResAllocator) Alloc ¶
func (s *SeriesResAllocator) Alloc(num int64) (int64, int64, error)
func (*SeriesResAllocator) Free ¶
func (s *SeriesResAllocator) Free(num, totalNum int64)
type ShardParallelismAllocator ¶
type ShardParallelismAllocator struct {
// contains filtered or unexported fields
}
func NewShardsParallelismAllocator ¶
func NewShardsParallelismAllocator(maxTime time.Duration, maxShardsParallelism, minShardsAllocNum int64) (*ShardParallelismAllocator, error)
func (*ShardParallelismAllocator) Alloc ¶
func (s *ShardParallelismAllocator) Alloc(num int64) (int64, int64, error)
func (*ShardParallelismAllocator) Free ¶
func (s *ShardParallelismAllocator) Free(num, totalNum int64)
Click to show internal directories.
Click to hide internal directories.