storage

package
v0.0.0-...-e035375 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCompactThroughput is the rate limit in bytes per second that we
	// will allow TSM compactions to write to disk. Not that short bursts are allowed
	// to happen at a possibly larger value, set by DefaultCompactThroughputBurst.
	// A value of 0 here will disable compaction rate limiting
	DefaultCompactThroughput = 48 * 1024 * 1024

	// DefaultCompactThroughputBurst is the rate limit in bytes per second that we
	// will allow TSM compactions to write to disk. If this is not set, the burst value
	// will be set to equal the normal throughput
	DefaultCompactThroughputBurst = 48 * 1024 * 102
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedTSMRewriter

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

CachedTSMRewriter defines a rewriter backed by an in-memory cache for key ordering

func NewCachedTSMRewriter

func NewCachedTSMRewriter(maxSize uint64, flushSizeThrehsold uint64, path string) *CachedTSMRewriter

NewCachedTSMRewriter creates a new CacheRewriter with a maximum size in bytes

func (*CachedTSMRewriter) Close

func (w *CachedTSMRewriter) Close() error

Close implements Rewriter interface

func (*CachedTSMRewriter) CompactFull

func (w *CachedTSMRewriter) CompactFull() ([]string, error)

CompactFull implements Rewriter interface

func (*CachedTSMRewriter) Write

func (w *CachedTSMRewriter) Write(key []byte, values []tsm1.Value) error

Write implements the Rewriter interface

func (*CachedTSMRewriter) WriteSnapshot

func (w *CachedTSMRewriter) WriteSnapshot() error

WriteSnapshot will snapshot the cache and write a new TSM file with its content

type NoopTSMRewriter

type NoopTSMRewriter struct {
}

NoopTSMRewriter defines a rewriter that does nothing. Used in check mode

func (*NoopTSMRewriter) Close

func (w *NoopTSMRewriter) Close() error

Close implements Rewriter interface

func (*NoopTSMRewriter) CompactFull

func (w *NoopTSMRewriter) CompactFull() ([]string, error)

CompactFull implements Rewriter interface

func (*NoopTSMRewriter) Write

func (w *NoopTSMRewriter) Write(key []byte, values []tsm1.Value) error

Write implements Rewriter interface

func (*NoopTSMRewriter) WriteSnapshot

func (w *NoopTSMRewriter) WriteSnapshot() error

WriteSnapshot implemetns Rewriter interface

type ShardInfo

type ShardInfo struct {
	Path            string
	ID              uint64
	Database        string
	RetentionPolicy string

	TsmFiles    []string
	FieldsIndex *tsdb.MeasurementFieldSet
	WalFiles    []string
}

ShardInfo gives information about a shard

func LoadShards

func LoadShards(dataDir string, walDir string, database string, retentionPolicy string, shardFilter string) ([]ShardInfo, error)

LoadShards load all shards in a data directory

type TSMRewriter

type TSMRewriter interface {
	Write(key []byte, values []tsm1.Value) error
	WriteSnapshot() error
	CompactFull() ([]string, error)
	Close() error
}

TSMRewriter defines a rewriter for a given TSM file

Jump to

Keyboard shortcuts

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