option

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseOption

type DatabaseOption struct {
	// write interval(the number of second) => TTL
	// rollup intervals(like seconds->minute->hour->day)
	Intervals Intervals `toml:"intervals" json:"intervals,omitempty"  validate:"required"`

	// auto create namespace
	AutoCreateNS bool `toml:"autoCreateNS" json:"autoCreateNS,omitempty"`

	Behind string `toml:"behind" json:"behind,omitempty"` // allowed timestamp write behind
	Ahead  string `toml:"ahead" json:"ahead,omitempty"`   // allowed timestamp write ahead

	Index FlusherOption `toml:"index" json:"index,omitempty"` // index flusher option
	Data  FlusherOption `toml:"data" json:"data,omitempty"`   // data flusher data
	// contains filtered or unexported fields
}

DatabaseOption represents a database option include shard ids and shard's option

func (*DatabaseOption) Default

func (e *DatabaseOption) Default()

Default sets default value if some configuration item not set.

func (*DatabaseOption) FindMatchSmallestInterval

func (e *DatabaseOption) FindMatchSmallestInterval(interval timeutil.Interval) timeutil.Interval

FindMatchSmallestInterval returns the smallest interval which match query interval.

func (*DatabaseOption) GetAcceptWritableRange

func (e *DatabaseOption) GetAcceptWritableRange() (ahead, behind int64)

GetAcceptWritableRange returns accept writable time range.

func (*DatabaseOption) Validate

func (e *DatabaseOption) Validate() error

Validate validates engine option if valid

type FlusherOption

type FlusherOption struct {
	TimeThreshold int64 `toml:"timeThreshold" json:"timeThreshold"` // time level flush threshold
	SizeThreshold int64 `toml:"sizeThreshold" json:"sizeThreshold"` // size level flush threshold, unit(MB)
}

FlusherOption represents a flusher configuration for index and memory db

type Interval

type Interval struct {
	Interval  timeutil.Interval `toml:"interval" json:"interval,omitempty" validate:"required"`
	Retention timeutil.Interval `toml:"retention" json:"retention,omitempty" validate:"required"`
}

Interval represents the database's interval option, include interval and data retention.

func (Interval) String

func (m Interval) String() string

String returns the string representation of the Interval.

type Intervals

type Intervals []Interval

Intervals represents the list of Interval.

func (Intervals) IsValid added in v0.2.4

func (m Intervals) IsValid() error

IsValid checks if intervals is valid, if invalid return error.

func (Intervals) Len

func (m Intervals) Len() int

func (Intervals) Less

func (m Intervals) Less(i, j int) bool

func (Intervals) String

func (m Intervals) String() string

String returns the string representation of the Intervals.

func (Intervals) Swap

func (m Intervals) Swap(i, j int)

Jump to

Keyboard shortcuts

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