readdb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stmts = []string{

	"create table revision (revision bigint, PRIMARY KEY(revision))",

	"create table run (id varchar, grouppath varchar, phase varchar, result varchar, PRIMARY KEY (id, grouppath, phase))",

	"create table rundata (id varchar, data bytea, PRIMARY KEY (id))",

	"create table runevent (sequence varchar, data bytea, PRIMARY KEY (sequence))",

	"create table changegrouprevision (id varchar, revision varchar, PRIMARY KEY (id, revision))",

	"create table revision_ost (revision bigint, PRIMARY KEY(revision))",

	"create table committedwalsequence_ost (seq varchar, PRIMARY KEY (seq))",

	"create table changegrouprevision_ost (id varchar, revision varchar, PRIMARY KEY (id, revision))",

	"create table run_ost (id varchar, grouppath varchar, phase varchar, result varchar, PRIMARY KEY (id, grouppath, phase))",

	"create table rundata_ost (id varchar, data bytea, PRIMARY KEY (id))",

	"create table runcounter_ost (groupid varchar, counter bigint, PRIMARY KEY (groupid))",
}

Functions

This section is empty.

Types

type ReadDB

type ReadDB struct {
	Initialized bool
	// contains filtered or unexported fields
}

func NewReadDB

func NewReadDB(ctx context.Context, logger *zap.Logger, dataDir string, e *etcd.Store, ost *objectstorage.ObjStorage, dm *datamanager.DataManager) (*ReadDB, error)

func (*ReadDB) Do

func (r *ReadDB) Do(f func(tx *db.Tx) error) error

func (*ReadDB) GetActiveRuns

func (r *ReadDB) GetActiveRuns(tx *db.Tx, groups []string, lastRun bool, phaseFilter []types.RunPhase, resultFilter []types.RunResult, startRunID string, limit int, sortOrder types.SortOrder) ([]*RunData, error)

func (*ReadDB) GetChangeGroupsUpdateTokens

func (r *ReadDB) GetChangeGroupsUpdateTokens(tx *db.Tx, groups []string) (*types.ChangeGroupsUpdateToken, error)

func (*ReadDB) GetChangeGroupsUpdateTokensOST

func (r *ReadDB) GetChangeGroupsUpdateTokensOST(tx *db.Tx, groups []string) (*datamanager.ChangeGroupsUpdateToken, error)

func (*ReadDB) GetCommittedWalSequenceOST

func (r *ReadDB) GetCommittedWalSequenceOST(tx *db.Tx) (string, error)

func (*ReadDB) GetRevision

func (r *ReadDB) GetRevision() (int64, error)

func (*ReadDB) GetRun

func (r *ReadDB) GetRun(tx *db.Tx, runID string) (*types.Run, error)

func (*ReadDB) GetRunCounterOST

func (r *ReadDB) GetRunCounterOST(tx *db.Tx, group string) (uint64, error)

func (*ReadDB) GetRunCountersOST

func (r *ReadDB) GetRunCountersOST(tx *db.Tx, start string, limit int) ([]*types.RunCounter, error)

func (*ReadDB) GetRuns

func (r *ReadDB) GetRuns(tx *db.Tx, groups []string, lastRun bool, phaseFilter []types.RunPhase, resultFilter []types.RunResult, startRunID string, limit int, sortOrder types.SortOrder) ([]*types.Run, error)

func (*ReadDB) GetRunsFilteredOST

func (r *ReadDB) GetRunsFilteredOST(tx *db.Tx, groups []string, lastRun bool, phaseFilter []types.RunPhase, resultFilter []types.RunResult, startRunID string, limit int, sortOrder types.SortOrder) ([]*RunData, error)

func (*ReadDB) Initialize

func (r *ReadDB) Initialize(ctx context.Context) error

Initialize populates the readdb with the current etcd data and save the revision to then feed it with the etcd events

func (*ReadDB) IsInitialized

func (r *ReadDB) IsInitialized() bool

func (*ReadDB) ResetDB

func (r *ReadDB) ResetDB() error

func (*ReadDB) Run

func (r *ReadDB) Run(ctx context.Context) error

func (*ReadDB) SetInitialized

func (r *ReadDB) SetInitialized(initialized bool)

func (*ReadDB) SyncFromDump

func (r *ReadDB) SyncFromDump() (string, error)

func (*ReadDB) SyncFromWals

func (r *ReadDB) SyncFromWals(startWalSeq, endWalSeq string) (string, error)

func (*ReadDB) SyncObjectStorage

func (r *ReadDB) SyncObjectStorage(ctx context.Context) error

func (*ReadDB) SyncRDB

func (r *ReadDB) SyncRDB(ctx context.Context) error

type RunData

type RunData struct {
	ID        string
	GroupPath string
	Phase     string
	Run       *types.Run
}

Jump to

Keyboard shortcuts

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