Documentation
¶
Index ¶
- func InitChunk(chunk *Range, t Type, firstBucketID, lastBucketID int, ...)
- func InitChunks(chunks []*Range, t Type, firstBucketID, lastBucketID int, index int, ...)
- type Bound
- type CID
- type Range
- func (r *Range) Clone() *Range
- func (r *Range) Copy() *Range
- func (r *Range) CopyAndUpdate(column, lower, upper string, updateLower, updateUpper bool) *Range
- func (r *Range) IsFirstChunkForBucket() bool
- func (r *Range) IsFirstChunkForTable() bool
- func (r *Range) IsLastChunkForBucket() bool
- func (r *Range) IsLastChunkForTable() bool
- func (r *Range) String() string
- func (r *Range) ToMeta() string
- func (r *Range) ToString(collation string) (string, []interface{})
- func (r *Range) Update(column, lower, upper string, updateLower, updateUpper bool)
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitChunks ¶
func InitChunks(chunks []*Range, t Type, firstBucketID, lastBucketID int, index int, collation, limits string, chunkCnt int)
InitChunks init the given chunks Notice: chunk may contain not only one bucket, which can be expressed as a range [3, 5],
And `lastBucketID` means the `5` and `firstBucketID` means the `3`.
Types ¶
type Bound ¶
type Bound struct {
Column string `json:"column"`
Lower string `json:"lower"`
Upper string `json:"upper"`
HasLower bool `json:"has-lower"`
HasUpper bool `json:"has-upper"`
}
Bound represents a bound for a column
type CID ¶
type CID struct {
TableIndex int `json:"table-index"`
// we especially treat random split has only one bucket
// which is the whole table
// range is [left, right]
BucketIndexLeft int `json:"bucket-index-left"`
BucketIndexRight int `json:"bucket-index-right"`
ChunkIndex int `json:"chunk-index"`
// `ChunkCnt` is the number of chunks in this bucket
// We can compare `ChunkIndex` and `ChunkCnt` to know
// whether this chunk is the last one
ChunkCnt int `json:"chunk-count"`
}
CID is to identify the sequence of chunks
func (*CID) FromString ¶
FromString get CID from given string
type Range ¶
type Range struct {
Index *CID `json:"index"`
Type Type `json:"type"`
Bounds []*Bound `json:"bounds"`
IsFirst bool `json:"is-first"`
IsLast bool `json:"is-last"`
Where string `json:"where"`
Args []interface{} `json:"args"`
// IndexColumnNames store column names of index splitting chunks.
// It's used to find index name and generate index hint in checksum query.
IndexColumnNames []ast.CIStr `json:"index-column-names,omitempty"`
// contains filtered or unexported fields
}
Range represents chunk range
func NewChunkRangeOffset ¶
NewChunkRangeOffset return a Range in sequence
func (*Range) CopyAndUpdate ¶
CopyAndUpdate update the range
func (*Range) IsFirstChunkForBucket ¶
IsFirstChunkForBucket return true if it's the first chunk
func (*Range) IsFirstChunkForTable ¶
IsFirstChunkForTable return true if it's the first chunk
func (*Range) IsLastChunkForBucket ¶
IsLastChunkForBucket return true if it's the last chunk
func (*Range) IsLastChunkForTable ¶
IsLastChunkForTable return true if it's the last chunk
Click to show internal directories.
Click to hide internal directories.