cockroach: github.com/cockroachdb/cockroach/pkg/ccl/storageccl Index | Files | Directories

package storageccl

import "github.com/cockroachdb/cockroach/pkg/ccl/storageccl"

Index

Package Files

export.go import.go key_rewriter.go writebatch.go

func ImportBufferConfigSizes Uses

func ImportBufferConfigSizes(st *cluster.Settings, isPKAdder bool) (int64, func() int64, int64)

ImportBufferConfigSizes determines the minimum, maximum and step size for the BulkAdder buffer used in import.

func MaxImportBatchSize Uses

func MaxImportBatchSize(st *cluster.Settings) int64

MaxImportBatchSize determines the maximum size of the payload in an AddSSTable request. It uses the ImportBatchSize setting directly unless the specified value would exceed the maximum Raft command size, in which case it returns the maximum batch size that will fit within a Raft command.

func SHA512ChecksumData Uses

func SHA512ChecksumData(data []byte) ([]byte, error)

SHA512ChecksumData returns the SHA512 checksum of data.

type KeyRewriter Uses

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

KeyRewriter rewrites old table IDs to new table IDs. It is able to descend into interleaved keys, and is able to function on partial keys for spans and splits.

func MakeKeyRewriter Uses

func MakeKeyRewriter(descs map[sqlbase.ID]*sqlbase.TableDescriptor) (*KeyRewriter, error)

MakeKeyRewriter makes a KeyRewriter from a map of descs keyed by original ID.

func MakeKeyRewriterFromRekeys Uses

func MakeKeyRewriterFromRekeys(rekeys []roachpb.ImportRequest_TableRekey) (*KeyRewriter, error)

MakeKeyRewriterFromRekeys makes a KeyRewriter from Rekey protos.

func (*KeyRewriter) RewriteKey Uses

func (kr *KeyRewriter) RewriteKey(key []byte, isFromSpan bool) ([]byte, bool, error)

RewriteKey modifies key (possibly in place), changing all table IDs to their new value, including any interleaved table children and prefix ends. This function works by inspecting the key for table and index IDs, then uses the corresponding table and index descriptors to determine if interleaved data is present and if it is, to find the next prefix of an interleaved child, then calls itself recursively until all interleaved children have been rekeyed. If it encounters a table ID for which it does not have a configured rewrite, it returns the prefix of the key that was rewritten key. The returned boolean is true if and only if all of the table IDs found in the key were rewritten. If isFromSpan is true, failures in value decoding are assumed to be due to valid span manipulations, like PrefixEnd or Next having altered the trailing byte(s) to corrupt the value encoding -- in such a case we will not be able to decode the value (to determine how much further to scan for table IDs) but we can assume that since these manipulations are only done to the trailing byte that we're likely at the end anyway and do not need to search for any further table IDs to replace.

Directories

PathSynopsis
engineccl
engineccl/enginepbccl

Package storageccl imports 29 packages (graph) and is imported by 35 packages. Updated 2019-11-18. Refresh now. Tools for package owners.