codec

package
v0.0.0-...-6120cfb Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKey = errors.New("invalid key")
)
View Source
var (
	Sep = []byte("_")
)

Functions

func ColumnInfoKey

func ColumnInfoKey(columnId uint64) []byte

ColumnInfoKey s_c{id}

func ColumnKey

func ColumnKey(tid uint64, columnName string) []byte

ColumnKey key: m_t{tid}_c{columnName}

func DBInfoKey

func DBInfoKey(dbId uint64) []byte

DBInfoKey s_d{id}

func DecodeBDInfo

func DecodeBDInfo(buf []byte) *model.DBInfo

func DecodeColumnInfo

func DecodeColumnInfo(buf []byte, dst *model.ColumnInfo) *model.ColumnInfo

func DecodeIndexInfo

func DecodeIndexInfo(buf []byte, dst *model.IndexInfo) *model.IndexInfo

func DecodeMatcherInfo

func DecodeMatcherInfo(buf []byte, dst *model.MatcherInfo) *model.MatcherInfo

func DecodeTableInfo

func DecodeTableInfo(buf []byte, dst *model.TableInfo) *model.TableInfo

func DecodeValue

func DecodeValue(bytes []byte, p bsontype.Type) value.Value

func EncodeCmpValue

func EncodeCmpValue(v value.Value) []byte

func EncodeColumnInfo

func EncodeColumnInfo(info *model.ColumnInfo) []byte

func EncodeDBInfo

func EncodeDBInfo(info *model.DBInfo) []byte

func EncodeIndexInfo

func EncodeIndexInfo(info *model.IndexInfo) []byte

func EncodeMatcherInfo

func EncodeMatcherInfo(info *model.MatcherInfo) []byte

func EncodeTableInfo

func EncodeTableInfo(info *model.TableInfo) []byte

func EncodeValue

func EncodeValue(v value.Value) []byte

func EncodeValues

func EncodeValues(vs value.Values) [][]byte

func IndexEntries

func IndexEntries(index *model.IndexInfo, tuple btuple.Reader, rid primitive.ObjectID, iter func(key, value []byte) error) (err error)

func IndexEntry

func IndexEntry(indexInfo *model.IndexInfo, columns []*model.ColumnInfo, tuple btuple.Reader, rid primitive.ObjectID) (key, value []byte)

func IndexEntryKey

func IndexEntryKey(indexInfo *model.IndexInfo, columns []*model.ColumnInfo, tuple btuple.Reader, rid primitive.ObjectID) []byte

func IndexInfoKey

func IndexInfoKey(matcherId uint64) []byte

IndexInfoKey s_i{id}

func IndexKey

func IndexKey(tid uint64, indexName string) []byte

IndexKey key: m_t{tid}_i{indexName}

func MatcherInfoKey

func MatcherInfoKey(matcherId uint64) []byte

MatcherInfoKey s_m{id}

func MatcherKey

func MatcherKey(did uint64, matcherName string) []byte

MatcherKey key: m_d{did}_m{matcher}

func MetaKey

func MetaKey(namespace string) []byte

MetaKey key: m_n{namespace}

func ParseTupleRecordKey

func ParseTupleRecordKey(b []byte) (primitive.ObjectID, error)

func ParseTupleRecordKeyFromPrimaryIndex

func ParseTupleRecordKeyFromPrimaryIndex(b []byte) (primitive.ObjectID, error)

func ParseTupleRecordKeyFromSecondaryIndex

func ParseTupleRecordKeyFromSecondaryIndex(b []byte) (primitive.ObjectID, error)

ParseTupleRecordKeyFromSecondaryIndex parse r_id form i{index_id}_{index_column_value}_{r_id} form

func PrimaryIndexEntryKey

func PrimaryIndexEntryKey(indexId uint64, columnValue []byte) []byte

PrimaryIndexEntryKey i{index_id}_{columns_value}}

func SecondaryIndexEntryKey

func SecondaryIndexEntryKey(indexId uint64, columnValue []byte, rId []byte) []byte

SecondaryIndexEntryKey i{index_id}_{leftmost_column_value}_{r_id}

func TableInfoKey

func TableInfoKey(tableId uint64) []byte

TableInfoKey s_t{id}

func TableKey

func TableKey(did uint64, tableName string) []byte

TableKey key: m_d{did}_t{tableName}

func TupleRecordBegin

func TupleRecordBegin(tableId uint64) []byte

TupleRecordBegin t{tableId}_r

func TupleRecordKey

func TupleRecordKey(tableId uint64, rid primitive.ObjectID) []byte

TupleRecordKey t{tableId}_r{rid}

Types

This section is empty.

Jump to

Keyboard shortcuts

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