checkpointManager

package
v0.0.0-...-0687e5b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Checkpoint_Vbuuid checkpointField = iota
	Checkpoint_ManifestID
	Checkpoint_FailoverLog
	Checkpoint_ProcessedSeqNum
	Checkpoint_SeqNum
)
View Source
const (
	DebuggerLeader leaderType = iota
	OnDeployLeader
)

Variables

View Source
var (
	ErrDocumentNotFound = errors.New("document not found")
)

Functions

func DeleteDebuggerCallback

func DeleteDebuggerCallback(appLocation application.AppLocation) error

func DeleteDebuggerCheckpoint

func DeleteDebuggerCheckpoint(collectionHandle *gocb.Collection, observer notifier.Observer, keyspace application.Keyspace, id uint32) error

func DeleteOnDeployCheckpoint

func DeleteOnDeployCheckpoint(appLocation application.AppLocation, collectionHandle *gocb.Collection, observer notifier.Observer, keyspace application.Keyspace) error

func GetBucketObject

func GetBucketObject(cluster *gocb.Cluster, observer notifier.Observer, bucketName string) (bucket *gocb.Bucket, err error)

func GetBucketObjectWithRetry

func GetBucketObjectWithRetry(cluster *gocb.Cluster, retryCount int, observer notifier.Observer, bucketName string) (bucket *gocb.Bucket, err error)

negetive retry means infinite retry

func GetCheckpointKeyTemplate

func GetCheckpointKeyTemplate(appId uint32) string

GetCheckpointKeyTemplate returns checkpoint blob key

func GetCollectionHandle

func GetCollectionHandle(bucket *gocb.Bucket, keyspace application.Keyspace) (collection *gocb.Collection)

func GetDebuggerURL

func GetDebuggerURL(collectionHandle *gocb.Collection, observer notifier.Observer, keyspace application.Keyspace, id uint32) (string, error)

func GetGocbClusterObject

func GetGocbClusterObject(clusterConfig *common.ClusterSettings, observer notifier.Observer, globalStatsCounter *common.GlobalStatsCounter) (cluster *gocb.Cluster)

func NewVbBlobInternal

func NewVbBlobInternal(key string, observer notifier.Observer, checkpointConfig *CheckpointConfig, collectionHandler collectionHandle, forced bool) (*vbBlobInternal, string, error)

Get the ownership of the blob

func SetDebuggerCallback

func SetDebuggerCallback(appLocation application.AppLocation, value []byte) error

func WriteDebuggerCheckpoint

func WriteDebuggerCheckpoint(collectionHandle *gocb.Collection, observer notifier.Observer, keyspace application.Keyspace, id uint32) (string, error)

func WriteDebuggerUrl

func WriteDebuggerUrl(collectionHandle *gocb.Collection, observer notifier.Observer, keyspace application.Keyspace, id uint32, url string) error

Types

type BucketCheckpoint

type BucketCheckpoint interface {
	GetCheckpointManager(appId uint32, interruptCallback InterruptFunction, appLocation application.AppLocation, keyspace application.Keyspace) Checkpoint
	TlsSettingChange(gocbCluster *gocb.Cluster)
	CloseBucketManager()
}

func NewBucketCheckpointManager

func NewBucketCheckpointManager(clusterSettings *common.ClusterSettings, bucketName string, gocbCluster *gocb.Cluster, observer notifier.Observer, broadcaster common.Broadcaster) BucketCheckpoint

type Checkpoint

type Checkpoint interface {
	OwnershipSnapshot(*common.AppRebalanceProgress)

	OwnVbCheckpoint(vb uint16)
	UpdateVal(vb uint16, field checkpointField, value interface{})

	StopCheckpoint(vb uint16)
	CloseCheckpointManager()

	DeleteCheckpointBlob(vb uint16) error
	DeleteKeys(deleteKeys []string)

	SyncUpsertCheckpoint(vb uint16, vbBlob *VbBlob) error

	TlsSettingChange(*gocb.Bucket)
	WaitTillAllGiveUp(vbs uint16)
	GetKeyPrefix() string

	GetTimerCheckpoints(appId uint32) (*gocb.ScanResult, error)
	GetRuntimeStats() common.StatsInterface

	TryTobeLeader(leaderType leaderType, seq uint32) (bool, error)
	PollUntilOnDeployCompletes() *OnDeployCheckpoint
	PublishOnDeployStatus(status OnDeployState) *OnDeployCheckpoint
}

func NewCheckpointManager

func NewCheckpointManager(cc CheckpointConfig, cluster *gocb.Cluster, clusterConfig *common.ClusterSettings,
	interruptCallback InterruptFunction, observer notifier.Observer, broadcaster common.Broadcaster) Checkpoint

func NewCheckpointManagerForKeyspace

func NewCheckpointManagerForKeyspace(cc CheckpointConfig, interruptCallback InterruptFunction,
	bucket *gocb.Bucket, observer notifier.Observer, broadcaster common.Broadcaster) Checkpoint

func NewCheckpointManagerForKeyspaceWithContext

func NewCheckpointManagerForKeyspaceWithContext(ctx context.Context, cc CheckpointConfig, interruptCallback InterruptFunction,
	bucket *gocb.Bucket, observer notifier.Observer, broadcaster common.Broadcaster) Checkpoint

func NewDummyCheckpointManager

func NewDummyCheckpointManager() Checkpoint

type CheckpointConfig

type CheckpointConfig struct {
	AppLocation  application.AppLocation
	Keyspace     application.Keyspace
	AppID        uint32
	LocalAddress string
	KvPort       string

	OwnerNodeUUID string
}

func (CheckpointConfig) String

func (c CheckpointConfig) String() string

type GocbLogger

type GocbLogger struct{}

func (*GocbLogger) Log

func (r *GocbLogger) Log(level gocb.LogLevel, offset int, format string, v ...interface{}) error

type InterruptFunction

type InterruptFunction func(msg OwnMsg, vb uint16, vbBlob *VbBlob)

type OnDeployCheckpoint

type OnDeployCheckpoint struct {
	NodeUUID string        `json:"node_uuid"`
	Seq      uint32        `json:"seq"`
	Status   OnDeployState `json:"on_deploy_status"`
}

func ReadOnDeployCheckpoint

func ReadOnDeployCheckpoint(appLocation application.AppLocation, collectionHandle *gocb.Collection, observer notifier.Observer, keyspace application.Keyspace) (*OnDeployCheckpoint, error)

type OnDeployState

type OnDeployState string

Ondeploy checkpoint functions

const (
	PendingOnDeploy     OnDeployState = "Pending"
	FinishedOnDeploy    OnDeployState = "Finished"
	FailedStateOnDeploy OnDeployState = "Failed"
)

type OwnMsg

type OwnMsg uint8
const (
	OWNERSHIP_OBTAINED OwnMsg = iota
	OWNERSHIP_CLOSED
)

type ParsedInternalDetails

type ParsedInternalDetails struct {
	AllCursorIds   []string
	StaleCursorIds []string
	RootCas        uint64
	Scope          string
	Collection     string
}

type VbBlob

type VbBlob struct {
	NodeUUID string `json:"node_uuid"`

	Vbuuid          uint64              `json:"vb_uuid"`
	ManifestID      string              `json:"manifest_id"`
	FailoverLog     dcpConn.FailoverLog `json:"failover_log"`
	ProcessedSeqNum uint64              `json:"last_processed_seq_no"`
}

func (*VbBlob) Copy

func (blob *VbBlob) Copy() VbBlob

func (*VbBlob) String

func (blob *VbBlob) String() string

Jump to

Keyboard shortcuts

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