snapshot

package
v0.75.0-preview.8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSnapshotExists = errors.New("snapshot exists")
	ErrNoLastSnapshot = errors.New("no last snapshot")
)

Functions

func UpdateContinuousAggregateDataFromHighWaterMark added in v0.71.0

func UpdateContinuousAggregateDataFromHighWaterMark(ctx context.Context, conn *pgxpool.Pool, toHeight int64) error

Types

type Config

type Config struct {
	WaitForCreationLockTimeout encoding.Duration `` /* 140-byte string literal not displayed */
}

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.

type ContinuousAggregateMetaData added in v0.71.0

type ContinuousAggregateMetaData struct {
	ID             int
	Name           string
	BucketInterval time.Duration
}

type DatabaseMetadata

type DatabaseMetadata struct {
	TableNameToMetaData                    map[string]TableMetadata
	ContinuousAggregatesMetaData           []ContinuousAggregateMetaData
	DatabaseVersion                        int64
	CurrentStateTablesCreateConstraintsSql []string
	CurrentStateTablesDropConstraintsSql   []string
	HistoryStateTablesCreateConstraintsSql []string
	HistoryStateTablesDropConstraintsSql   []string

	AllTablesEnableAutoVacuumSql  []string
	AllTablesDisableAutoVacuumSql []string
}

func NewDatabaseMetaData

func NewDatabaseMetaData(ctx context.Context, connPool *pgxpool.Pool) (DatabaseMetadata, error)

func (DatabaseMetadata) GetHistoryTableNames

func (d DatabaseMetadata) GetHistoryTableNames() []string

type HistoryStore added in v0.73.0

type HistoryStore interface {
	StagedSegment(ctx context.Context, s segment.Full) (segment.Staged, error)
}

type HypertablePartitionColumns

type HypertablePartitionColumns struct {
	HypertableName string
	ColumnName     string
}

type IndexInfo

type IndexInfo struct {
	Tablename string
	Indexname string
	Indexdef  string
}

type LoadLog added in v0.68.0

type LoadLog interface {
	Infof(s string, args ...interface{})
	Info(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
}

type LoadResult

type LoadResult struct {
	LoadedFromHeight int64
	LoadedToHeight   int64
	RowsLoaded       int64
}

type Service

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

func NewSnapshotService

func NewSnapshotService(log *logging.Logger, config Config, connPool *pgxpool.Pool,
	historyStore HistoryStore,
	snapshotsCopyToPath string,
	migrateDatabaseToVersion func(version int64) error,
	migrateSchemaDownToVersion func(version int64) error,
) (*Service, error)

func (*Service) CreateSnapshot

func (b *Service) CreateSnapshot(ctx context.Context, chainID string, toHeight int64) (segment.Unpublished, error)

func (*Service) CreateSnapshotAsynchronously

func (b *Service) CreateSnapshotAsynchronously(ctx context.Context, chainID string, toHeight int64) (segment.Unpublished, error)

func (*Service) GetUnpublishedSnapshots added in v0.71.0

func (b *Service) GetUnpublishedSnapshots() ([]segment.Unpublished, error)

func (*Service) LoadSnapshotData added in v0.68.0

func (b *Service) LoadSnapshotData(
	ctx context.Context,
	log LoadLog,
	ch segment.ContiguousHistory[segment.Full],
	connConfig sqlstore.ConnectionConfig,
	optimiseForAppend,
	verbose bool,
) (LoadResult, error)

func (*Service) RollbackToSegment added in v0.71.0

func (b *Service) RollbackToSegment(ctx context.Context, log LoadLog, rollbackToSegment segment.Full) error

func (*Service) SnapshotData

func (b *Service) SnapshotData(ctx context.Context, chainID string, toHeight int64) error

type Span

type Span struct {
	FromHeight int64
	ToHeight   int64
}

type TableCopySql added in v0.70.0

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

type TableMetadata

type TableMetadata struct {
	Name            string
	SortOrder       string
	Hypertable      bool
	PartitionColumn string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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