producer

package
v0.0.0-...-31abfad Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Producer

type Producer struct {
	MemoryQuota int64
	// contains filtered or unexported fields
}

Producer handle - one instance per app per eventing node

func NewProducer

func NewProducer(appName, debuggerPort, eventingPort, eventingSSLPort, eventingDir, kvPort,
	metakvAppHostPortsPath, nsServerPort, uuid, diagDir string, memoryQuota int64,
	featureMatrix uint32, superSup common.EventingSuperSup, cursorRegistry common.CursorRegistryMgr) *Producer

NewProducer creates a new producer instance using parameters supplied by super_supervisor

func (*Producer) AddMetadataPrefix

func (p *Producer) AddMetadataPrefix(key string) common.Key

AddMetadataPrefix prepends user prefix and handler UUID to namespacing within metadata bucket

func (*Producer) AggregateCurlStats

func (p *Producer) AggregateCurlStats(in interface{}, curlMap map[string]float64)

func (*Producer) AppendCurlLatencyStats

func (p *Producer) AppendCurlLatencyStats(deltas common.StatsData)

func (*Producer) AppendLatencyStats

func (p *Producer) AppendLatencyStats(deltas common.StatsData)

func (*Producer) BootstrapStatus

func (p *Producer) BootstrapStatus() bool

BootstrapStatus returns state of bootstrap for all running consumer instances

func (*Producer) CfgData

func (p *Producer) CfgData() string

CfgData returns deployment descriptor content

func (*Producer) CheckpointBlobDump

func (p *Producer) CheckpointBlobDump() map[string]interface{}

CheckpointBlobDump returns state of metadata blobs stored in Couchbase bucket

func (*Producer) CleanupMetadataBucket

func (p *Producer) CleanupMetadataBucket(skipCheckpointBlobs bool) error

CleanupMetadataBucket clears up all application related artifacts from metadata bucket post undeploy

func (*Producer) CleanupUDSs

func (p *Producer) CleanupUDSs()

CleanupUDSs clears up UDS created for communication between Go and eventing-consumer

func (*Producer) ClearEventStats

func (p *Producer) ClearEventStats()

ClearEventStats flushes event processing stats

func (*Producer) DcpFeedBoundary

func (p *Producer) DcpFeedBoundary() string

DcpFeedBoundary returns feed boundary used for vb dcp streams

func (*Producer) FunctionManageBucket

func (p *Producer) FunctionManageBucket() string

func (*Producer) FunctionManageScope

func (p *Producer) FunctionManageScope() string

func (*Producer) GetAppCode

func (p *Producer) GetAppCode() string

GetAppCode returns handler code for the current app

func (*Producer) GetAppLog

func (p *Producer) GetAppLog(sz int64) []string

GetAppLog returns tail of app log, trying to fetch up to 'sz' bytes

func (*Producer) GetCurlLatencyStats

func (p *Producer) GetCurlLatencyStats() common.StatsData

func (*Producer) GetCursorAware

func (p *Producer) GetCursorAware() bool

func (*Producer) GetDcpEventsRemainingToProcess

func (p *Producer) GetDcpEventsRemainingToProcess() uint64

GetDcpEventsRemainingToProcess returns remaining dcp events to process

func (*Producer) GetDebuggerToken

func (p *Producer) GetDebuggerToken() string

GetDebuggerToken returns debug token

func (*Producer) GetDebuggerURL

func (p *Producer) GetDebuggerURL() (string, error)

GetDebuggerURL returns V8 Debugger url

func (*Producer) GetEventProcessingStats

func (p *Producer) GetEventProcessingStats() map[string]uint64

GetEventProcessingStats exposes dcp/timer processing stats

func (*Producer) GetEventingConsumerPids

func (p *Producer) GetEventingConsumerPids() map[string]int

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

func (*Producer) GetExecutionStats

func (p *Producer) GetExecutionStats() map[string]interface{}

GetExecutionStats returns execution stats aggregated from Eventing.Consumer instances

func (*Producer) GetFailureStats

func (p *Producer) GetFailureStats() map[string]interface{}

GetFailureStats returns failure stats aggregated from Eventing.Consumer instances

func (*Producer) GetFuncScopeDetails

func (p *Producer) GetFuncScopeDetails() (string, uint32)

func (*Producer) GetFunctionInstanceId

func (p *Producer) GetFunctionInstanceId() string

func (*Producer) GetInsight

func (p *Producer) GetInsight() *common.Insight

func (*Producer) GetLatencyStats

func (p *Producer) GetLatencyStats() common.StatsData

