Documentation
¶
Index ¶
- func GetAllTableNames(ctx context.Context, conn *pgxpool.Pool) ([]string, error)
- func GetCurrentStateSnapshots(dir string) (string, map[int64]CurrentState, error)
- func GetFromHeight(toHeight int64, snapshotInterval int64) int64
- func GetHistoryMd5Hash(snapshot CreateSnapshotResult) (string, error)
- func GetSnapshotMd5Hash(currentStateSnapshotFile string, historySnapshotFile string) (string, error)
- func InProgressFileName(chainID string, height int64) string
- type BlockCommitHandler
- type Config
- type Conn
- type CreateSnapshotResult
- type CurrentState
- type DatabaseMetadata
- type History
- type IndexInfo
- type Service
- func (b *Service) CreateSnapshot(ctx context.Context, chainID string, fromHeight int64, toHeight int64) (CreateSnapshotResult, error)
- func (b *Service) LoadAllSnapshotData(ctx context.Context, currentStateSnapshot CurrentState, ...) (int64, error)
- func (b *Service) SnapshotData(ctx context.Context, chainID string, toHeight int64, fromHeight int64) error
- type TableMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllTableNames ¶
func GetCurrentStateSnapshots ¶
func GetCurrentStateSnapshots(dir string) (string, map[int64]CurrentState, error)
func GetFromHeight ¶
func GetHistoryMd5Hash ¶
func GetHistoryMd5Hash(snapshot CreateSnapshotResult) (string, error)
func GetSnapshotMd5Hash ¶
func InProgressFileName ¶
Types ¶
type BlockCommitHandler ¶
type BlockCommitHandler struct {
// contains filtered or unexported fields
}
func NewBlockCommitHandler ¶
func (*BlockCommitHandler) OnBlockCommitted ¶
func (b *BlockCommitHandler) OnBlockCommitted(ctx context.Context, chainID string, blockHeight int64)
type Config ¶
type Config struct { PanicOnSnapshotCreationError encoding.Bool `long:"panic-on-snapshot-creation-error" description:""` DatabaseSnapshotsCopyToPath string `long:"database-snapshot-copy-to-path" description:"the snapshots copy to path relative to the database working directory"` DatabaseSnapshotsCopyFromPath string `long:"database-snapshot-copy-from-path" description:"the snapshots copy from path relative to the database working directory"` 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 CreateSnapshotResult ¶
type CreateSnapshotResult struct { CurrentStateSnapshot CurrentState HistorySnapshot History CurrentStateSnapshotPath string HistorySnapshotPath string DatabaseVersion int64 }
type CurrentState ¶
func NewCurrentSnapshot ¶
func NewCurrentSnapshot(chainID string, height int64) CurrentState
func (CurrentState) CompressedFileName ¶
func (s CurrentState) CompressedFileName() string
func (CurrentState) GetCopySQL ¶
func (s CurrentState) GetCopySQL(dbMetaData DatabaseMetadata, databaseSnapshotsPath string) []string
func (CurrentState) String ¶
func (s CurrentState) String() string
func (CurrentState) UncompressedDataDir ¶
func (s CurrentState) UncompressedDataDir() string
type DatabaseMetadata ¶
type DatabaseMetadata struct { TableNameToMetaData map[string]TableMetadata DatabaseVersion int64 }
func NewDatabaseMetaData ¶
func NewDatabaseMetaData(ctx context.Context, connConfig sqlstore.ConnectionConfig) (DatabaseMetadata, error)
func (DatabaseMetadata) GetHistoryTableNames ¶
func (d DatabaseMetadata) GetHistoryTableNames() []string
type History ¶
func NewHistorySnapshot ¶
func (History) CompressedFileName ¶
func (History) GetCopySQL ¶
func (h History) GetCopySQL(dbMetaData DatabaseMetadata, databaseSnapshotsPath string) []string
func (History) UncompressedDataDir ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewSnapshotService ¶
func (*Service) CreateSnapshot ¶
func (*Service) LoadAllSnapshotData ¶
type TableMetadata ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.