processManager

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: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompileHandler uint8 = iota
	InitHandler
	DebugHandlerStart
	DebugHandlerStop
	OnDeployHandler
)

For InitEvent

View Source
const (
	LogLevelChange uint8 = iota
	TimeContextSize
)

For HandlerDynamicSettings

View Source
const (
	VbMap uint8 = iota
	VbAddChanges
	FilterVb
)

For VbSettings

View Source
const (
	// maybe init also comes in this category
	Pause uint8 = iota
	Resume
	Stop
)

For LifeCycleChange

View Source
const (
	LatencyStats uint8 = iota
	Insight
	FailureStats
	ExecutionStats
	LcbExceptions
	CurlLatencyStats
	ProcessedEvents
	StatsAckBytes
	AllStats
)

For StatsEvent

View Source
const (
	DcpMutation uint8 = iota
	DcpDeletion
	DcpNoOp
	DcpCollectionDelete
)

For DcpEvent

View Source
const (
	RawDatatype uint8 = iota
	JsonDatatype
)
View Source
const (
	AckBytes uint8 = iota
)
View Source
const (
	FeatureMatrix uint8 = iota
)

GlobalConfigChange

Variables

This section is empty.

Functions

func NewUtilityWorker

func NewUtilityWorker(clusterSettings *common.ClusterSettings, processName string, systemConfig serverConfig.SystemConfig) *utilityWorker

Types

type AppLogFunction

type AppLogFunction func(id string, msg string)

type Command

type Command uint8
const (
	// Initialise the new handler
	InitEvent Command = iota

	// Functions dynamic settings
	HandlerDynamicSettings

	// Vb related settings
	VbSettings

	// pause/resume/stop
	LifeCycleChange

	// For statistics
	StatsEvent

	// Dcp event
	DcpEvent

	// GlobalConfig change
	GlobalConfigChange

	// InternalComm change
	InternalComm
)

type MessageDeliver

type MessageDeliver interface {
	// ReceiveMessage is when msg is received from the c++ side
	ReceiveMessage(msg *ResponseMessage)

	// ApplicationLog will write the message to the application log
	ApplicationLog(msg string)
}

type OnDeployAckMsg

type OnDeployAckMsg struct {
	Status string `json:"on_deploy_status"`
}

For OnDeploy status received from C++ layer

type OnDeployActionObject

type OnDeployActionObject struct {
	Reason string `json:"reason""`
	Delay  int64  `json:"delay""`
}

type ProcessConfig

type ProcessConfig struct {
	Username string
	Password string
	Address  string

	NsServerPort string

	// ipv4/ipv6
	IPMode          common.IpMode
	BreakpadOn      bool
	DebuggerPort    string
	DiagDir         string
	EventingDir     string
	EventingPort    string
	EventingSSLPort string
	ExecPath        string
	CertPath        string
	ClientCertPath  string
	ClientKeyPath   string

	// Id used to create tcp socket
	ID string

	AppLogCallback AppLogFunction
}

func (ProcessConfig) String

func (p ProcessConfig) String() string

type ProcessManager

type ProcessManager interface {
	// Start will start the process. response channel should be used
	// to get response
	// CHECK: if this should return error or not
	// or process manager should takecare of the errors internally
	Start() (<-chan *ResponseMessage, error)
	StartWithContext(ctx context.Context) (<-chan *ResponseMessage, error)

	InitEvent(version uint32, opcode uint8, handlerID []byte, value interface{})

	VbSettings(version uint32, opcode uint8, handlerID []byte, key interface{}, value interface{})

	LifeCycleOp(version uint32, opcode uint8, handlerID []byte)

	SendControlMessage(version uint32, cmd Command, opcode uint8, handlerID []byte, key, value interface{})

	GetStats(version uint32, opcode uint8, handlerID []byte)

	WriteDcpMessage(version uint32, buffer *bytes.Buffer, opcode uint8, workerID uint8,
		instanceID []byte, msg *dcpMessage.DcpEvent, internalInfo *checkpointManager.ParsedInternalDetails) int32

	FlushMessage(version uint32, buffer *bytes.Buffer)

	GetProcessVersion() uint32

	StopProcess()
}

ProcessManager will spawn c++ process This will also take care of sending messages to c++ side Response for the process is sent in the response channel

func NewProcessManager

func NewProcessManager(pc ProcessConfig, serverConfig serverConfig.SystemConfig) ProcessManager

type ResponseMessage

type ResponseMessage struct {
	Event     Command
	Opcode    uint8
	HandlerID string

	Extras []byte
	Meta   []byte
	Value  []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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