Documentation ¶
Index ¶
- func InitChunk(chunk *Range, t ChunkType, firstBucketID, lastBucketID int, ...)
- func InitChunks(chunks []*Range, t ChunkType, firstBucketID, lastBucketID int, index int, ...)
- type Bound
- type ChunkID
- type ChunkType
- type Range
- func (c *Range) Clone() *Range
- func (c *Range) Copy() *Range
- func (c *Range) CopyAndUpdate(column, lower, upper string, updateLower, updateUpper bool) *Range
- func (r *Range) IsFirstChunkForBucket() bool
- func (c *Range) IsFirstChunkForTable() bool
- func (r *Range) IsLastChunkForBucket() bool
- func (c *Range) IsLastChunkForTable() bool
- func (c *Range) String() string
- func (c *Range) ToMeta() string
- func (c *Range) ToString(collation string) (string, []interface{})
- func (c *Range) Update(column, lower, upper string, updateLower, updateUpper bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitChunks ¶
func InitChunks(chunks []*Range, t ChunkType, firstBucketID, lastBucketID int, index int, collation, limits string, chunkCnt int)
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 ChunkID ¶
type ChunkID 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"` }
ChunkID is to identify the sequence of chunks
func GetInitChunkID ¶
func GetInitChunkID() *ChunkID
func (*ChunkID) FromString ¶
type Range ¶
type Range struct { Index *ChunkID `json:"index"` Type ChunkType `json:"type"` Bounds []*Bound `json:"bounds"` IsFirst bool `json:"is-first"` IsLast bool `json:"is-last"` Where string `json:"where"` Args []interface{} `json:"args"` // contains filtered or unexported fields }
Range represents chunk range
func NewChunkRangeOffset ¶
NewChunkRangeOffset return a Range in sequence
func (*Range) CopyAndUpdate ¶
func (*Range) IsFirstChunkForBucket ¶
func (*Range) IsFirstChunkForTable ¶
func (*Range) IsLastChunkForBucket ¶
func (*Range) IsLastChunkForTable ¶
Click to show internal directories.
Click to hide internal directories.