Documentation ¶
Index ¶
- Constants
- Variables
- func AllocParallelismRes(resourceType ResourceType, num int64) (int64, error)
- func AllocRes(resourceType ResourceType, num int64) (int64, int64, error)
- func DefaultSeriesAllocateFunc(seriesNum int64) error
- func FreeParallelismRes(resourceType ResourceType, num, totalNum 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 ErrResTypeNotFound = errors.New("resource type not found")
Functions ¶
func AllocParallelismRes ¶ added in v1.1.0
func AllocParallelismRes(resourceType ResourceType, num int64) (int64, error)
func FreeParallelismRes ¶ added in v1.1.0
func FreeParallelismRes(resourceType ResourceType, num, totalNum int64) error
func FreeRes ¶
func FreeRes(resourceType ResourceType, num, totalNum int64) error
func InitResAllocator ¶
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) AllocParallelism ¶ added in v1.1.0
func (p *ChunkReaderResAllocator) AllocParallelism(num int64) (int64, error)
not use
func (*ChunkReaderResAllocator) Free ¶
func (p *ChunkReaderResAllocator) Free(num, totalNum int64)
func (*ChunkReaderResAllocator) FreeParallelism ¶ added in v1.1.0
func (p *ChunkReaderResAllocator) FreeParallelism(num int64, 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) AllocParallelism ¶ added in v1.1.0
func (s *SeriesResAllocator) AllocParallelism(num int64) (int64, error)
not use
func (*SeriesResAllocator) Free ¶
func (s *SeriesResAllocator) Free(num, totalNum int64)
func (*SeriesResAllocator) FreeParallelism ¶ added in v1.1.0
func (s *SeriesResAllocator) FreeParallelism(num int64, totalNum int64)
not use
type ShardParallelismAllocator ¶
type ShardParallelismAllocator struct {
// contains filtered or unexported fields
}
func (*ShardParallelismAllocator) Alloc ¶
func (s *ShardParallelismAllocator) Alloc(num int64) (int64, int64, error)
func (*ShardParallelismAllocator) AllocParallelism ¶ added in v1.1.0
func (s *ShardParallelismAllocator) AllocParallelism(num int64) (int64, error)
func (*ShardParallelismAllocator) Free ¶
func (s *ShardParallelismAllocator) Free(num, totalNum int64)
func (*ShardParallelismAllocator) FreeParallelism ¶ added in v1.1.0
func (s *ShardParallelismAllocator) FreeParallelism(num int64, totalNum int64)
Click to show internal directories.
Click to hide internal directories.