Documentation ¶
Index ¶
- func TableHasAutoRowID(info *model.TableInfo) bool
- type Checksum
- func (c *Checksum) Add(other *Checksum)
- func (c Checksum) MarshalJSON() ([]byte, error)
- func (c *Checksum) MarshalLogObject(encoder zapcore.ObjectEncoder) error
- func (c *Checksum) Sum() uint64
- func (c *Checksum) SumKVS() uint64
- func (c *Checksum) SumSize() uint64
- func (c *Checksum) Update(kvs []Pair)
- func (c *Checksum) UpdateOne(kv Pair)
- type Encoder
- type Pair
- type Pairs
- type Row
- type SessionOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TableHasAutoRowID ¶
TableHasAutoRowID return whether table has auto generated row id.
Types ¶
type Checksum ¶
type Checksum struct {
// contains filtered or unexported fields
}
Checksum represents the field needs checksum.
func MakeKVChecksum ¶
MakeKVChecksum creates Checksum.
func (Checksum) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Checksum) MarshalLogObject ¶
func (c *Checksum) MarshalLogObject(encoder zapcore.ObjectEncoder) error
MarshalLogObject implements the zapcore.ObjectMarshaler interface.
type Encoder ¶
type Encoder interface { // Close the encoder. Close() // AddRecord encode encodes a row of SQL values into a backend-friendly format. AddRecord( row []types.Datum, rowID int64, columnPermutation []int, ) (Row, int, error) // RemoveRecord encode encodes a row of SQL delete values into a backend-friendly format. RemoveRecord( row []types.Datum, rowID int64, columnPermutation []int, ) (Row, int, 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
NewTableKVEncoder creates the Encoder.
type Pair ¶
type Pair struct { // Key is the key of the KV pair Key []byte // Val is the value of the KV pair Val []byte // IsDelete represents whether we should remove this KV pair. IsDelete bool }
Pair is a pair of key and value.
type Pairs ¶
type Pairs []Pair
Pairs represents the slice of Pair.
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 *Pairs, dataChecksum *Checksum, indices *Pairs, indexChecksum *Checksum, ) }
Row represents a single encoded row.
Click to show internal directories.
Click to hide internal directories.