client

package
v0.0.0-...-547a3fa Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZlibFileSuffix   = ".zz"
	SnappyFileSuffix = ".snappy"
)
View Source
const (
	SSTFileExtension       = ".sst"
	DefaultSSTFileSize     = 128 * 1024 * 1024
	DefaultSorterChunkSize = 256 * 1024 * 1024

	// SizeKeyLength is the number of bytes used to encode key length in sort payload
	SizeKeyLength = 4
)
View Source
const (

	// We creates the temporary sst files in the target database to make sure the file renaming is cheap in ingestion
	// part.
	StoreSSTFileName = "tmp-%s-%d.sst"

	PipelineBufferSize         = 1024
	DefaultSorterChunkSizeIAVL = 64 * 1024 * 1024
)
View Source
const DefaultChunkSize = 1000000

Variables

This section is empty.

Functions

func BuildVersionDBSSTCmd

func BuildVersionDBSSTCmd(defaultStores []string) *cobra.Command

func ChangeSetGroupCmd

func ChangeSetGroupCmd(opts Options) *cobra.Command

func ChangeSetToVersionDBCmd

func ChangeSetToVersionDBCmd() *cobra.Command

func DumpChangeSetCmd

func DumpChangeSetCmd(opts Options) *cobra.Command

func GetStoresOrDefault

func GetStoresOrDefault(cmd *cobra.Command, defaultStores []string) ([]string, error)

func IngestVersionDBSSTCmd

func IngestVersionDBSSTCmd() *cobra.Command

func IterateChangeSets

func IterateChangeSets(
	reader Reader,
	fn func(version int64, changeSet *iavl.ChangeSet) (bool, error),
) (int64, error)

IterateChangeSets iterate the change set files,

func IterateVersions

func IterateVersions(
	reader Reader,
	fn func(version int64) (bool, error),
) (int64, error)

IterateVersions iterate the version numbers in change set files, skipping the change set payloads.

func ListDefaultStoresCmd

func ListDefaultStoresCmd(stores []string) *cobra.Command

func PrintChangeSetCmd

func PrintChangeSetCmd() *cobra.Command

func ReadChangeSet

func ReadChangeSet(reader Reader, parseChangeset bool) (int64, int64, *iavl.ChangeSet, error)

ReadChangeSet decode a version of change set from reader. if parseChangeset is false, it'll skip change set payload directly.

returns (version, number of bytes read, changeSet, err)

func ReadFirstVersion

func ReadFirstVersion(fileName string) (uint64, error)

ReadFirstVersion parse the first version number in the change set file

func RestoreAppDBCmd

func RestoreAppDBCmd(opts Options) *cobra.Command

func RestoreVersionDBCmd

func RestoreVersionDBCmd() *cobra.Command

RestoreVersionDBCmd returns a command to restore a versiondb from local snapshot

func VerifyChangeSetCmd

func VerifyChangeSetCmd(defaultStores []string) *cobra.Command

func WriteChangeSet

func WriteChangeSet(writer io.Writer, version int64, cs iavl.ChangeSet) error

WriteChangeSet writes a version of change sets to writer.

Change set file format: ``` version: int64 size: int64 // size of whole payload payload:

delete: int8
keyLen: varint-uint64
key
[ // if delete is false
  valueLen: varint-uint64
  value
]
repeat with next key-value pair

repeat with next version ```

Types

type FileWithVersion

type FileWithVersion struct {
	FileName string
	Version  uint64
}

func SortFilesByFirstVerson

func SortFilesByFirstVerson(files []string) ([]FileWithVersion, error)

SortFilesByFirstVerson parse the first version of the change set files and associate with the file name, then sort them by version number, also filter out empty files.

type Options

type Options struct {
	DefaultStores     []string
	OpenReadOnlyDB    func(home string, backend dbm.BackendType) (dbm.DB, error)
	AppRocksDBOptions func(sstFileWriter bool) *grocksdb.Options
}

Options defines the customizable settings of ChangeSetGroupCmd

type Range

type Range struct {
	Start, End int64
}

type ReadCloser

type ReadCloser interface {
	Reader
	io.Closer
}

ReadCloser combines `Reader` and `io.Closer`.

func WrapReader

func WrapReader(reader Reader, closer io.Closer) ReadCloser

WrapReader wraps reader and closer together to create a new io.ReadCloser.

The Read function will simply call the wrapped reader's Read function, while the Close function will call the wrapped closer's Close function.

If the wrapped reader is also an io.Closer, its Close function will be called in Close as well.

closer can be `nil`, to support stdin.

type Reader

type Reader interface {
	io.Reader
	io.ByteReader
}

Reader combines `io.Reader` and `io.ByteReader`.

Jump to

Keyboard shortcuts

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