btrdbd

package
v0.0.0-...-a2e7767 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const LatestGeneration = bstore.LatestGeneration
View Source
const MaximumTime = 64 << 56
View Source
const MinimumTime = 0

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangedRange

type ChangedRange struct {
	Start int64
	End   int64
}

type Quasar

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

func NewQuasar

func NewQuasar(cfg *QuasarConfig) (*Quasar, error)

func (*Quasar) DeleteRange

func (q *Quasar) DeleteRange(id uuid.UUID, start int64, end int64) error

删除某个时间区间,这边涉及到写的问题

func (*Quasar) InsertValues

func (q *Quasar) InsertValues(id uuid.UUID, r []qtree.Record)

插入数据点,如果没达到 buffer 限制,将数据插入到 buffer,否则将会提前刷新数据

func (*Quasar) IsPending

func (q *Quasar) IsPending() bool

判断是否有数据在 buffer 之中 Return true if there are uncommited results to be written to disk Should only be used during shutdown as it hogs the glock

func (*Quasar) QueryChangedRanges

func (q *Quasar) QueryChangedRanges(id uuid.UUID, startgen uint64, endgen uint64, resolution uint8) ([]ChangedRange, uint64, error)

Resolution is how far down the tree to go when working out which blocks have changed. Higher resolutions are faster but will give you back coarser results. 读取某两个版本之间变化的时间区间

func (*Quasar) QueryGeneration

func (q *Quasar) QueryGeneration(id uuid.UUID) (uint64, error)

获取最新的版本号信息

func (*Quasar) QueryNearestValue

func (q *Quasar) QueryNearestValue(id uuid.UUID, time int64, backwards bool, gen uint64) (qtree.Record, uint64, error)

查询最接近的数据点

func (*Quasar) QueryStatisticalValues

func (q *Quasar) QueryStatisticalValues(id uuid.UUID, start int64, end int64,
	gen uint64, pointwidth uint8) ([]qtree.StatRecord, uint64, error)

读取某个时间区间的统计信息

func (*Quasar) QueryStatisticalValuesStream

func (q *Quasar) QueryStatisticalValuesStream(id uuid.UUID, start int64, end int64,
	gen uint64, pointwidth uint8) (chan qtree.StatRecord, chan error, uint64)

func (*Quasar) QueryValues

func (q *Quasar) QueryValues(id uuid.UUID, start int64, end int64, gen uint64) ([]qtree.Record, uint64, error)

读取某个版本下某个时间区间的所有数据 These functions are the API. TODO add all the bounds checking on PW, and sanity on start/end

func (*Quasar) QueryValuesStream

func (q *Quasar) QueryValuesStream(id uuid.UUID, start int64, end int64, gen uint64) (chan qtree.Record, chan error, uint64)

提供一个读取时间区间 chan

func (*Quasar) QueryWindow

func (q *Quasar) QueryWindow(id uuid.UUID, start int64, end int64,
	gen uint64, width uint64, depth uint8) (chan qtree.StatRecord, uint64)

type QuasarConfig

type QuasarConfig struct {
	//Measured in the number of datablocks
	//So 1000 is 8 MB cache
	DatablockCacheSize uint64

	//This enables the grouping of value inserts
	//with a commit every Interval millis
	//If the number of stored values exceeds
	//EarlyTrip
	TransactionCoalesceEnable    bool   // 是否开启 TransactionCoalesce
	TransactionCoalesceInterval  uint64 // 必须要提交的时间间隔
	TransactionCoalesceEarlyTrip uint64 // 必须要提交的点的数量

	ForestCount uint64

	Params map[string]string
}

Jump to

Keyboard shortcuts

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