cmd

package
v0.0.0-...-705e2cb Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: Apache-2.0 Imports: 5 Imported by: 2

README

###Creator Maintainer and Destroyer (cmd)

this is the important part of the framework which manages the overall workflow.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSlaves

func CreateSlaves(Inst *typ.Instance, ProcID string) bool

CreateSlaves Call this to create N slaves it automatically updates the store/DB

func Creator

func Creator()

Creator Goroutine responsible for creating a redis instance/Proc waits on channel Cchan for any work to be done

func Destoryer

func Destoryer() bool

Destoryer This shouldbe started as a goroutine as it runs unconditionally This listens on the Dchan declared globally, A pointer to Proc variable is sent across through this channel The only job of this goroutine is to update MSG structure of the Proc entry The MSG will be read by RedMon (Redis Monitoring goroutine) and perform the action The primary duty of this goroutine is to initate send SHUTDOWN of a redis PROC

func Maintainer

func Maintainer()

Maintainer This is the main function that handles all the task updates

func MakeMaster

func MakeMaster(I *typ.Instance, PromotedSlave *typ.Proc)

MakeMaster Now that we have chosen a slave as a master make that as a master properly by communicating to Destroyer

func PromoteASlave

func PromoteASlave(I *typ.Instance) *typ.Proc

PromoteASlave This will load all the procs whose type is SLAVE and elect a Slave as a new master, should be called when a master Proc Failed / Crashed

func SlaveOf

func SlaveOf(I *typ.Instance, P *typ.Proc)

SlaveOf This function will make all the availablel slaves point to the newly promoted master and send request to the Creator to create an additional slave

Types

This section is empty.

Jump to

Keyboard shortcuts

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