Documentation
¶
Overview ¶
Copyright 2022 Huawei Cloud Computing Technologies Co., Ltd.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. nolint
Index ¶
Constants ¶
const ( DefaultLocalCacheLen = 8 MaxLocalCacheLen = 64 DefaultMaxLocalEleMemSize = 2 * 1024 * 1024 DefaultMaxEleMemSize = 128 * 1024 * 1024 )
Variables ¶
var RowsPool sync.Pool
Functions ¶
func GetIntSlice ¶ added in v1.3.0
func PutIntSlice ¶ added in v1.3.0
func PutIntSlice(v []int)
Types ¶
type Allocator ¶ added in v1.4.1
type Allocator[K comparable, V any] struct { // contains filtered or unexported fields }
func NewAllocator ¶ added in v1.4.1
func NewAllocator[K comparable, V any]() *Allocator[K, V]
type Buffer ¶ added in v1.2.0
func GetChunkMetaBuffer ¶ added in v1.2.0
func GetChunkMetaBuffer() (*Buffer, func())
type FixedPool ¶ added in v1.1.0
type FixedPool struct {
// contains filtered or unexported fields
}
func (*FixedPool) Reset ¶ added in v1.1.0
func (p *FixedPool) Reset(size int, new func() interface{}, hook *HitRatioHook)
type HitRatioHook ¶ added in v1.1.0
func NewHitRatioHook ¶ added in v1.1.0
func NewHitRatioHook(total, hit func(int64)) *HitRatioHook
type ListPool ¶ added in v1.0.0
type ListPool struct {
// contains filtered or unexported fields
}
func NewListPool ¶ added in v1.0.0
func NewListPool() *ListPool
type MemSizeSupported ¶ added in v1.4.0
type Uint32Array ¶
type Uint32Array struct {
// contains filtered or unexported fields
}
func NewUint32Array ¶
func NewUint32Array() *Uint32Array
func (*Uint32Array) Get ¶
func (u *Uint32Array) Get(size int) []uint32
func (*Uint32Array) HitRatio ¶
func (u *Uint32Array) HitRatio() float64
func (*Uint32Array) Put ¶
func (u *Uint32Array) Put(v *[]uint32)
type UnionPool ¶ added in v1.4.0
type UnionPool[T any] struct { // contains filtered or unexported fields }
func NewDefaultUnionPool ¶ added in v1.4.0
func NewUnionPool ¶ added in v1.4.0
func (*UnionPool[T]) EnableHitRatioStat ¶ added in v1.4.0
EnableHitRatioStat Enable statistics on the hit ratio of the object pool two metrics "{name}GetTotal" and "{name}HitTotal" are added to the hitRatio table
func (*UnionPool[T]) EnableStatLocalMemSize ¶ added in v1.4.0
func (p *UnionPool[T]) EnableStatLocalMemSize()
func (*UnionPool[T]) LocalMemorySize ¶ added in v1.4.0
func (*UnionPool[T]) Put ¶ added in v1.4.0
func (p *UnionPool[T]) Put(v MemSizeSupported[T])
Put object v back into the object pool Object v must implement the MemSizeSupported interface Otherwise, use the PutWithMemSize method instead