Documentation ¶
Index ¶
- func CutIndexKey(key kv.Key, colIDs []int64) (values map[int64][]byte, b []byte, err error)
- func CutRow(data []byte, cols map[int64]*types.FieldType) (map[int64][]byte, error)
- func DecodeColumnValue(data []byte, ft *types.FieldType) (types.Datum, error)
- func DecodeIndexKey(key kv.Key) ([]types.Datum, error)
- func DecodeRecordKey(key kv.Key) (tableID int64, handle int64, err error)
- func DecodeRow(b []byte, cols map[int64]*types.FieldType) (map[int64]types.Datum, error)
- func DecodeRowKey(key kv.Key) (int64, error)
- func DecodeValues(data []byte, fts []*types.FieldType, inIndex bool) ([]types.Datum, error)
- func EncodeIndexSeekKey(tableID int64, idxID int64, encodedValue []byte) kv.Key
- func EncodeRecordKey(recordPrefix kv.Key, h int64) kv.Key
- func EncodeRow(row []types.Datum, colIDs []int64) ([]byte, error)
- func EncodeRowKey(tableID int64, encodedHandle []byte) kv.Key
- func EncodeRowKeyWithHandle(tableID int64, handle int64) kv.Key
- func EncodeTableIndexPrefix(tableID, idxID int64) kv.Key
- func EncodeTablePrefix(tableID int64) kv.Key
- func EncodeValue(raw types.Datum) ([]byte, error)
- func GenTableIndexPrefix(tableID int64) kv.Key
- func GenTableRecordPrefix(tableID int64) kv.Key
- func TruncateToRowKeyLen(key kv.Key) kv.Key
- func Unflatten(datum types.Datum, ft *types.FieldType, inIndex bool) (types.Datum, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CutIndexKey ¶
CutIndexKey cuts encoded index key into colIDs to bytes slices map. The returned value b is the remaining bytes of the key which would be empty if it is unique index or handle data if it is non-unique index.
func CutRow ¶
CutRow cut encoded row into byte slices and return interested columns' byte slice. Row layout: colID1, value1, colID2, value2, .....
func DecodeColumnValue ¶
DecodeColumnValue decodes data to a Datum according to the column info.
func DecodeIndexKey ¶
DecodeIndexKey decodes datums from an index key.
func DecodeRecordKey ¶
DecodeRecordKey decodes the key and gets the tableID, handle.
func DecodeRow ¶
DecodeRow decodes a byte slice into datums. Row layout: colID1, value1, colID2, value2, .....
func DecodeRowKey ¶
DecodeRowKey decodes the key and gets the handle.
func DecodeValues ¶
DecodeValues decodes a byte slice into datums with column types.
func EncodeIndexSeekKey ¶
EncodeIndexSeekKey encodes an index value to kv.Key.
func EncodeRecordKey ¶
EncodeRecordKey encodes the recordPrefix, row handle into a kv.Key.
func EncodeRow ¶
EncodeRow encode row data and column ids into a slice of byte. Row layout: colID1, value1, colID2, value2, .....
func EncodeRowKey ¶
EncodeRowKey encodes the table id and record handle into a kv.Key
func EncodeRowKeyWithHandle ¶
EncodeRowKeyWithHandle encodes the table id, row handle into a kv.Key
func EncodeTableIndexPrefix ¶
EncodeTableIndexPrefix encodes index prefix with tableID and idxID.
func EncodeTablePrefix ¶
EncodeTablePrefix encodes table prefix with table ID.
func EncodeValue ¶
EncodeValue encodes a go value to bytes.
func GenTableIndexPrefix ¶
GenTableIndexPrefix composes index prefix with tableID: "t[tableID]_i".
func GenTableRecordPrefix ¶
GenTableRecordPrefix composes record prefix with tableID: "t[tableID]_r".
func TruncateToRowKeyLen ¶
TruncateToRowKeyLen truncates the key to row key length if the key is longer than row key.
Types ¶
This section is empty.