migrations

package
v0.0.0-...-66c7a0d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MigrationWorkflowName         = cereal.NewWorkflowName("migration-workflow")
	UpgradeTaskName               = cereal.NewTaskName("upgrade-task")
	ControlIndexMigrationTaskName = cereal.NewTaskName("control-index-task")
)

Functions

func InitCerealManager

func InitCerealManager(cerealManager *cereal.Manager, workerCount int, client *ingestic.ESClient, upgradesDB *pgdb.UpgradesDB) error

Types

type ControlIndexUpgradeTask

type ControlIndexUpgradeTask struct {
	ESClient   *ingestic.ESClient
	UpgradesDB *pgdb.UpgradesDB
}

type MigrationWorkflow

type MigrationWorkflow struct {
}

func (*MigrationWorkflow) OnCancel

func (*MigrationWorkflow) OnStart

func (*MigrationWorkflow) OnTaskComplete

type MigrationWorkflowParameters

type MigrationWorkflowParameters struct {
	ControlIndexFlag bool
	UpgradeDate      time.Time
}

type MigrationWorkflowPayload

type MigrationWorkflowPayload struct {
	ControlIndexFlag bool
}

type Upgrade

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

func NewService

func NewService(pg *pgdb.UpgradesDB, cerealManger *cereal.Manager) *Upgrade

func (*Upgrade) PollForUpgradeFlagDayLatest

func (u *Upgrade) PollForUpgradeFlagDayLatest(upgradeDate time.Time) error

PollForUpgradeFlagDayLatest checks for the day latest flag value in upgrade flags

func (*Upgrade) UpdateFlags

func (u *Upgrade) UpdateFlags(isConfigEnabled bool) (date time.Time, err error)

UpdateFlags makes the necessary changes to upgrade_flags table based on the received configuration as below If isConfigEnabled - true --> returns the existing timestamp(we need to run the upgrades till that day), and removes the flag record from DB once the upgrade is successful If isConfigEnabled - false and flag entry not available in DB --> create a record for enhanced_reporting with upgrade_time as current time, and update the control_index upgrade_value to true(so that when the config enabled, it triggers the upgrade for control index) If isConfigEnabled - false and flag entry available in DB --> update the control_index upgrade_value to true

type UpgradeParameters

type UpgradeParameters struct {
	DayLatestFlag   bool
	ControlFlag     bool
	CompRunInfoFlag bool
	UpgradeDate     time.Time
}

type UpgradeTask

type UpgradeTask struct {
	ESClient   *ingestic.ESClient
	UpgradesDB *pgdb.UpgradesDB
}

func (*UpgradeTask) Run

func (t *UpgradeTask) Run(ctx context.Context, task cereal.Task) (interface{}, error)

Jump to

Keyboard shortcuts

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