queue

package
v0.0.0-pre.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles interaction between services for the queue.

func NewMigrationHandler

NewMigrationHandler creates a new handler for queued migrations.

func (*Handler) GetMigrationState

func (s *Handler) GetMigrationState(ctx context.Context, batchStatus api.BatchStatusType, migrationStatuses ...api.MigrationStatusType) (map[string]MigrationState, error)

GetMigrationState fetches all migration state information corresponding to the given batch status and migration status.

func (*Handler) InitWorkerCache

func (s *Handler) InitWorkerCache(initial map[uuid.UUID]time.Time) error

func (*Handler) LastWorkerUpdate

func (s *Handler) LastWorkerUpdate(instanceUUID uuid.UUID) time.Time

func (*Handler) RecordWorkerUpdate

func (s *Handler) RecordWorkerUpdate(instanceUUID uuid.UUID)

RecordWorkerUpdate caches the last worker update that the corresponding instance has received.

func (*Handler) RemoveFromCache

func (s *Handler) RemoveFromCache(instanceUUID uuid.UUID)

RemoveFromCache removes the given instanceUUID from the worker cache.

type MigrationState

type MigrationState struct {
	Batch            migration.Batch
	Target           migration.Target
	MigrationWindows migration.MigrationWindows

	QueueEntries map[uuid.UUID]migration.QueueEntry
	Instances    map[uuid.UUID]migration.Instance
	Sources      map[uuid.UUID]migration.Source
}

MigrationState is a cache of all migration data for a batch, queued by instance.

Jump to

Keyboard shortcuts

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