Documentation ¶
Index ¶
- Variables
- func KvPairsFromRows(rows Rows) []common.KvPair
- func NewPanickingAllocators(base int64) autoid.Allocators
- func NewSession(options *SessionOptions) sessionctx.Context
- type Encoder
- type KvPairs
- type Row
- type RowArrayMarshaler
- type Rows
- type SessionOptions
- type TableKVDecoder
- func (t *TableKVDecoder) DecodeHandleFromIndex(indexInfo *model.IndexInfo, key []byte, value []byte) (kv.Handle, error)
- func (t *TableKVDecoder) DecodeHandleFromTable(key []byte) (kv.Handle, error)
- func (t *TableKVDecoder) DecodeRawRowData(h kv.Handle, value []byte) ([]types.Datum, map[int64]types.Datum, error)
- func (t *TableKVDecoder) EncodeHandleKey(h kv.Handle) kv.Key
Constants ¶
This section is empty.
Variables ¶
var ExtraHandleColumnInfo = model.NewExtraHandleColInfo()
Functions ¶
func KvPairsFromRows ¶
KvPairsFromRows converts a Rows instance constructed from MakeRowsFromKvPairs back into a slice of KvPair. This method panics if the Rows is not constructed in such way. nolint:golint // kv.KvPairsFromRows sounds good.
func NewPanickingAllocators ¶
func NewPanickingAllocators(base int64) autoid.Allocators
NewPanickingAllocator creates a PanickingAllocator shared by all allocation types.
func NewSession ¶
func NewSession(options *SessionOptions) sessionctx.Context
NewSession creates a new trimmed down Session matching the options.
Types ¶
type Encoder ¶
type Encoder interface { // Close the encoder. Close() // Encode encodes a row of SQL values into a backend-friendly format. Encode( logger log.Logger, row []types.Datum, rowID int64, columnPermutation []int, offset int64, ) (Row, error) }
Encoder encodes a row of SQL values into some opaque type which can be consumed by OpenEngine.WriteEncoded.
func NewTableKVEncoder ¶
func NewTableKVEncoder(tbl table.Table, options *SessionOptions) (Encoder, error)
type KvPairs ¶
type KvPairs struct {
// contains filtered or unexported fields
}
func (*KvPairs) ClassifyAndAppend ¶
func (kvs *KvPairs) ClassifyAndAppend( data *Rows, dataChecksum *verification.KVChecksum, indices *Rows, indexChecksum *verification.KVChecksum, )
func (*KvPairs) SplitIntoChunks ¶
type Row ¶
type Row interface { // ClassifyAndAppend separates the data-like and index-like parts of the // encoded row, and appends these parts into the existing buffers and // checksums. ClassifyAndAppend( data *Rows, dataChecksum *verification.KVChecksum, indices *Rows, indexChecksum *verification.KVChecksum, ) // Size represents the total kv size of this Row. Size() uint64 }
Row represents a single encoded row.
func MakeRowFromKvPairs ¶
MakeRowFromKvPairs converts a KvPair slice into a Row instance. This is mainly used for testing only. The resulting Row instance should only be used for the importer backend.
type RowArrayMarshaler ¶
RowArrayMarshaler wraps a slice of types.Datum for logging the content into zap.
func (RowArrayMarshaler) MarshalLogArray ¶
func (row RowArrayMarshaler) MarshalLogArray(encoder zapcore.ArrayEncoder) error
MarshalLogArray implements the zapcore.ArrayMarshaler interface
type Rows ¶
type Rows interface { // SplitIntoChunks splits the rows into multiple consecutive parts, each // part having total byte size less than `splitSize`. The meaning of "byte // size" should be consistent with the value used in `Row.ClassifyAndAppend`. SplitIntoChunks(splitSize int) []Rows // Clear returns a new collection with empty content. It may share the // capacity with the current instance. The typical usage is `x = x.Clear()`. Clear() Rows }
Rows represents a collection of encoded rows.
func MakeRowsFromKvPairs ¶
MakeRowsFromKvPairs converts a KvPair slice into a Rows instance. This is mainly used for testing only. The resulting Rows instance should only be used for the importer backend.
type SessionOptions ¶
type SessionOptions struct { SQLMode mysql.SQLMode Timestamp int64 SysVars map[string]string // a seed used for tableKvEncoder's auto random bits value AutoRandomSeed int64 }
SessionOptions is the initial configuration of the session.
type TableKVDecoder ¶
type TableKVDecoder struct {
// contains filtered or unexported fields
}
func NewTableKVDecoder ¶
func NewTableKVDecoder(tbl table.Table, options *SessionOptions) (*TableKVDecoder, error)
func (*TableKVDecoder) DecodeHandleFromIndex ¶
func (*TableKVDecoder) DecodeHandleFromTable ¶
func (t *TableKVDecoder) DecodeHandleFromTable(key []byte) (kv.Handle, error)
func (*TableKVDecoder) DecodeRawRowData ¶
func (t *TableKVDecoder) DecodeRawRowData(h kv.Handle, value []byte) ([]types.Datum, map[int64]types.Datum, error)
DecodeRawRowData decodes raw row data into a datum slice and a (columnID:columnValue) map.
func (*TableKVDecoder) EncodeHandleKey ¶
func (t *TableKVDecoder) EncodeHandleKey(h kv.Handle) kv.Key