Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface { Storer Reader LoadReady() chan *LoadManifest LoadError(manifestUUID, loadError string) LoadDone(manifestUUID string, tableName string) GetLastLoads() map[string]time.Time }
Backend specifies the interface for load state
func NewPostgresLoader ¶
func NewPostgresLoader(cfg *PGConfig, lChecker loadChecker, versions versions.Getter) (Backend, error)
NewPostgresLoader configures a new postgres backend for loading (or storing) At backend configuration, we set a max number of tsvs for a table and max count of tsvs before a load is triggered.
type EventStats ¶
EventStats defines a set of statistics recorded for a particular event.
type LoadManifest ¶
LoadManifest represents a set of files that needs to be loaded
type PGConfig ¶
type PGConfig struct { DatabaseURL string LoadAgeTrigger time.Duration LoadCountTrigger int MaxConnections int }
PGConfig stores configuration for postgres
type PendingLoadStats ¶
type PendingLoadStats struct { Type PendingLoadType Stats []*EventStats }
PendingLoadStats stores aggregated stats for events in a particular type of pending load group.
type PendingLoadType ¶
type PendingLoadType string
PendingLoadType specifies a particular reason for events to be pending load.
const ( // PendingInQueue are loads waiting in active queue. PendingInQueue PendingLoadType = "in_queue" // PendingStale are loads retried a maximum amount of times. PendingStale PendingLoadType = "stale" // PendingMigration are loads blocked on version migration. PendingMigration PendingLoadType = "pending_migration" )
type Reader ¶
type Reader interface { Versions() (map[string]int, error) PingDB() error TSVVersionExists(table string, version int) (bool, error) ForceLoad(table string, requester string) error StatsForPendingLoads() ([]*PendingLoadStats, error) IsForceLoadRequested(table string) (bool, error) }
Reader specifies the interface for Backend read/write operations