pool

package
v0.0.0-...-ad801e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolArrayBucket

type BoolArrayBucket struct {
	// Capacity is the size of each element in the bucket.
	Capacity int

	// Count is the number of fixed elements in the bucket.
	Count int

	// Options is an optional override to specify options to use for a bucket,
	// specify nil to use the options specified to the bucketized pool
	// constructor for this bucket.
	Options *BoolArrayPoolOptions
}

BoolArrayBucket specifies a bucket.

type BoolArrayBucketConfiguration

type BoolArrayBucketConfiguration struct {
	// The count of the items in the bucket.
	Count int `yaml:"count"`

	// The capacity of each item in the bucket.
	Capacity int `yaml:"capacity"`
}

BoolArrayBucketConfiguration contains configuration for a pool bucket.

func (*BoolArrayBucketConfiguration) NewBucket

NewBucket creates a new bucket.

type BoolArrayPool

type BoolArrayPool struct {
	// contains filtered or unexported fields
}

BoolArrayPool is a value pool.

func NewBoolArrayPool

func NewBoolArrayPool(opts *BoolArrayPoolOptions) *BoolArrayPool

NewBoolArrayPool creates a new pool.

func (*BoolArrayPool) Get

func (p *BoolArrayPool) Get() []bool

Get gets a value from the pool.

func (*BoolArrayPool) Init

func (p *BoolArrayPool) Init(alloc func() []bool)

Init initializes the pool.

func (*BoolArrayPool) Put

func (p *BoolArrayPool) Put(v []bool)

Put returns a value to pool.

type BoolArrayPoolConfiguration

