supervisor

package
v0.0.0-...-8836d2b Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MetakvAppsPath refers to path under metakv where app handlers are stored
	MetakvAppsPath = metakvEventingPath + "apps/"

	// MetakvAppsRetryPath refers to path where retry counter for bailing out
	// from operations that are retried upon failure
	MetakvAppsRetryPath = metakvEventingPath + "retry/"

	// MetakvAppSettingsPath refers to path under metakv where app settings are stored
	MetakvAppSettingsPath = metakvEventingPath + "appsettings/"

	// MetakvClusterSettings houses global configs related to Eventing
	MetakvClusterSettings = metakvEventingPath + "settings/"

	// MetakvRebalanceTokenPath refers to path under metakv where rebalance tokens are stored
	MetakvRebalanceTokenPath = metakvEventingPath + "rebalanceToken/"

	// MetakvChecksumPath within metakv is updated when new function definition is loaded
	MetakvChecksumPath = metakvEventingPath + "checksum/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminPortConfig

type AdminPortConfig struct {
	DebuggerPort string
	HTTPPort     string
	SslPort      string
	CertFile     string
	KeyFile      string
}

AdminPortConfig captures settings supplied by cluster manager

type SuperSupervisor

type SuperSupervisor struct {
	CancelCh chan struct{}

	sync.RWMutex
	// contains filtered or unexported fields
}

SuperSupervisor is responsible for managing/supervising all producer instances

func NewSuperSupervisor

func NewSuperSupervisor(adminPort AdminPortConfig, eventingDir, kvPort, restPort, uuid, diagDir string, numVbuckets int) *SuperSupervisor

NewSuperSupervisor creates the super_supervisor handle

func (*SuperSupervisor) AppsRetryCallback

func (s *SuperSupervisor) AppsRetryCallback(path string, value []byte, rev interface{}) error

AppsRetryCallback informs all running functions to update the retry counter

func (*SuperSupervisor) BootstrapAppList

func (s *SuperSupervisor) BootstrapAppList() map[string]string

BootstrapAppList returns list of apps undergoing bootstrap

func (*SuperSupervisor) CheckpointBlobDump

func (s *SuperSupervisor) CheckpointBlobDump(appName string) (interface{}, error)

CheckpointBlobDump returns state of metadata blobs stored in Couchbase bucket

func (*SuperSupervisor) CleanupProducer

func (s *SuperSupervisor) CleanupProducer(appName string, skipMetaCleanup bool) error

CleanupProducer purges all metadata related to a function from couchbase bucket

func (*SuperSupervisor) ClearEventStats

func (s *SuperSupervisor) ClearEventStats()

ClearEventStats flushes event processing stats

func (*SuperSupervisor) DebuggerCallback

func (s *SuperSupervisor) DebuggerCallback(path string, value []byte, rev interface{}) error

func (*SuperSupervisor) DeployedAppList

func (s *SuperSupervisor) DeployedAppList() []string

DeployedAppList returns list of deployed lambdas running under super_supervisor

func (*SuperSupervisor) EventHandlerLoadCallback

func (s *SuperSupervisor) EventHandlerLoadCallback(path string, value []byte, rev interface{}) error

EventHandlerLoadCallback is registered as callback from metakv observe calls on event handlers path

func (*SuperSupervisor) GetAppCode

func (s *SuperSupervisor) GetAppCode(appName string) string

GetAppCode returns handler code for requested appname

func (*SuperSupervisor) GetAppState

func (s *SuperSupervisor) GetAppState(appName string) int8

GetAppState returns current state of app

func (*SuperSupervisor) GetDcpEventsRemainingToProcess

func (s *SuperSupervisor) GetDcpEventsRemainingToProcess(appName string) uint64

GetDcpEventsRemainingToProcess returns remaining dcp events to process

func (*SuperSupervisor) GetDebuggerURL

func (s *SuperSupervisor) GetDebuggerURL(appName string) (string, error)

GetDebuggerURL returns the v8 debugger url for supplied appname

func (*SuperSupervisor) GetDeployedApps

func (s *SuperSupervisor) GetDeployedApps() map[string]string

GetDeployedApps returns list of deployed apps and their last deployment time

func (*SuperSupervisor) GetEventProcessingStats

func (s *SuperSupervisor) GetEventProcessingStats(appName string) map[string]uint64

GetEventProcessingStats returns dcp/timer event processing stats

func (*SuperSupervisor) GetEventingConsumerPids

func (s *SuperSupervisor) GetEventingConsumerPids(appName string) map[string]int

GetEventingConsumerPids returns map of Eventing.Consumer worker name and it's os pid

func (*SuperSupervisor) GetExecutionStats

func (s *SuperSupervisor) GetExecutionStats(appName string) map[string]interface{}

GetExecutionStats returns aggregated failure stats from Eventing.Producer instance

func (*SuperSupervisor) GetFailureStats

func (s *SuperSupervisor) GetFailureStats(appName string) map[string]interface{}

GetFailureStats returns aggregated failure stats from Eventing.Producer instance

func (*SuperSupervisor) GetHandlerCode

func (s *SuperSupervisor) GetHandlerCode(appName string) string

GetHandlerCode returns handler code for requested appname

func (*SuperSupervisor) GetLatencyStats

func (s *SuperSupervisor) GetLatencyStats(appName string) map[string]uint64

GetLatencyStats dumps stats from cpp world

func (*SuperSupervisor) GetLcbExceptionsStats

func (s *SuperSupervisor) GetLcbExceptionsStats(appName string) map[string]uint64

