fs1tools

package
v1.8.2-0...-f7776fc Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: GPL-2.0, GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package fs1tools provides tools for managing and maintaining ZODB FileStorage v1 databases.

Index

Constants

This section is empty.

Variables

View Source
var Prog = prog.MainProg{
	Name:       "fs1",
	Summary:    "Fs1 is a tool for managing and maintaining ZODB FileStorage v1 databases",
	Commands:   commands,
	HelpTopics: helpTopics,
}

main fs1 driver

Functions

func Dump

func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error)

Dump dumps content of a FileStorage file @ path.

To do so it reads file header and then iterates over all transactions in the file. The logic to actually output information and, if needed read/process data, should be implemented by Dumper d.

func Reindex

func Reindex(ctx context.Context, path string, progress func(*fs1.IndexUpdateProgress)) error

Reindex rebuilds index for FileStorage file @ path

func Verify

func Verify(w io.Writer, path string, verbose int, progress bool) (err error)

Verify verifies content of a FileStorage file @ path.

Only data part of the database is verified (the *.fs file). Use VerifyIndexFor to verify the index part (*.fs.index).

func VerifyIndexFor

func VerifyIndexFor(ctx context.Context, path string, ntxn int, progress func(*fs1.IndexVerifyProgress)) (err error)

VerifyIndexFor verifies that on-disk index for FileStorage file @ path is correct

Types

type Dumper

type Dumper interface {
	// DumperName defines concise name to use in error-reporting when using this dumper.
	DumperName() string

	// DumpFileHeader dumps fh to buf
	DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error

	// DumpTxn dumps current transaction from it to buf.
	//
	// It is dumper responsibility to iterate over data records inside
	// transaction if it needs to dump information about data records.
	//
	// If dumper return io.EOF the whole dumping process finishes.
	DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error

	// DumpEndOK is called at the end of successfull dump.
	DumpEndOK(buf *xfmt.Buffer) error
}

Dumper is interface to implement various dumping modes

type DumperFsDump

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

DumperFsDump implements dumping with the same format as in fsdump/py originally written by Jeremy Hylton:

https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/FileStorage/fsdump.py
https://github.com/zopefoundation/ZODB/commit/ddcb46a2

func (*DumperFsDump) DumpEndOK

func (d *DumperFsDump) DumpEndOK(buf *xfmt.Buffer) error

func (*DumperFsDump) DumpFileHeader

func (d *DumperFsDump) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error

func (*DumperFsDump) DumpTxn

func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error

func (*DumperFsDump) DumperName

func (d *DumperFsDump) DumperName() string

type DumperFsDumpVerbose

type DumperFsDumpVerbose struct {
}

DumperFsDumpVerbose implements a very verbose dumper with output identical to fsdump.Dumper in zodb/py originally written by Jeremy Hylton:

https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/FileStorage/fsdump.py
https://github.com/zopefoundation/ZODB/commit/4d86e4e0

func (*DumperFsDumpVerbose) DumpEndOK

func (d *DumperFsDumpVerbose) DumpEndOK(buf *xfmt.Buffer) error

func (*DumperFsDumpVerbose) DumpFileHeader

func (d *DumperFsDumpVerbose) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error

func (*DumperFsDumpVerbose) DumpTxn

func (d *DumperFsDumpVerbose) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error

func (*DumperFsDumpVerbose) DumperName

func (d *DumperFsDumpVerbose) DumperName() string

type DumperFsTail

type DumperFsTail struct {
	Ntxn int // max # of transactions to dump
	// contains filtered or unexported fields
}

DumperFsTail implements dumping with the same format as in fstail/py originally written by Jeremy Hylton:

https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/scripts/fstail.py
https://github.com/zopefoundation/ZODB/commit/551122cc

func (*DumperFsTail) DumpEndOK

func (d *DumperFsTail) DumpEndOK(buf *xfmt.Buffer) error

func (*DumperFsTail) DumpFileHeader

func (d *DumperFsTail) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error

func (*DumperFsTail) DumpTxn

func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error

func (*DumperFsTail) DumperName

func (d *DumperFsTail) DumperName() string

type Verifier

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

Verifier implements Dumper that is used by Verify.

func (*Verifier) DumpEndOK

func (v *Verifier) DumpEndOK(buf *xfmt.Buffer) error

func (*Verifier) DumpFileHeader

func (v *Verifier) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error

func (*Verifier) DumpTxn

func (v *Verifier) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error

func (*Verifier) DumperName

func (v *Verifier) DumperName() string

Jump to

Keyboard shortcuts

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