control

package
v0.0.0-...-b3895e6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewControlRouter

func NewControlRouter(cHandler *Handler) http.Handler

NewControlRouter instantiates an http.Handler with the control routes

Types

type Backend

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

Backend is the backend for control, which operates on the ingester

func NewControlBackend

func NewControlBackend(metaReader metadata.Reader, metaBackend metadata.Backend, tableVersions versions.Getter,
	versionIncrement chan migrator.VersionIncrement) *Backend

NewControlBackend instantiates the control backend with a db connection

func (*Backend) ForceLoad

func (cBackend *Backend) ForceLoad(tableName string, requester string) error

ForceLoad makes the given table the highest priority to load next

func (*Backend) IncrementVersion

func (cBackend *Backend) IncrementVersion(tableName string) error

IncrementVersion increments the given table's version in the migrator goroutine.

func (*Backend) LastLoads

func (cBackend *Backend) LastLoads() map[string]time.Time

LastLoads returns the last known load times for each table

func (*Backend) TableExists

func (cBackend *Backend) TableExists(tableName string) bool

TableExists returns whether the given table name exists in our version dictionary.

type Handler

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

Handler is a handler for control

func NewControlHandler

func NewControlHandler(ch *Backend, stats monitoring.SafeStatter) *Handler

NewControlHandler instantiates a handler for control

func (*Handler) ForceLoad

func (ch *Handler) ForceLoad(c web.C, w http.ResponseWriter, r *http.Request)

ForceLoad forces ingest of a particular table. Takes a JSON POST containing the Table and Requester fields, representing the what to force load and who wants it.

func (*Handler) IncrementVersion

func (ch *Handler) IncrementVersion(c web.C, w http.ResponseWriter, r *http.Request)

IncrementVersion sets the table's version in infra.table_version to the given version.

func (*Handler) LastLoad

func (ch *Handler) LastLoad(c web.C, w http.ResponseWriter, r *http.Request)

LastLoad returns a JSON map of known last load times for each table

func (*Handler) TableExists

func (ch *Handler) TableExists(c web.C, w http.ResponseWriter, r *http.Request)

TableExists returns a boolean indicating whether the given table exists.

Jump to

Keyboard shortcuts

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