slave

package
v0.0.0-...-67ae82b Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2016 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const KeyfilePermissions = 0600

Variables

This section is empty.

Functions

func NewBusyTable

func NewBusyTable() *busyTable

Types

type ConcreteMongodConfigurator

type ConcreteMongodConfigurator struct {
	MongodSoftShutdownTimeout time.Duration
	MongodResponseTimeout     time.Duration
}

func (*ConcreteMongodConfigurator) ApplyMongodConfiguration

func (c *ConcreteMongodConfigurator) ApplyMongodConfiguration(m msp.Mongod) *msp.Error

func (*ConcreteMongodConfigurator) InitiateReplicaSet

func (c *ConcreteMongodConfigurator) InitiateReplicaSet(m msp.RsInitiateMessage) *msp.Error

func (*ConcreteMongodConfigurator) MongodConfiguration

func (c *ConcreteMongodConfigurator) MongodConfiguration(port msp.PortNumber, cred msp.MongodCredential) (msp.Mongod, *msp.Error)

type Controller

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

func NewController

func NewController(processManager *ProcessManager, configurator MongodConfigurator, mongodHardShutdownTimeout time.Duration) *Controller

func (*Controller) EstablishMongodState

func (c *Controller) EstablishMongodState(m msp.Mongod) *msp.Error

func (*Controller) RequestStatus

func (c *Controller) RequestStatus() ([]msp.Mongod, *msp.Error)

func (*Controller) RsInitiate

func (c *Controller) RsInitiate(m msp.RsInitiateMessage) *msp.Error

type MongodConfigurator

type MongodConfigurator interface {
	MongodConfiguration(p msp.PortNumber, cred msp.MongodCredential) (msp.Mongod, *msp.Error)
	ApplyMongodConfiguration(m msp.Mongod) *msp.Error
	InitiateReplicaSet(m msp.RsInitiateMessage) *msp.Error
}

type ProcessManager

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

func NewProcessManager

func NewProcessManager(command string, dataDir string) *ProcessManager

func (*ProcessManager) CreateManagedDirs

func (p *ProcessManager) CreateManagedDirs() (err error)

Create directories managed by ProcessManager returns nil if already exists and permissions are suitable

func (*ProcessManager) HasProcess

func (p *ProcessManager) HasProcess(port msp.PortNumber) bool

func (*ProcessManager) KillProcess

func (p *ProcessManager) KillProcess(port msp.PortNumber) error

func (*ProcessManager) KillProcesses

func (p *ProcessManager) KillProcesses() error

killProcess is destructive. Even when there was an error (already killed, stuck state, permissions lost), we do not care. The error is purely informational that _something_ went wrong. This function is to be used for complete clean restart/shutdown only.

func (*ProcessManager) Run

func (p *ProcessManager) Run()

func (*ProcessManager) RunningProcesses

func (p *ProcessManager) RunningProcesses() []msp.PortNumber

func (*ProcessManager) SpawnProcess

func (p *ProcessManager) SpawnProcess(m msp.Mongod) (err error)

Spawn a new Mongod process

The Mongod's `--keyfile` is only updated when it is spawned

func (*ProcessManager) UpdateKeyfile

func (p *ProcessManager) UpdateKeyfile(m msp.Mongod) (err error)

Update or create the keyfile of a Mongod

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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