GetLatencyStats returns latency stats for event handlers from from cpp world

func (*Producer) GetLcbExceptionsStats

func (p *Producer) GetLcbExceptionsStats() map[string]uint64

GetLcbExceptionsStats returns libcouchbase exception stats from CPP workers

func (*Producer) GetMetaStoreStats

func (p *Producer) GetMetaStoreStats() map[string]uint64

GetMetaStoreStats exposes timer store related stat counters

func (*Producer) GetMetadataKeyspaceID

func (p *Producer) GetMetadataKeyspaceID() (common.KeyspaceID, bool)

func (*Producer) GetMetadataPrefix

func (p *Producer) GetMetadataPrefix() string

GetMetadataPrefix returns prefix used for blobs stored in Couchbase bucket

func (*Producer) GetNsServerPort

func (p *Producer) GetNsServerPort() string

GetNsServerPort return rest port for ns_server

func (*Producer) GetOwner

func (p *Producer) GetOwner() *common.Owner

func (*Producer) GetSeqsProcessed

func (p *Producer) GetSeqsProcessed() map[int]int64

GetSeqsProcessed returns vbucket specific sequence nos processed so far

func (*Producer) GetSourceKeyspaceID

func (p *Producer) GetSourceKeyspaceID() (common.KeyspaceID, bool)

func (*Producer) GetVbOwner

func (p *Producer) GetVbOwner(vb uint16) (string, string, error)

GetVbOwner returns assigned eventing nodes and worker for a vbucket

func (*Producer) InternalVbDistributionStats

func (p *Producer) InternalVbDistributionStats() map[string]string

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

func (*Producer) IsEventingNodeAlive

func (p *Producer) IsEventingNodeAlive(eventingHostPortAddr, nodeUUID string) bool

IsEventingNodeAlive verifies if a hostPortAddr combination is an active eventing node

func (*Producer) IsPlannerRunning

func (p *Producer) IsPlannerRunning() bool

IsPlannerRunning returns planner execution status

func (*Producer) IsTrapEvent

func (p *Producer) IsTrapEvent() bool

IsTrapEvent signifies if debugger should trap events

func (*Producer) KillAllConsumers

func (p *Producer) KillAllConsumers()

Last ditch effort to kill all consumers

func (*Producer) KillAndRespawnEventingConsumer

func (p *Producer) KillAndRespawnEventingConsumer(c common.EventingConsumer)

KillAndRespawnEventingConsumer cleans up a dead consumer handle from list of active running consumers

func (*Producer) KvHostPorts

func (p *Producer) KvHostPorts() []string

KvHostPorts returns host:port combination for kv service

func (*Producer) LenRunningConsumers

func (p *Producer) LenRunningConsumers() int

LenRunningConsumers returns the number of actively running consumers for a given app's producer

func (*Producer) MetadataBucket

func (p *Producer) MetadataBucket() string

MetadataBucket return metadata bucket for event handler

func (*Producer) MetadataCollection

func (p *Producer) MetadataCollection() string

func (*Producer) MetadataScope

func (p *Producer) MetadataScope() string

func (*Producer) NotifyInit

func (p *Producer) NotifyInit()

NotifyInit notifies the supervisor about producer initialisation

func (*Producer) NotifyPrepareTopologyChange

func (p *Producer) NotifyPrepareTopologyChange(ejectNodes, keepNodes []string, changeType service.TopologyChangeType)

NotifyPrepareTopologyChange captures keepNodes supplied as part of topology change message

func (*Producer) NotifySettingsChange

func (p *Producer) NotifySettingsChange()

NotifySettingsChange is called by super_supervisor to notify producer about settings update

func (*Producer) NotifySupervisor

func (p *Producer) NotifySupervisor()

NotifySupervisor notifies the supervisor about clean shutdown of producer

func (*Producer) NotifyTopologyChange

func (p *Producer) NotifyTopologyChange(msg *common.TopologyChangeMsg)

NotifyTopologyChange is used by super_supervisor to notify producer about topology change

func (*Producer) NsServerHostPort

func (p *Producer) NsServerHostPort() string

NsServerHostPort returns host:port combination for ns_server instance

func (*Producer) NsServerNodeCount

func (p *Producer) NsServerNodeCount() int

NsServerNodeCount returns count of currently active ns_server nodes in the cluster

func (*Producer) PauseProducer

func (p *Producer) PauseProducer()

PauseProducer pauses the execution of Eventing.Producer and corresponding Eventing.Consumer instances

func (*Producer) PlannerStats

