Documentation ¶
Index ¶
- func NextKey(key []byte) []byte
- 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 Iter
- type IterProducer
- type Pair
- type Pairs
- type Row
- type SessionOptions
- type SimpleKVIter
- func (s *SimpleKVIter) Close() error
- func (s *SimpleKVIter) Error() error
- func (s *SimpleKVIter) First() bool
- func (s *SimpleKVIter) Key() []byte
- func (s *SimpleKVIter) Last() bool
- func (s *SimpleKVIter) Next() bool
- func (s *SimpleKVIter) Seek(key []byte) bool
- func (s *SimpleKVIter) Valid() bool
- func (s *SimpleKVIter) Value() []byte
- type SimpleKVIterProducer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NextKey ¶
NextKey return the smallest []byte that is bigger than current bytes. special case when key is empty, empty bytes means infinity in our context, so directly return itself.
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 Iter ¶
type Iter interface { // Seek seek to specify position. // if key not found, seeks next key position in iter. Seek(key []byte) bool // Error return current error on this iter. Error() error // First moves this iter to the first key. First() bool // Last moves this iter to the last key. Last() bool // Valid check this iter reach the end. Valid() bool // Next moves this iter forward. Next() bool // Key represents current position pair's key. Key() []byte // Value represents current position pair's Value. Value() []byte // Close close this iter. Close() error }
Iter abstract iterator method for Ingester.
type IterProducer ¶
type IterProducer interface { // Produce produces iterator with given range [start, end). Produce(start []byte, end []byte) Iter }
IterProducer produces iterator with given range.
func NewSimpleKVIterProducer ¶
func NewSimpleKVIterProducer(pairs Pairs) IterProducer
NewSimpleKVIterProducer creates SimpleKVIterProducer.
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.
type SessionOptions ¶
SessionOptions is the initial configuration of the session.
type SimpleKVIter ¶
type SimpleKVIter struct {
// contains filtered or unexported fields
}
SimpleKVIter represents simple pair iterator. which is used for log restore.
type SimpleKVIterProducer ¶
type SimpleKVIterProducer struct {
// contains filtered or unexported fields
}
SimpleKVIterProducer represents kv iter producer.