spool

package
v1.23.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package spool implements a WAL pooler keeping track of which WALs we have archived

Index

Constants

This section is empty.

Variables

View Source
var ErrorNonExistentFile = fs.ErrNotExist

ErrorNonExistentFile is returned when the spool tried to work on a file which doesn't exist

Functions

This section is empty.

Types

type WALSpool

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

WALSpool is a way to keep track of which WAL files were processes from the parallel feature and not by PostgreSQL request. It works using a directory, under which we create an empty file carrying the name of the WAL we archived

func New

func New(spoolDirectory string) (*WALSpool, error)

New create new WAL spool

func (*WALSpool) Contains

func (spool *WALSpool) Contains(walFile string) (bool, error)

Contains checks if a certain file is in the spool or not

func (*WALSpool) FileName

func (spool *WALSpool) FileName(walName string) string

FileName gets the name of the file for the given WAL inside the spool

func (*WALSpool) MoveOut

func (spool *WALSpool) MoveOut(walName, destination string) (err error)

MoveOut moves out a file from the spool to the destination file

func (*WALSpool) Remove

func (spool *WALSpool) Remove(walFile string) error

Remove removes a WAL file from the spool. If the WAL file doesn't exist an error is returned

func (*WALSpool) Touch

func (spool *WALSpool) Touch(walFile string) (err error)

Touch ensure that a certain WAL file is included into the spool as an empty file

Jump to

Keyboard shortcuts

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