codec

package
v0.0.0-...-5ef6752 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBytes

func DecodeBytes(b []byte) ([]byte, []byte, error)

DecodeBytes decodes a TiDB encoded byte slice.

func DecodeRegionMetaKey

func DecodeRegionMetaKey(r *metapb.Region) error

DecodeRegionMetaKey translates a region meta from encoded form to unencoded form.

func DecodeUintDesc

func DecodeUintDesc(b []byte) ([]byte, uint64, error)

DecodeUintDesc decodes value encoded by EncodeInt before. It returns the leftover un-decoded slice, decoded value if no error.

func EncodeBytes

func EncodeBytes(b []byte) []byte

EncodeBytes encodes a byte slice into TiDB's encoded form.

func EncodeInt

func EncodeInt(b []byte, v int64) []byte

EncodeInt appends the encoded value to slice b and returns the appended slice. EncodeInt guarantees that the encoded value is in ascending order for comparison.

func EncodeIntToCmpUint

func EncodeIntToCmpUint(v int64) uint64

EncodeIntToCmpUint make int v to comparable uint type

func EncodeTableIndexPrefix

func EncodeTableIndexPrefix(tableID, idxID int64) key.Key

EncodeTableIndexPrefix encodes index prefix with tableID and idxID.

func EncodeUintDesc

func EncodeUintDesc(b []byte, v uint64) []byte

EncodeUintDesc appends the encoded value to slice b and returns the appended slice. EncodeUintDesc guarantees that the encoded value is in descending order for comparison.

func GenTableIndexPrefix

func GenTableIndexPrefix(tableID int64) key.Key

GenTableIndexPrefix composes index prefix with tableID: "t[tableID]_i".

func GenTableRecordPrefix

func GenTableRecordPrefix(tableID int64) key.Key

GenTableRecordPrefix composes record prefix with tableID: "t[tableID]_r".

Types

This section is empty.

Jump to

Keyboard shortcuts

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