GetLcbExceptionsStats returns libcouchbase exception stats from CPP workers

func (*SuperSupervisor) GetLocallyDeployedApps

func (s *SuperSupervisor) GetLocallyDeployedApps() map[string]string

GetLocallyDeployedApps returns list of deployed apps and their last deployment time

func (*SuperSupervisor) GetMetaStoreStats

func (s *SuperSupervisor) GetMetaStoreStats(appName string) map[string]uint64

GetMetaStoreStats returns metastore related stats from all running functions on current node

func (*SuperSupervisor) GetSeqsProcessed

func (s *SuperSupervisor) GetSeqsProcessed(appName string) map[int]int64

GetSeqsProcessed returns vbucket specific sequence nos processed so far

func (*SuperSupervisor) GetSourceMap

func (s *SuperSupervisor) GetSourceMap(appName string) string

GetSourceMap returns source map for requested appname

func (*SuperSupervisor) GlobalConfigChangeCallback

func (s *SuperSupervisor) GlobalConfigChangeCallback(path string, value []byte, rev interface{}) error

GlobalConfigChangeCallback observes the metakv path where Eventing related global configs are written to

func (*SuperSupervisor) HandleGlobalConfigChange

func (s *SuperSupervisor) HandleGlobalConfigChange(config common.Config) error

func (*SuperSupervisor) HandleSupCmdMsg

func (s *SuperSupervisor) HandleSupCmdMsg()

HandleSupCmdMsg handles control commands like app (re)deploy, settings update

func (*SuperSupervisor) InternalVbDistributionStats

func (s *SuperSupervisor) InternalVbDistributionStats(appName string) map[string]string

InternalVbDistributionStats returns internal state of vbucket ownership distribution on local eventing node

func (*SuperSupervisor) NotifyPrepareTopologyChange

func (s *SuperSupervisor) NotifyPrepareTopologyChange(ejectNodes, keepNodes []string)

NotifyPrepareTopologyChange notifies each producer instance running on current eventing nodes about keepNodes supplied by ns_server

func (*SuperSupervisor) PlannerStats

func (s *SuperSupervisor) PlannerStats(appName string) []*common.PlannerNodeVbMapping

PlannerStats returns vbucket distribution as per planner running on local eventing node for a given app

func (*SuperSupervisor) RebalanceStatus

func (s *SuperSupervisor) RebalanceStatus() bool

RebalanceStatus reports back status of rebalance for all running apps on current node

func (*SuperSupervisor) RebalanceTaskProgress

func (s *SuperSupervisor) RebalanceTaskProgress(appName string) (*common.RebalanceProgress, error)

RebalanceTaskProgress reports vbuckets remaining to be transferred as per planner during the course of rebalance

func (*SuperSupervisor) RemoveProducerToken

func (s *SuperSupervisor) RemoveProducerToken(appName string)

RemoveProducerToken takes out appName from supervision tree

func (*SuperSupervisor) RestPort

func (s *SuperSupervisor) RestPort() string

RestPort returns ns_server port(typically 8091/9000)

func (*SuperSupervisor) SettingsChangeCallback

func (s *SuperSupervisor) SettingsChangeCallback(path string, value []byte, rev interface{}) error

SettingsChangeCallback is registered as callback from metakv observe calls on event handler settings path

func (*SuperSupervisor) SignalStopDebugger

func (s *SuperSupervisor) SignalStopDebugger(appName string) error

SignalStopDebugger stops V8 Debugger for a specific deployed lambda

func (*SuperSupervisor) SpanBlobDump

func (s *SuperSupervisor) SpanBlobDump(appName string) (interface{}, error)

SpanBlobDump returns state of timer span blobs stored in metadata bucket

func (*SuperSupervisor) StopProducer

func (s *SuperSupervisor) StopProducer(appName string, skipMetaCleanup bool)

StopProducer tries to gracefully stop running producer instance for a function

func (*SuperSupervisor) TimerDebugStats

func (s *SuperSupervisor) TimerDebugStats(appName string) (map[int]map[string]interface{}, error)

TimerDebugStats captures timer related stats to assist in debugging mismtaches during rebalance

func (*SuperSupervisor) TopologyChangeNotifCallback

func (s *SuperSupervisor) TopologyChangeNotifCallback(path string, value []byte, rev interface{}) error

TopologyChangeNotifCallback is registered to notify any changes in MetaKvRebalanceTokenPath

func (*SuperSupervisor) VbDcpEventsRemainingToProcess

func (s *SuperSupervisor) VbDcpEventsRemainingToProcess(appName string) map[int]int64

VbDcpEventsRemainingToProcess returns remaining dcp events to process

func (*SuperSupervisor) VbDistributionStatsFromMetadata

func (s *SuperSupervisor) VbDistributionStatsFromMetadata(appName string) map[string]map[string]string

VbDistributionStatsFromMetadata returns vbucket distribution across eventing nodes from metadata bucket

func (*SuperSupervisor) VbSeqnoStats

func (s *SuperSupervisor) VbSeqnoStats(appName string) (map[int][]map[string]interface{}, error)

VbSeqnoStats returns seq no stats, which can be useful in figuring out missed events during rebalance

func (*SuperSupervisor) WriteDebuggerToken

func (s *SuperSupervisor) WriteDebuggerToken(appName, token string)

func (*SuperSupervisor) WriteDebuggerURL

func (s *SuperSupervisor) WriteDebuggerURL(appName, url string)

Jump to

Keyboard shortcuts

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