type BoolArrayPoolConfiguration struct {
	// The size of the pool.
	Size *int `yaml:"size"`

	// The watermark configuration.
	Watermark BoolArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BoolArrayPoolConfiguration contains pool configuration.

func (*BoolArrayPoolConfiguration) NewPoolOptions

func (c *BoolArrayPoolConfiguration) NewPoolOptions(
	instrumentOpts instrument.Options,
) *BoolArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BoolArrayPoolOptions

type BoolArrayPoolOptions struct {
	// contains filtered or unexported fields
}

BoolArrayPoolOptions provide a set of options for the value pool.

func NewBoolArrayPoolOptions

func NewBoolArrayPoolOptions() *BoolArrayPoolOptions

NewBoolArrayPoolOptions create a new set of value pool options.

func (*BoolArrayPoolOptions) InstrumentOptions

func (o *BoolArrayPoolOptions) InstrumentOptions() instrument.Options

InstrumentOptions returns the instrument options.

func (*BoolArrayPoolOptions) RefillHighWatermark

func (o *BoolArrayPoolOptions) RefillHighWatermark() float64

RefillHighWatermark returns the high watermark for stop refilling the pool.

func (*BoolArrayPoolOptions) RefillLowWatermark

func (o *BoolArrayPoolOptions) RefillLowWatermark() float64

RefillLowWatermark returns the low watermark for refilling the pool.

func (*BoolArrayPoolOptions) SetInstrumentOptions

func (o *BoolArrayPoolOptions) SetInstrumentOptions(v instrument.Options) *BoolArrayPoolOptions

SetInstrumentOptions sets the instrument options.

func (*BoolArrayPoolOptions) SetRefillHighWatermark

func (o *BoolArrayPoolOptions) SetRefillHighWatermark(v float64) *BoolArrayPoolOptions

SetRefillHighWatermark sets the high watermark for refilling the pool.

func (*BoolArrayPoolOptions) SetRefillLowWatermark

func (o *BoolArrayPoolOptions) SetRefillLowWatermark(v float64) *BoolArrayPoolOptions

SetRefillLowWatermark sets the low watermark for refilling the pool.

func (*BoolArrayPoolOptions) SetSize

SetSize sets the pool size.

func (*BoolArrayPoolOptions) Size

func (o *BoolArrayPoolOptions) Size() int

Size returns pool size.

type BoolArrayPoolWatermarkConfiguration

type BoolArrayPoolWatermarkConfiguration struct {
	// The low watermark to start refilling the pool, if zero none.
	RefillLowWatermark float64 `yaml:"low" validate:"min=0.0,max=1.0"`

	// The high watermark to stop refilling the pool, if zero none.
	RefillHighWatermark float64 `yaml:"high" validate:"min=0.0,max=1.0"`
}

BoolArrayPoolWatermarkConfiguration contains watermark configuration for pools.

type BucketizedBoolArrayPool

type BucketizedBoolArrayPool struct {
	// contains filtered or unexported fields
}

BucketizedBoolArrayPool is a bucketized value pool.

func NewBucketizedBoolArrayPool

func NewBucketizedBoolArrayPool(sizes []BoolArrayBucket, opts *BoolArrayPoolOptions) *BucketizedBoolArrayPool

NewBucketizedBoolArrayPool creates a bucketized object pool.

func (*BucketizedBoolArrayPool) Get

func (p *BucketizedBoolArrayPool) Get(capacity int) []bool

Get gets a value from the pool.

func (*BucketizedBoolArrayPool) Init

func (p *BucketizedBoolArrayPool) Init(alloc func(capacity int) []bool)

Init initializes the bucketized pool.

func (*BucketizedBoolArrayPool) Put

func (p *BucketizedBoolArrayPool) Put(v []bool, capacity int)

Put puts a value to the pool.

type BucketizedBoolArrayPoolConfiguration

type BucketizedBoolArrayPoolConfiguration struct {
	// The pool bucket configuration.
	Buckets []BoolArrayBucketConfiguration `yaml:"buckets"`

	// The watermark configuration.
	Watermark BoolArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BucketizedBoolArrayPoolConfiguration contains configuration for bucketized pools.

func (*BucketizedBoolArrayPoolConfiguration) NewBuckets

NewBuckets create a new list of buckets.

func (*BucketizedBoolArrayPoolConfiguration) NewPoolOptions

func (c *BucketizedBoolArrayPoolConfiguration) NewPoolOptions(
	instrumentOptions instrument.Options,
) *BoolArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BucketizedBytesArrayPool

type BucketizedBytesArrayPool struct {
	// contains filtered or unexported fields
}

BucketizedBytesArrayPool is a bucketized value pool.

func NewBucketizedBytesArrayPool

func NewBucketizedBytesArrayPool(sizes []BytesArrayBucket, opts *BytesArrayPoolOptions) *BucketizedBytesArrayPool

NewBucketizedBytesArrayPool creates a bucketized object pool.

func (*BucketizedBytesArrayPool) Get

func (p *BucketizedBytesArrayPool) Get(capacity int) [][]byte

Get gets a value from the pool.

func (*BucketizedBytesArrayPool) Init

func (p *BucketizedBytesArrayPool) Init(alloc func(capacity int) [][]byte)

Init initializes the bucketized pool.

func (*BucketizedBytesArrayPool) Put

func (p *BucketizedBytesArrayPool) Put(v [][]byte, capacity int)

Put puts a value to the pool.

type BucketizedBytesArrayPoolConfiguration

type BucketizedBytesArrayPoolConfiguration struct {
	// The pool bucket configuration.
	Buckets []BytesArrayBucketConfiguration `yaml:"buckets"`

	// The watermark configuration.
	Watermark BytesArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BucketizedBytesArrayPoolConfiguration contains configuration for bucketized pools.

func (*BucketizedBytesArrayPoolConfiguration) NewBuckets

NewBuckets create a new list of buckets.

func (*BucketizedBytesArrayPoolConfiguration) NewPoolOptions

func (c *BucketizedBytesArrayPoolConfiguration) NewPoolOptions(
	instrumentOptions instrument.Options,
) *BytesArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BucketizedFloat64ArrayPool

type BucketizedFloat64ArrayPool struct {
	// contains filtered or unexported fields
}

BucketizedFloat64ArrayPool is a bucketized value pool.

func NewBucketizedFloat64ArrayPool

func NewBucketizedFloat64ArrayPool(sizes []Float64ArrayBucket, opts *Float64ArrayPoolOptions) *BucketizedFloat64ArrayPool

NewBucketizedFloat64ArrayPool creates a bucketized object pool.

func (*BucketizedFloat64ArrayPool) Get

func (p *BucketizedFloat64ArrayPool) Get(capacity int) []float64

Get gets a value from the pool.

func (*BucketizedFloat64ArrayPool) Init

func (p *BucketizedFloat64ArrayPool) Init(alloc func(capacity int) []float64)

Init initializes the bucketized pool.

func (*BucketizedFloat64ArrayPool) Put

func (p *BucketizedFloat64ArrayPool) Put(v []float64, capacity int)

Put puts a value to the pool.

type BucketizedFloat64ArrayPoolConfiguration

type BucketizedFloat64ArrayPoolConfiguration struct {
	// The pool bucket configuration.
	Buckets []Float64ArrayBucketConfiguration `yaml:"buckets"`

	// The watermark configuration.
	Watermark Float64ArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BucketizedFloat64ArrayPoolConfiguration contains configuration for bucketized pools.

func (*BucketizedFloat64ArrayPoolConfiguration) NewBuckets

NewBuckets create a new list of buckets.

func (*BucketizedFloat64ArrayPoolConfiguration) NewPoolOptions

func (c *BucketizedFloat64ArrayPoolConfiguration) NewPoolOptions(
	instrumentOptions instrument.Options,
) *Float64ArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BucketizedInt64ArrayPool

type BucketizedInt64ArrayPool struct {
	// contains filtered or unexported fields
}

BucketizedInt64ArrayPool is a bucketized value pool.

func NewBucketizedInt64ArrayPool

func NewBucketizedInt64ArrayPool(sizes []Int64ArrayBucket, opts *Int64ArrayPoolOptions) *BucketizedInt64ArrayPool

NewBucketizedInt64ArrayPool creates a bucketized object pool.

func (*BucketizedInt64ArrayPool) Get

func (p *BucketizedInt64ArrayPool) Get(capacity int) []int64

Get gets a value from the pool.

func (*BucketizedInt64ArrayPool) Init

func (p *BucketizedInt64ArrayPool) Init(alloc func(capacity int) []int64)

Init initializes the bucketized pool.

func (*BucketizedInt64ArrayPool) Put

func (p *BucketizedInt64ArrayPool) Put(v []int64, capacity int)

Put puts a value to the pool.

type BucketizedInt64ArrayPoolConfiguration

type BucketizedInt64ArrayPoolConfiguration struct {
	// The pool bucket configuration.
	Buckets []Int64ArrayBucketConfiguration `yaml:"buckets"`

	// The watermark configuration.
	Watermark Int64ArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BucketizedInt64ArrayPoolConfiguration contains configuration for bucketized pools.

func (*BucketizedInt64ArrayPoolConfiguration) NewBuckets

NewBuckets create a new list of buckets.

func (*BucketizedInt64ArrayPoolConfiguration) NewPoolOptions

func (c *BucketizedInt64ArrayPoolConfiguration) NewPoolOptions(
	instrumentOptions instrument.Options,
) *Int64ArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BucketizedIntArrayPool

type BucketizedIntArrayPool struct {
	// contains filtered or unexported fields
}

BucketizedIntArrayPool is a bucketized value pool.

func NewBucketizedIntArrayPool

func NewBucketizedIntArrayPool(sizes []IntArrayBucket, opts *IntArrayPoolOptions) *BucketizedIntArrayPool

NewBucketizedIntArrayPool creates a bucketized object pool.

func (*BucketizedIntArrayPool) Get

func (p *BucketizedIntArrayPool) Get(capacity int) []int

Get gets a value from the pool.

func (*BucketizedIntArrayPool) Init

func (p *BucketizedIntArrayPool) Init(alloc func(capacity int) []int)

Init initializes the bucketized pool.

func (*BucketizedIntArrayPool) Put

func (p *BucketizedIntArrayPool) Put(v []int, capacity int)

Put puts a value to the pool.

type BucketizedIntArrayPoolConfiguration

type BucketizedIntArrayPoolConfiguration struct {
	// The pool bucket configuration.
	Buckets []IntArrayBucketConfiguration `yaml:"buckets"`

	// The watermark configuration.
	Watermark IntArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BucketizedIntArrayPoolConfiguration contains configuration for bucketized pools.

func (*BucketizedIntArrayPoolConfiguration) NewBuckets

NewBuckets create a new list of buckets.

func (*BucketizedIntArrayPoolConfiguration) NewPoolOptions

func (c *BucketizedIntArrayPoolConfiguration) NewPoolOptions(
	instrumentOptions instrument.Options,
) *IntArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BytesArrayBucket

type BytesArrayBucket struct {
	// Capacity is the size of each element in the bucket.
	Capacity int

	// Count is the number of fixed elements in the bucket.
	Count int

	// Options is an optional override to specify options to use for a bucket,
	// specify nil to use the options specified to the bucketized pool
	// constructor for this bucket.
	Options *BytesArrayPoolOptions
}

BytesArrayBucket specifies a bucket.

type BytesArrayBucketConfiguration

type BytesArrayBucketConfiguration struct {
	// The count of the items in the bucket.
	Count int `yaml:"count"`

	// The capacity of each item in the bucket.
	Capacity int `yaml:"capacity"`
}

BytesArrayBucketConfiguration contains configuration for a pool bucket.

func (*BytesArrayBucketConfiguration) NewBucket

NewBucket creates a new bucket.

type BytesArrayPool

type BytesArrayPool struct {
	// contains filtered or unexported fields
}

BytesArrayPool is a value pool.

func NewBytesArrayPool

func NewBytesArrayPool(opts *BytesArrayPoolOptions) *BytesArrayPool

NewBytesArrayPool creates a new pool.

func (*BytesArrayPool) Get

func (p *BytesArrayPool) Get() [][]byte

Get gets a value from the pool.

func (*BytesArrayPool) Init

func (p *BytesArrayPool) Init(alloc func() [][]byte)

Init initializes the pool.

func (*BytesArrayPool) Put

func (p *BytesArrayPool) Put(v [][]byte)

Put returns a value to pool.

type BytesArrayPoolConfiguration

type BytesArrayPoolConfiguration struct {
	// The size of the pool.
	Size *int `yaml:"size"`

	// The watermark configuration.
	Watermark BytesArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

BytesArrayPoolConfiguration contains pool configuration.

func (*BytesArrayPoolConfiguration) NewPoolOptions

func (c *BytesArrayPoolConfiguration) NewPoolOptions(
	instrumentOpts instrument.Options,
) *BytesArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type BytesArrayPoolOptions

type BytesArrayPoolOptions struct {
	// contains filtered or unexported fields
}

BytesArrayPoolOptions provide a set of options for the value pool.

func NewBytesArrayPoolOptions

func NewBytesArrayPoolOptions() *BytesArrayPoolOptions

NewBytesArrayPoolOptions create a new set of value pool options.

func (*BytesArrayPoolOptions) InstrumentOptions

func (o *BytesArrayPoolOptions) InstrumentOptions() instrument.Options

InstrumentOptions returns the instrument options.

func (*BytesArrayPoolOptions) RefillHighWatermark

func (o *BytesArrayPoolOptions) RefillHighWatermark() float64

RefillHighWatermark returns the high watermark for stop refilling the pool.

func (*BytesArrayPoolOptions) RefillLowWatermark

func (o *BytesArrayPoolOptions) RefillLowWatermark() float64

RefillLowWatermark returns the low watermark for refilling the pool.

func (*BytesArrayPoolOptions) SetInstrumentOptions

func (o *BytesArrayPoolOptions) SetInstrumentOptions(v instrument.Options) *BytesArrayPoolOptions

SetInstrumentOptions sets the instrument options.

func (*BytesArrayPoolOptions) SetRefillHighWatermark

func (o *BytesArrayPoolOptions) SetRefillHighWatermark(v float64) *BytesArrayPoolOptions

SetRefillHighWatermark sets the high watermark for refilling the pool.

func (*BytesArrayPoolOptions) SetRefillLowWatermark

func (o *BytesArrayPoolOptions) SetRefillLowWatermark(v float64) *BytesArrayPoolOptions

SetRefillLowWatermark sets the low watermark for refilling the pool.

func (*BytesArrayPoolOptions) SetSize

SetSize sets the pool size.

func (*BytesArrayPoolOptions) Size

func (o *BytesArrayPoolOptions) Size() int

Size returns pool size.

type BytesArrayPoolWatermarkConfiguration

type BytesArrayPoolWatermarkConfiguration struct {
	// The low watermark to start refilling the pool, if zero none.
	RefillLowWatermark float64 `yaml:"low" validate:"min=0.0,max=1.0"`

	// The high watermark to stop refilling the pool, if zero none.
	RefillHighWatermark float64 `yaml:"high" validate:"min=0.0,max=1.0"`
}

BytesArrayPoolWatermarkConfiguration contains watermark configuration for pools.

type Float64ArrayBucket

type Float64ArrayBucket struct {
	// Capacity is the size of each element in the bucket.
	Capacity int

	// Count is the number of fixed elements in the bucket.
	Count int

	// Options is an optional override to specify options to use for a bucket,
	// specify nil to use the options specified to the bucketized pool
	// constructor for this bucket.
	Options *Float64ArrayPoolOptions
}

Float64ArrayBucket specifies a bucket.

type Float64ArrayBucketConfiguration

type Float64ArrayBucketConfiguration struct {
	// The count of the items in the bucket.
	Count int `yaml:"count"`

	// The capacity of each item in the bucket.
	Capacity int `yaml:"capacity"`
}

Float64ArrayBucketConfiguration contains configuration for a pool bucket.

func (*Float64ArrayBucketConfiguration) NewBucket

NewBucket creates a new bucket.

type Float64ArrayPool

type Float64ArrayPool struct {
	// contains filtered or unexported fields
}

Float64ArrayPool is a value pool.

func NewFloat64ArrayPool

func NewFloat64ArrayPool(opts *Float64ArrayPoolOptions) *Float64ArrayPool

NewFloat64ArrayPool creates a new pool.

func (*Float64ArrayPool) Get

func (p *Float64ArrayPool) Get() []float64

Get gets a value from the pool.

func (*Float64ArrayPool) Init

func (p *Float64ArrayPool) Init(alloc func() []float64)

Init initializes the pool.

func (*Float64ArrayPool) Put

func (p *Float64ArrayPool) Put(v []float64)

Put returns a value to pool.

type Float64ArrayPoolConfiguration

type Float64ArrayPoolConfiguration struct {
	// The size of the pool.
	Size *int `yaml:"size"`

	// The watermark configuration.
	Watermark Float64ArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

Float64ArrayPoolConfiguration contains pool configuration.

func (*Float64ArrayPoolConfiguration) NewPoolOptions

func (c *Float64ArrayPoolConfiguration) NewPoolOptions(
	instrumentOpts instrument.Options,
) *Float64ArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type Float64ArrayPoolOptions

type Float64ArrayPoolOptions struct {
	// contains filtered or unexported fields
}

Float64ArrayPoolOptions provide a set of options for the value pool.

func NewFloat64ArrayPoolOptions

func NewFloat64ArrayPoolOptions() *Float64ArrayPoolOptions

NewFloat64ArrayPoolOptions create a new set of value pool options.

func (*Float64ArrayPoolOptions) InstrumentOptions

func (o *Float64ArrayPoolOptions) InstrumentOptions() instrument.Options

InstrumentOptions returns the instrument options.

func (*Float64ArrayPoolOptions) RefillHighWatermark

func (o *Float64ArrayPoolOptions) RefillHighWatermark() float64

RefillHighWatermark returns the high watermark for stop refilling the pool.

func (*Float64ArrayPoolOptions) RefillLowWatermark

func (o *Float64ArrayPoolOptions) RefillLowWatermark() float64

RefillLowWatermark returns the low watermark for refilling the pool.

func (*Float64ArrayPoolOptions) SetInstrumentOptions

SetInstrumentOptions sets the instrument options.

func (*Float64ArrayPoolOptions) SetRefillHighWatermark

func (o *Float64ArrayPoolOptions) SetRefillHighWatermark(v float64) *Float64ArrayPoolOptions

SetRefillHighWatermark sets the high watermark for refilling the pool.

func (*Float64ArrayPoolOptions) SetRefillLowWatermark

func (o *Float64ArrayPoolOptions) SetRefillLowWatermark(v float64) *Float64ArrayPoolOptions

SetRefillLowWatermark sets the low watermark for refilling the pool.

func (*Float64ArrayPoolOptions) SetSize

SetSize sets the pool size.

func (*Float64ArrayPoolOptions) Size

func (o *Float64ArrayPoolOptions) Size() int

Size returns pool size.

type Float64ArrayPoolWatermarkConfiguration

type Float64ArrayPoolWatermarkConfiguration struct {
	// The low watermark to start refilling the pool, if zero none.
	RefillLowWatermark float64 `yaml:"low" validate:"min=0.0,max=1.0"`

	// The high watermark to stop refilling the pool, if zero none.
	RefillHighWatermark float64 `yaml:"high" validate:"min=0.0,max=1.0"`
}

Float64ArrayPoolWatermarkConfiguration contains watermark configuration for pools.

type Int64ArrayBucket

type Int64ArrayBucket struct {
	// Capacity is the size of each element in the bucket.
	Capacity int

	// Count is the number of fixed elements in the bucket.
	Count int

	// Options is an optional override to specify options to use for a bucket,
	// specify nil to use the options specified to the bucketized pool
	// constructor for this bucket.
	Options *Int64ArrayPoolOptions
}

Int64ArrayBucket specifies a bucket.

type Int64ArrayBucketConfiguration

type Int64ArrayBucketConfiguration struct {
	// The count of the items in the bucket.
	Count int `yaml:"count"`

	// The capacity of each item in the bucket.
	Capacity int `yaml:"capacity"`
}

Int64ArrayBucketConfiguration contains configuration for a pool bucket.

func (*Int64ArrayBucketConfiguration) NewBucket

NewBucket creates a new bucket.

type Int64ArrayPool

type Int64ArrayPool struct {
	// contains filtered or unexported fields
}

Int64ArrayPool is a value pool.

func NewInt64ArrayPool

func NewInt64ArrayPool(opts *Int64ArrayPoolOptions) *Int64ArrayPool

NewInt64ArrayPool creates a new pool.

func (*Int64ArrayPool) Get

func (p *Int64ArrayPool) Get() []int64

Get gets a value from the pool.

func (*Int64ArrayPool) Init

func (p *Int64ArrayPool) Init(alloc func() []int64)

Init initializes the pool.

func (*Int64ArrayPool) Put

func (p *Int64ArrayPool) Put(v []int64)

Put returns a value to pool.

type Int64ArrayPoolConfiguration

type Int64ArrayPoolConfiguration struct {
	// The size of the pool.
	Size *int `yaml:"size"`

	// The watermark configuration.
	Watermark Int64ArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

Int64ArrayPoolConfiguration contains pool configuration.

func (*Int64ArrayPoolConfiguration) NewPoolOptions

func (c *Int64ArrayPoolConfiguration) NewPoolOptions(
	instrumentOpts instrument.Options,
) *Int64ArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type Int64ArrayPoolOptions

type Int64ArrayPoolOptions struct {
	// contains filtered or unexported fields
}

Int64ArrayPoolOptions provide a set of options for the value pool.

func NewInt64ArrayPoolOptions

func NewInt64ArrayPoolOptions() *Int64ArrayPoolOptions

NewInt64ArrayPoolOptions create a new set of value pool options.

func (*Int64ArrayPoolOptions) InstrumentOptions

func (o *Int64ArrayPoolOptions) InstrumentOptions() instrument.Options

InstrumentOptions returns the instrument options.

func (*Int64ArrayPoolOptions) RefillHighWatermark

func (o *Int64ArrayPoolOptions) RefillHighWatermark() float64

RefillHighWatermark returns the high watermark for stop refilling the pool.

func (*Int64ArrayPoolOptions) RefillLowWatermark

func (o *Int64ArrayPoolOptions) RefillLowWatermark() float64

RefillLowWatermark returns the low watermark for refilling the pool.

func (*Int64ArrayPoolOptions) SetInstrumentOptions

func (o *Int64ArrayPoolOptions) SetInstrumentOptions(v instrument.Options) *Int64ArrayPoolOptions

SetInstrumentOptions sets the instrument options.

func (*Int64ArrayPoolOptions) SetRefillHighWatermark

func (o *Int64ArrayPoolOptions) SetRefillHighWatermark(v float64) *Int64ArrayPoolOptions

SetRefillHighWatermark sets the high watermark for refilling the pool.

func (*Int64ArrayPoolOptions) SetRefillLowWatermark

func (o *Int64ArrayPoolOptions) SetRefillLowWatermark(v float64) *Int64ArrayPoolOptions

SetRefillLowWatermark sets the low watermark for refilling the pool.

func (*Int64ArrayPoolOptions) SetSize

SetSize sets the pool size.

func (*Int64ArrayPoolOptions) Size

func (o *Int64ArrayPoolOptions) Size() int

Size returns pool size.

type Int64ArrayPoolWatermarkConfiguration

type Int64ArrayPoolWatermarkConfiguration struct {
	// The low watermark to start refilling the pool, if zero none.
	RefillLowWatermark float64 `yaml:"low" validate:"min=0.0,max=1.0"`

	// The high watermark to stop refilling the pool, if zero none.
	RefillHighWatermark float64 `yaml:"high" validate:"min=0.0,max=1.0"`
}

Int64ArrayPoolWatermarkConfiguration contains watermark configuration for pools.

type IntArrayBucket

type IntArrayBucket struct {
	// Capacity is the size of each element in the bucket.
	Capacity int

	// Count is the number of fixed elements in the bucket.
	Count int

	// Options is an optional override to specify options to use for a bucket,
	// specify nil to use the options specified to the bucketized pool
	// constructor for this bucket.
	Options *IntArrayPoolOptions
}

IntArrayBucket specifies a bucket.

type IntArrayBucketConfiguration

type IntArrayBucketConfiguration struct {
	// The count of the items in the bucket.
	Count int `yaml:"count"`

	// The capacity of each item in the bucket.
	Capacity int `yaml:"capacity"`
}

IntArrayBucketConfiguration contains configuration for a pool bucket.

func (*IntArrayBucketConfiguration) NewBucket

NewBucket creates a new bucket.

type IntArrayPool

type IntArrayPool struct {
	// contains filtered or unexported fields
}

IntArrayPool is a value pool.

func NewIntArrayPool

func NewIntArrayPool(opts *IntArrayPoolOptions) *IntArrayPool

NewIntArrayPool creates a new pool.

func (*IntArrayPool) Get

func (p *IntArrayPool) Get() []int

Get gets a value from the pool.

func (*IntArrayPool) Init

func (p *IntArrayPool) Init(alloc func() []int)

Init initializes the pool.

func (*IntArrayPool) Put

func (p *IntArrayPool) Put(v []int)

Put returns a value to pool.

type IntArrayPoolConfiguration

type IntArrayPoolConfiguration struct {
	// The size of the pool.
	Size *int `yaml:"size"`

	// The watermark configuration.
	Watermark IntArrayPoolWatermarkConfiguration `yaml:"watermark"`
}

IntArrayPoolConfiguration contains pool configuration.

func (*IntArrayPoolConfiguration) NewPoolOptions

func (c *IntArrayPoolConfiguration) NewPoolOptions(
	instrumentOpts instrument.Options,
) *IntArrayPoolOptions

NewPoolOptions creates a new set of pool options.

type IntArrayPoolOptions

type IntArrayPoolOptions struct {
	// contains filtered or unexported fields
}

IntArrayPoolOptions provide a set of options for the value pool.

func NewIntArrayPoolOptions

func NewIntArrayPoolOptions() *IntArrayPoolOptions

NewIntArrayPoolOptions create a new set of value pool options.

func (*IntArrayPoolOptions) InstrumentOptions

func (o *IntArrayPoolOptions) InstrumentOptions() instrument.Options

InstrumentOptions returns the instrument options.

func (*IntArrayPoolOptions) RefillHighWatermark

func (o *IntArrayPoolOptions) RefillHighWatermark() float64

RefillHighWatermark returns the high watermark for stop refilling the pool.

func (*IntArrayPoolOptions) RefillLowWatermark

func (o *IntArrayPoolOptions) RefillLowWatermark() float64

RefillLowWatermark returns the low watermark for refilling the pool.

func (*IntArrayPoolOptions) SetInstrumentOptions

func (o *IntArrayPoolOptions) SetInstrumentOptions(v instrument.Options) *IntArrayPoolOptions

SetInstrumentOptions sets the instrument options.

func (*IntArrayPoolOptions) SetRefillHighWatermark

func (o *IntArrayPoolOptions) SetRefillHighWatermark(v float64) *IntArrayPoolOptions

SetRefillHighWatermark sets the high watermark for refilling the pool.

func (*IntArrayPoolOptions) SetRefillLowWatermark

func (o *IntArrayPoolOptions) SetRefillLowWatermark(v float64) *IntArrayPoolOptions

SetRefillLowWatermark sets the low watermark for refilling the pool.

func (*IntArrayPoolOptions) SetSize

SetSize sets the pool size.

func (*IntArrayPoolOptions) Size

func (o *IntArrayPoolOptions) Size() int

Size returns pool size.

type IntArrayPoolWatermarkConfiguration

type IntArrayPoolWatermarkConfiguration struct {
	// The low watermark to start refilling the pool, if zero none.
	RefillLowWatermark float64 `yaml:"low" validate:"min=0.0,max=1.0"`

	// The high watermark to stop refilling the pool, if zero none.
	RefillHighWatermark float64 `yaml:"high" validate:"min=0.0,max=1.0"`
}

IntArrayPoolWatermarkConfiguration contains watermark configuration for pools.

type RefCountedPooledBoolArray

type RefCountedPooledBoolArray struct {
	// contains filtered or unexported fields
}

RefCountedPooledBoolArray is a refcounted, pooled generic value array.

func NewRefCountedPooledBoolArray

func NewRefCountedPooledBoolArray(
	vals []bool,
	p *BucketizedBoolArrayPool,
	resetFn func(values []bool),
) *RefCountedPooledBoolArray

NewRefCountedPooledBoolArray creates a new refcounted, pooled generic value array.

func (*RefCountedPooledBoolArray) Append

func (rv *RefCountedPooledBoolArray) Append(v bool)

Append appends a value to the value array.

func (*RefCountedPooledBoolArray) Close

func (rv *RefCountedPooledBoolArray) Close()

Close closes the ref counted array.

func (*RefCountedPooledBoolArray) Get

func (rv *RefCountedPooledBoolArray) Get() []bool

Get returns the underlying raw value array.

func (*RefCountedPooledBoolArray) Snapshot

Snapshot takes a snapshot of the current values in the refcounted array. The returned snapshot shares the backing array with the source array but keeps a copy of the array slice as the snapshot. As a result, new values appended to the end of the array after the snapshot is taken is invisible to the snapshot.

type RefCountedPooledBytesArray

type RefCountedPooledBytesArray struct {
	// contains filtered or unexported fields
}

RefCountedPooledBytesArray is a refcounted, pooled generic value array.

func NewRefCountedPooledBytesArray

func NewRefCountedPooledBytesArray(
	vals [][]byte,
	p *BucketizedBytesArrayPool,
	resetFn func(values [][]byte),
) *RefCountedPooledBytesArray

NewRefCountedPooledBytesArray creates a new refcounted, pooled generic value array.

func (*RefCountedPooledBytesArray) Append

func (rv *RefCountedPooledBytesArray) Append(v []byte)

Append appends a value to the value array.

func (*RefCountedPooledBytesArray) Close

func (rv *RefCountedPooledBytesArray) Close()

Close closes the ref counted array.

func (*RefCountedPooledBytesArray) Get

func (rv *RefCountedPooledBytesArray) Get() [][]byte

Get returns the underlying raw value array.

func (*RefCountedPooledBytesArray) Snapshot

Snapshot takes a snapshot of the current values in the refcounted array. The returned snapshot shares the backing array with the source array but keeps a copy of the array slice as the snapshot. As a result, new values appended to the end of the array after the snapshot is taken is invisible to the snapshot.

type RefCountedPooledFloat64Array

type RefCountedPooledFloat64Array struct {
	// contains filtered or unexported fields
}

RefCountedPooledFloat64Array is a refcounted, pooled generic value array.

func NewRefCountedPooledFloat64Array

func NewRefCountedPooledFloat64Array(
	vals []float64,
	p *BucketizedFloat64ArrayPool,
	resetFn func(values []float64),
) *RefCountedPooledFloat64Array

NewRefCountedPooledFloat64Array creates a new refcounted, pooled generic value array.

func (*RefCountedPooledFloat64Array) Append

func (rv *RefCountedPooledFloat64Array) Append(v float64)

Append appends a value to the value array.

func (*RefCountedPooledFloat64Array) Close

func (rv *RefCountedPooledFloat64Array) Close()

Close closes the ref counted array.

func (*RefCountedPooledFloat64Array) Get

Get returns the underlying raw value array.

func (*RefCountedPooledFloat64Array) Snapshot

Snapshot takes a snapshot of the current values in the refcounted array. The returned snapshot shares the backing array with the source array but keeps a copy of the array slice as the snapshot. As a result, new values appended to the end of the array after the snapshot is taken is invisible to the snapshot.

type RefCountedPooledInt64Array

type RefCountedPooledInt64Array struct {
	// contains filtered or unexported fields
}

RefCountedPooledInt64Array is a refcounted, pooled generic value array.

func NewRefCountedPooledInt64Array

func NewRefCountedPooledInt64Array(
	vals []int64,
	p *BucketizedInt64ArrayPool,
	resetFn func(values []int64),
) *RefCountedPooledInt64Array

NewRefCountedPooledInt64Array creates a new refcounted, pooled generic value array.

func (*RefCountedPooledInt64Array) Append

func (rv *RefCountedPooledInt64Array) Append(v int64)

Append appends a value to the value array.

func (*RefCountedPooledInt64Array) Close

func (rv *RefCountedPooledInt64Array) Close()

Close closes the ref counted array.

func (*RefCountedPooledInt64Array) Get

func (rv *RefCountedPooledInt64Array) Get() []int64

Get returns the underlying raw value array.

func (*RefCountedPooledInt64Array) Snapshot

Snapshot takes a snapshot of the current values in the refcounted array. The returned snapshot shares the backing array with the source array but keeps a copy of the array slice as the snapshot. As a result, new values appended to the end of the array after the snapshot is taken is invisible to the snapshot.

type RefCountedPooledIntArray

type RefCountedPooledIntArray struct {
	// contains filtered or unexported fields
}

RefCountedPooledIntArray is a refcounted, pooled generic value array.

func NewRefCountedPooledIntArray

func NewRefCountedPooledIntArray(
	vals []int,
	p *BucketizedIntArrayPool,
	resetFn func(values []int),
) *RefCountedPooledIntArray

NewRefCountedPooledIntArray creates a new refcounted, pooled generic value array.

func (*RefCountedPooledIntArray) Append

func (rv *RefCountedPooledIntArray) Append(v int)

Append appends a value to the value array.

func (*RefCountedPooledIntArray) Close

func (rv *RefCountedPooledIntArray) Close()

Close closes the ref counted array.

func (*RefCountedPooledIntArray) Get

func (rv *RefCountedPooledIntArray) Get() []int

Get returns the underlying raw value array.

func (*RefCountedPooledIntArray) Snapshot

Snapshot takes a snapshot of the current values in the refcounted array. The returned snapshot shares the backing array with the source array but keeps a copy of the array slice as the snapshot. As a result, new values appended to the end of the array after the snapshot is taken is invisible to the snapshot.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL