vbhandler

package
v0.0.0-...-62d15c8 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimerPartitionsInVbs

func GetTimerPartitionsInVbs(vbs []uint16, numVbs, numTimerPartitions uint16) ([]uint16, []uint16)

func InitWorkerDetails

func InitWorkerDetails() *workerDetails

Concurency should be controlled by caller

func NewAllocatorWithContext

func NewAllocatorWithContext(ctx context.Context, logPrefix string, keyspace application.Keyspace,
	workers []*workerDetails, dcpManager requester,
	config *Config) *allocator

func NewBytesStats

func NewBytesStats() *bytesStats

func NewMsgBuffer

func NewMsgBuffer(version uint32, instanceID []byte, runtimeSystem RuntimeSystem) *msgBuffer

Types

type Config

type Config struct {
	Version       uint32
	FuncID        uint16
	TenantID      string
	AppLocation   application.AppLocation
	ConfiguredVbs uint16
	InstanceID    []byte
	DcpType       serverConfig.DeploymentMode

	HandlerSettings application.HandlerSettings
	MetaInfo        application.MetaInfo

	RuntimeSystem         RuntimeSystem
	OwnershipRoutine      Ownership
	CheckpointManager     checkpointManager.Checkpoint
	Pool                  eventPool.ManagerPool
	StatsHandler          StatsHandler
	SystemResourceDetails SystemResourceDetails
	Filter                FilterInterface
}

type FilterInterface

type FilterInterface interface {
	CheckAndGetEventsInternalDetails(msg *dcpMessage.DcpEvent) (*checkpointManager.ParsedInternalDetails, bool)
	IsTrapEvent() (RuntimeSystem, bool)
}

type Ownership

type Ownership interface {
	GetVbMap(version string, keyspaceInfo *application.KeyspaceInfo, id uint16, numVb, timerVbs uint16, appLocation application.AppLocation) (string, []uint16, error)
}

type RuntimeSystem

type RuntimeSystem interface {
	GetProcessDetails() processManager.ProcessDetails
	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)
	VbSettings(version uint32, opcode uint8, handlerID []byte, key interface{}, value interface{})
}

type StatsHandler

type StatsHandler interface {
	IncrementCountProcessingStats(key string, count uint64)
}

type SystemResourceDetails

type SystemResourceDetails interface {
	MemRequiredPerThread(application.KeyspaceInfo) float64
}

type VbHandler

type VbHandler interface {
	// GetHighSeqNum returns the high seq number of the owned vbs
	GetHighSeqNum() map[uint16]uint64

	// RefreshSystemResourceLimits refreshes the system resource limits
	RefreshSystemResourceLimits()

	GetRuntimeStats() common.StatsInterface

	// NotifyOwnershipChange notifies the new vb map. Returns newly added and closed vbs
	NotifyOwnershipChange(version string) (vbMapVersion string, newVbs []uint16, closedVbs []uint16, notFullyOwned []uint16, err error)

	// VbHandlerSnapshot returns the still to be owned and closed vbs
	VbHandlerSnapshot(appProgress *common.AppRebalanceProgress)

	// AddVb will add it to the requester map. Returns how many remained to own
	// NotifyOwnershipChange should be called before AddVb
	AddVb(vb uint16, vbBlob *checkpointManager.VbBlob) int

	// CloseVb will close the requester and filter out any mutations related to this vb
	// Returns how many remained to be closed
	// NotifyOwnershipChange should be called before CloseVb
	CloseVb(vb uint16) int

	// AckMessages notes how many msgs and there bytes are processed by RuntimeSystem
	AckMessages(value []byte) (int, int)

	// Close closes all the vbs and returns how many ownership is closed
	Close() []uint16
}

func NewDummyVbHandler

func NewDummyVbHandler() VbHandler

func NewVbHandler

func NewVbHandler(ctx context.Context, logPrefix string, keyspace application.Keyspace, config *Config) VbHandler

Jump to

Keyboard shortcuts

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