janitor

package
v2.1.0-alpha.2+incompa... Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2017 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableModules

func AvailableModules() (modules []string)

func Register

func Register(name string, janitor Janitor)

Types

type Janitor

type Janitor interface {
	// Run performs one round of fixes. If active is true, the
	// janitor can perform destructive changes to the
	// topology. Otherwise, it is considered to be in dry run
	// mode, and it should only log what it would have done if it
	// were active.
	Run(active bool) error

	// Initialize initializes the Janitor.
	Configure(wr *wrangler.Wrangler, keyspace, shard string) error
}

Janitor is a module that fixes the topology. If janitor implements http.Handle, it will have a page added to /janitorz.

type JanitorInfo

type JanitorInfo struct {
	Janitor
	Active bool
	// contains filtered or unexported fields
}

func (*JanitorInfo) AverageRuntime

func (ji *JanitorInfo) AverageRuntime() time.Duration

func (*JanitorInfo) ErrorCount

func (ji *JanitorInfo) ErrorCount() int

func (*JanitorInfo) RecordError

func (ji *JanitorInfo) RecordError(err error)

func (*JanitorInfo) RecordSuccess

func (ji *JanitorInfo) RecordSuccess(start time.Time)

func (*JanitorInfo) Runs

func (ji *JanitorInfo) Runs() int

type JanitorWithStatus

type JanitorWithStatus interface {
	// StatusTemplate should return a string containing the
	// template that should be used to display the status of the
	// janitor. The template should expect to get a JanitorInfo
	// instance wrapping the Janitor itself.
	StatusTemplate() string
}

type Scheduler

type Scheduler struct {
	Keyspace string
	Shard    string
	// contains filtered or unexported fields
}

func New

func New(keyspace, shard string, ts topo.Server, wr *wrangler.Wrangler, sleepTime time.Duration) (*Scheduler, error)

func (*Scheduler) CurrentMasterID

func (scheduler *Scheduler) CurrentMasterID() string

func (*Scheduler) Enable

func (scheduler *Scheduler) Enable(janitorNames []string) error

func (*Scheduler) EnableDryRun

func (scheduler *Scheduler) EnableDryRun(janitorNames []string) error

func (*Scheduler) IsMaster

func (scheduler *Scheduler) IsMaster() bool

func (*Scheduler) Run

func (scheduler *Scheduler) Run()

func (*Scheduler) RunElection

func (scheduler *Scheduler) RunElection()

func (*Scheduler) ServeHTTP

func (scheduler *Scheduler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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