Documentation
¶
Overview ¶
Package hybridbuffer provides an ChunkBufferer implementation which keeps N numbers of unsent chunks in memory and starts saving to and loading from the queue directory when the limit is reached.
At shutdown, all unsent chunks are saved for recovery next time.
The bufferer creates subdirs for each buffer ID under root path. A subdir name is made of sanitized buffer/pipeline ID and hash to prevent collision, while the original ID is stored as an extended attribute on the subdir itself.
If for any reason the queue directory cannot be created or accessed, the buffer drops all chunks after the limit is reached and logs errors; at shutdown all pending chunks would be held until they're sent or timed out.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
bconfig.Header `yaml:",inline"`
RootPath string `yaml:"rootPath"` // root path on top of buffer subdirs, may contain environment variables
MaxBufSize datasize.ByteSize `yaml:"maxBufSize"` // max total size of on-disk chunks for each buffer subdir
}
Config defines the configuration for HybridBufferer
func (*Config) ListBufferIDs ¶
func (cfg *Config) ListBufferIDs(parentLogger logger.Logger, matchChunkID func(string) bool, metricCreator promreg.MetricCreator, ) []string
ListBufferIDs lists existing buffer IDs
func (*Config) NewBufferer ¶
func (cfg *Config) NewBufferer(parentLogger logger.Logger, bufferID string, matchChunkID func(string) bool, metricCreator promreg.MetricCreator, sendAllAtEnd bool, ) base.ChunkBufferer
NewBufferer creates a HybridBufferer. If bufferID is empty, the queue dir is the root dir as defined in .path.
func (*Config) VerifyConfig ¶
VerifyConfig checks configuration