tgres: github.com/tgres/tgres/serde Index | Files

package serde

import "github.com/tgres/tgres/serde"

Package serde is the interface (and currently PostgreSQL implementaiton) for Serialization/Deserialization of data.

Index

Package Files

dbds.go dbrra.go dbseries.go memory.go postgres.go postgres_common.go postgres_misc.go serde.go

Constants

const PgSegmentWidth = 200 // TODO Make me configurable

func InitDb Uses

func InitDb(connect_string, prefix string) (*pgvSerDe, error)

func NewMemSerDe Uses

func NewMemSerDe() *memSerDe

Returns a SerDe which keeps everything in memory.

type DataSourceSearcher Uses

type DataSourceSearcher interface {
    // Return a list od DS ids based on the query. How the query works
    // is up to the serde, it can even ignore the argumen, but the
    // general idea was a key: regex list where the underlying engine
    // would return all DSs whose ident tags named key match the
    // regex. Remember to Close() the SearchResult in the end.
    Search(query SearchQuery) (SearchResult, error)
}

type DbAddresser Uses

type DbAddresser interface {
    ListDbClientIps() ([]string, error) // Use the database to infer outside IPs of other connected clients
    MyDbAddr() (*string, error)
}

type DbDataSource Uses

type DbDataSource struct {
    rrd.DataSourcer
    // contains filtered or unexported fields
}

func NewDbDataSource Uses

func NewDbDataSource(id int64, ident Ident, ds rrd.DataSourcer) *DbDataSource

func (*DbDataSource) Copy Uses

func (ds *DbDataSource) Copy() rrd.DataSourcer

func (*DbDataSource) Created Uses

func (ds *DbDataSource) Created() bool

func (*DbDataSource) Id Uses

func (ds *DbDataSource) Id() int64

func (*DbDataSource) Ident Uses

func (ds *DbDataSource) Ident() Ident

type DbDataSourcer Uses

type DbDataSourcer interface {
    rrd.DataSourcer
    Ident() Ident
    Id() int64
    Created() bool
}

type DbRoundRobinArchive Uses

type DbRoundRobinArchive struct {
    rrd.RoundRobinArchiver
    // contains filtered or unexported fields
}

func (*DbRoundRobinArchive) BundleId Uses

func (rra *DbRoundRobinArchive) BundleId() int64

func (*DbRoundRobinArchive) Copy Uses

func (rra *DbRoundRobinArchive) Copy() rrd.RoundRobinArchiver

func (*DbRoundRobinArchive) DPsAsPGString Uses

func (rra *DbRoundRobinArchive) DPsAsPGString(start, end int64) string

DPsAsPGString returns data points as a PostgreSQL-compatible array string

func (*DbRoundRobinArchive) Id Uses

func (rra *DbRoundRobinArchive) Id() int64

func (*DbRoundRobinArchive) Idx Uses

func (rra *DbRoundRobinArchive) Idx() int64

func (*DbRoundRobinArchive) Seg Uses

func (rra *DbRoundRobinArchive) Seg() int64

func (*DbRoundRobinArchive) SlotRow Uses

func (rra *DbRoundRobinArchive) SlotRow(slot int64) int64

SlotRow returns the row number given a slot number. This is mostly useful in serde implementations.

func (*DbRoundRobinArchive) Width Uses

func (rra *DbRoundRobinArchive) Width() int64

type DbRoundRobinArchiver Uses

type DbRoundRobinArchiver interface {
    rrd.RoundRobinArchiver
    Id() int64
    Width() int64
    SlotRow(slot int64) int64
    DPsAsPGString(start, end int64) string
    //Pos() int64
    Seg() int64
    Idx() int64
    BundleId() int64
}

type DbSerDe Uses

type DbSerDe interface {
    SerDe
    DbAddresser() DbAddresser
}

type Fetcher Uses

type Fetcher interface {
    DataSourceSearcher
    // Fetch all the data sources (used to populate the cache on start)
    FetchDataSources() ([]rrd.DataSourcer, error)
    // Fetch or create a single DS. Passing a nil dsSpec disables creation.
    FetchOrCreateDataSource(ident Ident, dsSpec *rrd.DSSpec) (rrd.DataSourcer, error)
    // FetchSeries is responsible for presenting a DS as a
    // series.Series. This may include selecting the most suitable RRA
    // of the DS to satisfy span and resolution requested, as well as
    // setting up a database cursor which will be used to iterate over
    // the series.
    FetchSeries(ds rrd.DataSourcer, from, to time.Time, maxPoints int64) (series.Series, error)
}

type Flusher Uses

type Flusher interface {
    FlushDataSource(ds rrd.DataSourcer) error
}

type Ident Uses

type Ident map[string]string

func (Ident) String Uses

func (it Ident) String() string

type SearchQuery Uses

type SearchQuery map[string]string

type SearchResult Uses

type SearchResult interface {
    Next() bool
    Close() error
    Ident() Ident
}

An iterator, similar to sql.Rows.

type SerDe Uses

type SerDe interface {
    Fetcher() Fetcher
    Flusher() Flusher
    VerticalFlusher() VerticalFlusher
}

type VerticalFlusher Uses

type VerticalFlusher interface {
    VerticalFlushDPs(bunlde_id, seg, i int64, dps map[int64]float64) (int, error)
    VerticalFlushLatests(bundle_id, seg int64, latests map[int64]time.Time) (int, error)
}

Package serde imports 16 packages (graph) and is imported by 7 packages. Updated 2017-03-31. Refresh now. Tools for package owners.