tools

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMergedBlocks

func CheckMergedBlocks(
	ctx context.Context,
	logger *zap.Logger,
	storeURL string,
	fileBlockSize uint32,
	blockRange BlockRange,
	blockPrinter func(block *bstream.Block),
	printDetails PrintDetails,
) error

func FlagMergedBlocks

func FlagMergedBlocks(
	ctx context.Context,
	logger *zap.Logger,
	sourceStoreURL string,
	destStoreURL string,
	fileBlockSize uint32,
	blockRange BlockRange,
) error

FlagMergedBlocks will write a list of base-block-numbers to a store, for merged-blocks-files that are broken or missing broken merged-blocks-files are the ones that contain "empty" blocks (no ID) or unlinkable blocks there could be false positives on unlinkable blocks, though output files are like this: 0000123100.broken 0000123500.missing

func PrettyBlockNum

func PrettyBlockNum(b uint64) string

func RoundToBundleEndBlock

func RoundToBundleEndBlock(block, fileBlockSize uint32) uint32

func RoundToBundleStartBlock

func RoundToBundleStartBlock(block, fileBlockSize uint32) uint32

func WalkBlockPrefix

func WalkBlockPrefix(blockRange BlockRange, fileBlockSize uint32) string

Types

type BlockNum

type BlockNum int64
var HeadBlockNum BlockNum = -1

func (BlockNum) String

func (b BlockNum) String() string

type BlockRange

type BlockRange struct {
	Start int64
	Stop  *uint64
}

BlockRange is actually an UnresolvedBlockRange so both the start and end could be negative values.

This is in opposition to `bstream.Range` which is a resolved range meaning that start/stop values will never be negative.

func GetBlockRangeFromArg added in v0.1.0

func GetBlockRangeFromArg(in string) (out BlockRange, err error)

func GetBlockRangeFromFlag added in v0.1.0

func GetBlockRangeFromFlag(cmd *cobra.Command, flagName string) (out BlockRange, err error)

func NewClosedRange added in v0.1.0

func NewClosedRange(start int64, stop uint64) BlockRange

func NewOpenRange added in v0.1.0

func NewOpenRange(start int64) BlockRange

func (BlockRange) GetStopBlock added in v0.1.0

func (b BlockRange) GetStopBlock() int64

func (BlockRange) GetStopBlockOr added in v0.1.0

func (b BlockRange) GetStopBlockOr(defaultIfOpenRange uint64) uint64

func (BlockRange) IsClosed added in v0.1.0

func (b BlockRange) IsClosed() bool

func (BlockRange) IsOpen added in v0.1.0

func (b BlockRange) IsOpen() bool

func (BlockRange) IsResolved added in v0.1.0

func (b BlockRange) IsResolved() bool

IsResolved returns true if the range is both closed and fully resolved (e.g. both start and stop are positive values). Returns false otherwise.

func (BlockRange) ReprocRange

func (b BlockRange) ReprocRange() string

func (BlockRange) String

func (b BlockRange) String() string

type FilteringFilters

type FilteringFilters struct {
	Include string
	Exclude string
	System  string
}

func (*FilteringFilters) Key

func (f *FilteringFilters) Key() string

type PrintDetails

type PrintDetails uint8
const (
	PrintNothing PrintDetails = iota
	PrintStats
	PrintFull
	MaxUint64 = ^uint64(0)
)

Jump to

Keyboard shortcuts

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