func (p *Producer) PlannerStats() []*common.PlannerNodeVbMapping

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

func (*Producer) RebalanceStatus

func (p *Producer) RebalanceStatus() bool

RebalanceStatus returns state of rebalance for all running consumer instances

func (*Producer) RebalanceTaskProgress

func (p *Producer) RebalanceTaskProgress() *common.RebalanceProgress

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

func (*Producer) RemoveConsumerToken

func (p *Producer) RemoveConsumerToken(workerName string)

RemoveConsumerToken removes specified worker from supervisor tree

func (*Producer) ResetCounters

func (p *Producer) ResetCounters()

func (*Producer) ResumeProducer

func (p *Producer) ResumeProducer()

ResumeProducer after pausing Before resuming the producer, make sure that gocb handle is registered on the correct pool

func (*Producer) Serve

func (p *Producer) Serve()

Serve implements suptree.Service interface

func (*Producer) SetFeatureMatrix

func (p *Producer) SetFeatureMatrix(featureMatrix uint32)

func (*Producer) SetRetryCount

func (p *Producer) SetRetryCount(retryCount int64)

SetRetryCount changes the retry count for early bail out from retry ops

func (*Producer) SetTrapEvent

func (p *Producer) SetTrapEvent(value bool)

SetTrapEvent flips trap event flag

func (*Producer) SignalBootstrapFinish

func (p *Producer) SignalBootstrapFinish()

SignalBootstrapFinish is leveraged by EventingSuperSup instance to check if app handler has finished bootstrapping

func (*Producer) SignalStartDebugger

func (p *Producer) SignalStartDebugger(token string) error

SignalStartDebugger sets up necessary flags to signal debugger start

func (*Producer) SignalStopDebugger

func (p *Producer) SignalStopDebugger() error

SignalStopDebugger signals to stop debugger session

func (*Producer) SourceBucket

func (p *Producer) SourceBucket() string

SourceBucket returns the source bucket for event handler

func (*Producer) SourceCollection

func (p *Producer) SourceCollection() string

SourceCollection returns the source collection for event handler

func (*Producer) SourceScope

func (p *Producer) SourceScope() string

SourceScope returns the source scope for event handler

func (*Producer) SpanBlobDump

func (p *Producer) SpanBlobDump() map[string]interface{}

SpanBlobDump returns state of timer span blobs stored in metadata bucket

func (*Producer) SrcMutation

func (p *Producer) SrcMutation() bool

func (*Producer) Stop

func (p *Producer) Stop(context string)

Stop implements suptree.Service interface

func (*Producer) StopRunningConsumers

func (p *Producer) StopRunningConsumers()

StopRunningConsumers stops all running instances of Eventing.Consumer

func (*Producer) String

func (p *Producer) String() string

Implement fmt.Stringer interface for better debugging in case producer routine crashes and supervisor has to respawn it

func (*Producer) TimerDebugStats

func (p *Producer) TimerDebugStats() map[int]map[string]interface{}

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

func (*Producer) UndeployHandler

func (p *Producer) UndeployHandler(msg common.UndeployAction)

func (*Producer) UpdateEncryptionLevel

func (p *Producer) UpdateEncryptionLevel(enforceTLS, encryptOn bool)

func (*Producer) UpdateMemoryQuota

func (p *Producer) UpdateMemoryQuota(quota int64)

UpdateMemoryQuota allows tuning of memory quota for Eventing

func (*Producer) UsingTimer

func (p *Producer) UsingTimer() bool

func (*Producer) VbDcpEventsRemainingToProcess

func (p *Producer) VbDcpEventsRemainingToProcess() map[int]int64

VbDcpEventsRemainingToProcess returns remaining dcp events to process per vbucket

func (*Producer) VbDistributionStatsFromMetadata

func (p *Producer) VbDistributionStatsFromMetadata() map[string]map[string]string

VbDistributionStatsFromMetadata dumps the state of vbucket distribution per metadata bucket

func (*Producer) VbSeqnoStats

func (p *Producer) VbSeqnoStats() map[int][]map[string]interface{}

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

func (*Producer) WriteAppLog

func (p *Producer) WriteAppLog(log string)

WriteAppLog dumps the application specific log message to configured file

func (*Producer) WriteDebuggerToken

func (p *Producer) WriteDebuggerToken(token string, hostnames []string) error

WriteDebuggerToken stores debugger token into metadata bucket

func (*Producer) WriteDebuggerURL

func (p *Producer) WriteDebuggerURL(url string)

WriteDebuggerURL stores debugger info in metadata bucket

Jump to

Keyboard shortcuts

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