datastore

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2013 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_INT = iota
	TYPE_STRING
	TYPE_BOOL
	TYPE_DOUBLE
	TYPE_UNKNOWN
)
View Source
const (
	ONE_MEGABYTE              = 1024 * 1024
	ONE_GIGABYTE              = ONE_MEGABYTE * 1024
	TWO_FIFTY_SIX_KILOBYTES   = 256 * 1024
	BLOOM_FILTER_BITS_PER_KEY = 64
	MAX_POINTS_TO_SCAN        = 1000000
	MAX_SERIES_SIZE           = ONE_MEGABYTE
)

Variables

View Source
var (
	// NEXT_ID_KEY holds the next id. ids are used to "intern" timeseries and column names
	NEXT_ID_KEY = []byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
	// SERIES_COLUMN_INDEX_PREFIX is the prefix of the series to column names index
	SERIES_COLUMN_INDEX_PREFIX = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE}
	// DATABASE_SERIES_INDEX_PREFIX is the prefix of the database to series names index
	DATABASE_SERIES_INDEX_PREFIX = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
	MAX_SEQUENCE                 = []byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
)

Functions

func EqualityOperator

func EqualityOperator(leftValue, rightValue *protocol.FieldValue) (bool, error)

func Filter

func Filter(query *parser.Query, series *protocol.Series) (*protocol.Series, error)

func GreaterThanOperator

func GreaterThanOperator(leftValue, rightValue *protocol.FieldValue) (bool, error)

func GreaterThanOrEqualOperator

func GreaterThanOrEqualOperator(leftValue, rightValue *protocol.FieldValue) (bool, error)

func RegexMatcherOperator

func RegexMatcherOperator(leftValue, rightValue *protocol.FieldValue) (bool, error)

Types

type BooleanOperation

type BooleanOperation func(leftValue, rightValue *protocol.FieldValue) (bool, error)

type Datastore

type Datastore interface {
	ExecuteQuery(user common.User, database string, query *parser.Query, yield func(*protocol.Series) error) error
	WriteSeriesData(database string, series *protocol.Series) error
	DropDatabase(database string) error
	DeleteRangeOfSeries(database, series string, startTime, endTime time.Time) error
	DeleteRangeOfRegex(user common.User, database string, regex *regexp.Regexp, startTime, endTime time.Time) error
	Close()
}

func NewLevelDbDatastore

func NewLevelDbDatastore(dbDir string) (Datastore, error)

type Field

type Field struct {
	Id   []byte
	Name string
}

type LevelDbDatastore

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

func (*LevelDbDatastore) Close

func (self *LevelDbDatastore) Close()

func (*LevelDbDatastore) DeleteRangeOfRegex

func (self *LevelDbDatastore) DeleteRangeOfRegex(user common.User, database string, regex *regexp.Regexp, startTime, endTime time.Time) error

func (*LevelDbDatastore) DeleteRangeOfSeries

func (self *LevelDbDatastore) DeleteRangeOfSeries(database, series string, startTime, endTime time.Time) error

func (*LevelDbDatastore) DropDatabase added in v0.2.0

func (self *LevelDbDatastore) DropDatabase(database string) error

func (*LevelDbDatastore) ExecuteQuery

func (self *LevelDbDatastore) ExecuteQuery(user common.User, database string, query *parser.Query, yield func(*protocol.Series) error) error

func (*LevelDbDatastore) WriteSeriesData

func (self *LevelDbDatastore) WriteSeriesData(database string, series *protocol.Series) error

type Type

type Type int

Jump to

Keyboard shortcuts

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