Documentation ¶
Index ¶
- func ReturnArrayToPool(docs []Document, p *BucketizedDocumentArrayPool)
- type BucketizedDocumentArrayPool
- type BucketizedDocumentArrayPoolConfiguration
- type Document
- type DocumentArrayBucket
- type DocumentArrayBucketConfiguration
- type DocumentArrayPool
- type DocumentArrayPoolConfiguration
- type DocumentArrayPoolOptions
- func (o *DocumentArrayPoolOptions) InstrumentOptions() instrument.Options
- func (o *DocumentArrayPoolOptions) RefillHighWatermark() float64
- func (o *DocumentArrayPoolOptions) RefillLowWatermark() float64
- func (o *DocumentArrayPoolOptions) SetInstrumentOptions(v instrument.Options) *DocumentArrayPoolOptions
- func (o *DocumentArrayPoolOptions) SetRefillHighWatermark(v float64) *DocumentArrayPoolOptions
- func (o *DocumentArrayPoolOptions) SetRefillLowWatermark(v float64) *DocumentArrayPoolOptions
- func (o *DocumentArrayPoolOptions) SetSize(v int) *DocumentArrayPoolOptions
- func (o *DocumentArrayPoolOptions) Size() int
- type DocumentArrayPoolWatermarkConfiguration
- type Documents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReturnArrayToPool ¶
func ReturnArrayToPool(docs []Document, p *BucketizedDocumentArrayPool)
ReturnArrayToPool returns a document array to pool.
Types ¶
type BucketizedDocumentArrayPool ¶
type BucketizedDocumentArrayPool struct {
// contains filtered or unexported fields
}
BucketizedDocumentArrayPool is a bucketized value pool.
func NewBucketizedDocumentArrayPool ¶
func NewBucketizedDocumentArrayPool(sizes []DocumentArrayBucket, opts *DocumentArrayPoolOptions) *BucketizedDocumentArrayPool
NewBucketizedDocumentArrayPool creates a bucketized object pool.
func (*BucketizedDocumentArrayPool) Get ¶
func (p *BucketizedDocumentArrayPool) Get(capacity int) []Document
Get gets a value from the pool.
func (*BucketizedDocumentArrayPool) Init ¶
func (p *BucketizedDocumentArrayPool) Init(alloc func(capacity int) []Document)
Init initializes the bucketized pool.
func (*BucketizedDocumentArrayPool) Put ¶
func (p *BucketizedDocumentArrayPool) Put(v []Document, capacity int)
Put puts a value to the pool.
type BucketizedDocumentArrayPoolConfiguration ¶
type BucketizedDocumentArrayPoolConfiguration struct { // The pool bucket configuration. Buckets []DocumentArrayBucketConfiguration `yaml:"buckets"` // The watermark configuration. Watermark DocumentArrayPoolWatermarkConfiguration `yaml:"watermark"` }
BucketizedDocumentArrayPoolConfiguration contains configuration for bucketized pools.
func (*BucketizedDocumentArrayPoolConfiguration) NewBuckets ¶
func (c *BucketizedDocumentArrayPoolConfiguration) NewBuckets() []DocumentArrayBucket
NewBuckets create a new list of buckets.
func (*BucketizedDocumentArrayPoolConfiguration) NewPoolOptions ¶
func (c *BucketizedDocumentArrayPoolConfiguration) NewPoolOptions( instrumentOptions instrument.Options, ) *DocumentArrayPoolOptions
NewPoolOptions creates a new set of pool options.
type Document ¶
type Document struct { ID []byte TimeNanos int64 RawData []byte Fields field.Fields FieldArrayPool *field.BucketizedFieldArrayPool }
Document is a discrete, timestamped document.
type DocumentArrayBucket ¶
type DocumentArrayBucket 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 *DocumentArrayPoolOptions }
DocumentArrayBucket specifies a bucket.
type DocumentArrayBucketConfiguration ¶
type DocumentArrayBucketConfiguration 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"` }
DocumentArrayBucketConfiguration contains configuration for a pool bucket.
func (*DocumentArrayBucketConfiguration) NewBucket ¶
func (c *DocumentArrayBucketConfiguration) NewBucket() DocumentArrayBucket
NewBucket creates a new bucket.
type DocumentArrayPool ¶
type DocumentArrayPool struct {
// contains filtered or unexported fields
}
DocumentArrayPool is a value pool.
func NewDocumentArrayPool ¶
func NewDocumentArrayPool(opts *DocumentArrayPoolOptions) *DocumentArrayPool
NewDocumentArrayPool creates a new pool.
func (*DocumentArrayPool) Get ¶
func (p *DocumentArrayPool) Get() []Document
Get gets a value from the pool.
func (*DocumentArrayPool) Init ¶
func (p *DocumentArrayPool) Init(alloc func() []Document)
Init initializes the pool.
func (*DocumentArrayPool) Put ¶
func (p *DocumentArrayPool) Put(v []Document)
Put returns a value to pool.
type DocumentArrayPoolConfiguration ¶
type DocumentArrayPoolConfiguration struct { // The size of the pool. Size *int `yaml:"size"` // The watermark configuration. Watermark DocumentArrayPoolWatermarkConfiguration `yaml:"watermark"` }
DocumentArrayPoolConfiguration contains pool configuration.
func (*DocumentArrayPoolConfiguration) NewPoolOptions ¶
func (c *DocumentArrayPoolConfiguration) NewPoolOptions( instrumentOpts instrument.Options, ) *DocumentArrayPoolOptions
NewPoolOptions creates a new set of pool options.
type DocumentArrayPoolOptions ¶
type DocumentArrayPoolOptions struct {
// contains filtered or unexported fields
}
DocumentArrayPoolOptions provide a set of options for the value pool.
func NewDocumentArrayPoolOptions ¶
func NewDocumentArrayPoolOptions() *DocumentArrayPoolOptions
NewDocumentArrayPoolOptions create a new set of value pool options.
func (*DocumentArrayPoolOptions) InstrumentOptions ¶
func (o *DocumentArrayPoolOptions) InstrumentOptions() instrument.Options
InstrumentOptions returns the instrument options.
func (*DocumentArrayPoolOptions) RefillHighWatermark ¶
func (o *DocumentArrayPoolOptions) RefillHighWatermark() float64
RefillHighWatermark returns the high watermark for stop refilling the pool.
func (*DocumentArrayPoolOptions) RefillLowWatermark ¶
func (o *DocumentArrayPoolOptions) RefillLowWatermark() float64
RefillLowWatermark returns the low watermark for refilling the pool.
func (*DocumentArrayPoolOptions) SetInstrumentOptions ¶
func (o *DocumentArrayPoolOptions) SetInstrumentOptions(v instrument.Options) *DocumentArrayPoolOptions
SetInstrumentOptions sets the instrument options.
func (*DocumentArrayPoolOptions) SetRefillHighWatermark ¶
func (o *DocumentArrayPoolOptions) SetRefillHighWatermark(v float64) *DocumentArrayPoolOptions
SetRefillHighWatermark sets the high watermark for refilling the pool.
func (*DocumentArrayPoolOptions) SetRefillLowWatermark ¶
func (o *DocumentArrayPoolOptions) SetRefillLowWatermark(v float64) *DocumentArrayPoolOptions
SetRefillLowWatermark sets the low watermark for refilling the pool.
func (*DocumentArrayPoolOptions) SetSize ¶
func (o *DocumentArrayPoolOptions) SetSize(v int) *DocumentArrayPoolOptions
SetSize sets the pool size.
func (*DocumentArrayPoolOptions) Size ¶
func (o *DocumentArrayPoolOptions) Size() int
Size returns pool size.
type DocumentArrayPoolWatermarkConfiguration ¶
type DocumentArrayPoolWatermarkConfiguration 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"` }
DocumentArrayPoolWatermarkConfiguration contains watermark configuration for pools.