Documentation ¶
Index ¶
- Constants
- func BuildVersionDBSSTCmd(defaultStores []string) *cobra.Command
- func ChangeSetGroupCmd(opts Options) *cobra.Command
- func ChangeSetToVersionDBCmd() *cobra.Command
- func DumpChangeSetCmd(opts Options) *cobra.Command
- func GetStoresOrDefault(cmd *cobra.Command, defaultStores []string) ([]string, error)
- func IngestVersionDBSSTCmd() *cobra.Command
- func IterateChangeSets(reader Reader, fn func(version int64, changeSet *iavl.ChangeSet) (bool, error)) (int64, error)
- func IterateVersions(reader Reader, fn func(version int64) (bool, error)) (int64, error)
- func ListDefaultStoresCmd(stores []string) *cobra.Command
- func PrintChangeSetCmd() *cobra.Command
- func ReadChangeSet(reader Reader, parseChangeset bool) (int64, int64, *iavl.ChangeSet, error)
- func ReadFirstVersion(fileName string) (uint64, error)
- func RestoreAppDBCmd(opts Options) *cobra.Command
- func RestoreVersionDBCmd() *cobra.Command
- func VerifyChangeSetCmd(defaultStores []string) *cobra.Command
- func WriteChangeSet(writer io.Writer, version int64, cs iavl.ChangeSet) error
- type FileWithVersion
- type Options
- type Range
- type ReadCloser
- type Reader
Constants ¶
const ( ZlibFileSuffix = ".zz" SnappyFileSuffix = ".snappy" )
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 )
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 )
const DefaultChunkSize = 1000000
Variables ¶
This section is empty.
Functions ¶
func BuildVersionDBSSTCmd ¶
func ChangeSetGroupCmd ¶
func ChangeSetToVersionDBCmd ¶
func DumpChangeSetCmd ¶
func GetStoresOrDefault ¶
func IngestVersionDBSSTCmd ¶
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 ¶
IterateVersions iterate the version numbers in change set files, skipping the change set payloads.
func ListDefaultStoresCmd ¶
func PrintChangeSetCmd ¶
func ReadChangeSet ¶
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 ¶
ReadFirstVersion parse the first version number in the change set file
func RestoreAppDBCmd ¶
func RestoreVersionDBCmd ¶
RestoreVersionDBCmd returns a command to restore a versiondb from local snapshot
func VerifyChangeSetCmd ¶
func WriteChangeSet ¶
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 ¶
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 ReadCloser ¶
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.