bpdb

package
v0.0.0-...-5178349 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOperation

func ApplyOperation(s *AnnotatedSchema, op scoop_protocol.Operation) error

ApplyOperation applies a single operation to the schema, migrating the schema to a new state

func ApplyOperations

func ApplyOperations(s *AnnotatedSchema, operations []scoop_protocol.Operation) error

ApplyOperations applies the list of operations in order to the schema, migrating the schema to a new state

Types

type ActiveUser

type ActiveUser struct {
	UserName string
	Changes  int
}

ActiveUser is a count of the number of changes a user has made.

type AllEventMetadata

type AllEventMetadata struct {
	Metadata map[string](map[string]EventMetadataRow)
}

AllEventMetadata is the metadata for all events

type AnnotatedSchema

type AnnotatedSchema struct {
	EventName     string
	Columns       []scoop_protocol.ColumnDefinition
	Version       int
	CreatedTS     time.Time
	TS            time.Time
	UserName      string
	Dropped       bool
	DropRequested bool
	Reason        string
}

AnnotatedSchema is a schema annotated with modification information.

type BpKinesisConfigBackend

type BpKinesisConfigBackend interface {
	AllKinesisConfigs() ([]scoop_protocol.AnnotatedKinesisConfig, error)
	KinesisConfig(account int64, streamType string, name string) (*scoop_protocol.AnnotatedKinesisConfig, error)
	UpdateKinesisConfig(update *scoop_protocol.AnnotatedKinesisConfig, user string) *core.WebError
	CreateKinesisConfig(config *scoop_protocol.AnnotatedKinesisConfig, user string) *core.WebError
	DropKinesisConfig(config *scoop_protocol.AnnotatedKinesisConfig, reason string, user string) error
}

BpKinesisConfigBackend is the interface of the blueprint db backend that stores kinesis config state

func NewKinesisConfigBackend

func NewKinesisConfigBackend(db *sql.DB, filters []string) BpKinesisConfigBackend

NewKinesisConfigBackend creates a postgres bpdb backend to interface with the kinesis configuration store

type BpSchemaBackend

type BpSchemaBackend interface {
	AllSchemas() ([]AnnotatedSchema, error)
	Schema(name string, version *int) (*AnnotatedSchema, error)
	UpdateSchema(update *core.ClientUpdateSchemaRequest, user string) *core.WebError
	CreateSchema(schema *scoop_protocol.Config, user string) *core.WebError
	Migration(table string, from int, to int) ([]*scoop_protocol.Operation, error)
	DropSchema(schema *AnnotatedSchema, reason string, exists bool, user string) error
	AllEventMetadata() (*AllEventMetadata, error)
	UpdateEventMetadata(req *core.ClientUpdateEventMetadataRequest, user string) *core.WebError
}

BpSchemaBackend is the interface of the blueprint db backend that stores schema state

func NewSchemaBackend

func NewSchemaBackend(db *sql.DB) (BpSchemaBackend, error)

NewSchemaBackend creates a postgres bpdb backend to interface with the kinesis configuration store

type Bpdb

type Bpdb interface {
	GetMaintenanceMode() MaintenanceMode
	SetMaintenanceMode(switchingOn bool, user, reason string) error
	ActiveUsersLast30Days() ([]*ActiveUser, error)
	DailyChangesLast30Days() ([]*DailyChange, error)
	GetSchemaMaintenanceMode(string) (MaintenanceMode, error)
	SetSchemaMaintenanceMode(schema string, switchingOn bool, user, reason string) error
}

Bpdb is the interface of the blueprint db backend that interacts with global maintenance mode and stats

func NewPostgresBackend

func NewPostgresBackend(db *sql.DB) (Bpdb, error)

NewPostgresBackend creates a postgres bpdb backend to interface with the maintenance mode and stats store

type DailyChange

type DailyChange struct {
	Day     string
	Changes int
	Users   int
}

DailyChange is a count of changes by users on a day.

type EventMetadata

type EventMetadata struct {
	EventName string
	Metadata  map[string]EventMetadataRow // The key in the map is a MetadataType
}

EventMetadata is the metadata associated with an event schema

type EventMetadataRow

type EventMetadataRow struct {
	MetadataValue string
	TS            time.Time
	UserName      string
	Version       int
}

EventMetadataRow stores the data of one row of event_metadata (excluding EventName and MetadataType)

type MaintenanceMode

type MaintenanceMode struct {
	IsInMaintenanceMode bool
	User                string
}

MaintenanceMode represents a maintenance mode state and user that created that state

Jump to

Keyboard shortcuts

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