tidb: github.com/pingcap/tidb/util/filesort Index | Files

package filesort

import "github.com/pingcap/tidb/util/filesort"

Index

Package Files

filesort.go

type Builder Uses

type Builder struct {
    // contains filtered or unexported fields
}

Builder builds a new FileSorter.

func (*Builder) Build Uses

func (b *Builder) Build() (*FileSorter, error)

Build creates a FileSorter instance using given data.

func (*Builder) SetBuf Uses

func (b *Builder) SetBuf(bufSize int) *Builder

SetBuf sets the number of rows FileSorter can hold in memory at a time.

func (*Builder) SetDesc Uses

func (b *Builder) SetDesc(byDesc []bool) *Builder

SetDesc sets the ordering rule of row comparison.

func (*Builder) SetDir Uses

func (b *Builder) SetDir(tmpDir string) *Builder

SetDir sets the working directory for FileSorter.

func (*Builder) SetSC Uses

func (b *Builder) SetSC(sc *stmtctx.StatementContext) *Builder

SetSC sets StatementContext instance which is required in row comparison.

func (*Builder) SetSchema Uses

func (b *Builder) SetSchema(keySize, valSize int) *Builder

SetSchema sets the schema of row, including key size and value size.

func (*Builder) SetWorkers Uses

func (b *Builder) SetWorkers(nWorkers int) *Builder

SetWorkers sets the number of workers used in async sorting.

type FileSorter Uses

type FileSorter struct {
    // contains filtered or unexported fields
}

FileSorter sorts the given rows according to the byDesc order. FileSorter can sort rows that exceed predefined memory capacity.

func (*FileSorter) Close Uses

func (fs *FileSorter) Close() error

Close terminates the input or output process and discards all remaining data.

func (*FileSorter) Input Uses

func (fs *FileSorter) Input(key []types.Datum, val []types.Datum, handle int64) error

Input adds one row into FileSorter. Caller should not call Input after calling Output.

func (*FileSorter) Output Uses

func (fs *FileSorter) Output() ([]types.Datum, []types.Datum, int64, error)

Output gets the next sorted row.

type Worker Uses

type Worker struct {
    // contains filtered or unexported fields
}

Worker sorts file asynchronously.

func (*Worker) Len Uses

func (w *Worker) Len() int

func (*Worker) Less Uses

func (w *Worker) Less(i, j int) bool

func (*Worker) Swap Uses

func (w *Worker) Swap(i, j int)

Package filesort imports 15 packages (graph). Updated 2019-08-13. Refresh now. Tools for package owners.