instruction

package
v0.0.0-...-e8181bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Ascending  = Order(1)
	Descending = Order(-1)
	NoOrder    = Order(0)
)

Variables

View Source
var (
	InstructionRunner = &instructionRunner{}
)

Functions

func DoBroadcast

func DoBroadcast(reader io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func DoCoGroupPartitionedSorted

func DoCoGroupPartitionedSorted(leftRawChan, rightRawChan io.Reader, writer io.Writer, indexes []int, stats *pb.InstructionStat) error

func DoCollectPartitions

func DoCollectPartitions(readers []io.Reader, writer io.Writer, stats *pb.InstructionStat) (err error)

func DoJoinPartitionedSorted

func DoJoinPartitionedSorted(leftRawChan, rightRawChan io.Reader, writer io.Writer, indexes []int,
	isLeftOuterJoin, isRightOuterJoin bool, stats *pb.InstructionStat) error

func DoLocalDistinct

func DoLocalDistinct(reader io.Reader, writer io.Writer, orderBys []OrderBy, stats *pb.InstructionStat) error

func DoLocalGroupBySorted

func DoLocalGroupBySorted(reader io.Reader, writer io.Writer,
	indexes []int, stats *pb.InstructionStat) error

func DoLocalHashAndJoinWith

func DoLocalHashAndJoinWith(leftReader, rightReader io.Reader, writer io.Writer, indexes []int, stats *pb.InstructionStat) error

func DoLocalLimit

func DoLocalLimit(reader io.Reader, writer io.Writer, n int, offset int, stats *pb.InstructionStat) error

DoLocalLimit streamingly get the n items starting from offset

func DoLocalSort

func DoLocalSort(reader io.Reader, writer io.Writer, orderBys []OrderBy, stats *pb.InstructionStat) error

func DoLocalTop

func DoLocalTop(reader io.Reader, writer io.Writer, n int, orderBys []OrderBy, stats *pb.InstructionStat) error

DoLocalTop streamingly compare and get the top n items

func DoMergeSortedTo

func DoMergeSortedTo(readers []io.Reader, writer io.Writer, orderBys []OrderBy, stats *pb.InstructionStat) error

func DoMergeTo

func DoMergeTo(readers []io.Reader, writer io.Writer, stats *pb.InstructionStat) error

func DoPipeAsArgs

func DoPipeAsArgs(reader io.Reader, writer io.Writer, code string, stats *pb.InstructionStat) error

func DoRoundRobin

func DoRoundRobin(reader []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func DoScatterPartitions

func DoScatterPartitions(reader io.Reader, writers []io.Writer, indexes []int, stats *pb.InstructionStat) error

func DoSelect

func DoSelect(reader io.Reader, writer io.Writer, keyIndexes, valueIndexes []int, stats *pb.InstructionStat) error

DoSelect projects the fields

func DoUnion

func DoUnion(readers []io.Reader, writer io.Writer, isParallel bool,
	stats *pb.InstructionStat) error

Types

type Broadcast

type Broadcast struct {
}

func NewBroadcast

func NewBroadcast() *Broadcast

func (*Broadcast) Function

func (b *Broadcast) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*Broadcast) GetMemoryCostInMB

func (b *Broadcast) GetMemoryCostInMB(partitionSize int64) int64

func (*Broadcast) Name

func (b *Broadcast) Name(prefix string) string

func (*Broadcast) SerializeToCommand

func (b *Broadcast) SerializeToCommand() *pb.Instruction

type CoGroupPartitionedSorted

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

func NewCoGroupPartitionedSorted

func NewCoGroupPartitionedSorted(indexes []int) *CoGroupPartitionedSorted

func (*CoGroupPartitionedSorted) Function

func (b *CoGroupPartitionedSorted) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*CoGroupPartitionedSorted) GetMemoryCostInMB

func (b *CoGroupPartitionedSorted) GetMemoryCostInMB(partitionSize int64) int64

func (*CoGroupPartitionedSorted) Name

func (b *CoGroupPartitionedSorted) Name(prefix string) string

func (*CoGroupPartitionedSorted) SerializeToCommand

func (b *CoGroupPartitionedSorted) SerializeToCommand() *pb.Instruction

type CollectPartitions

type CollectPartitions struct {
}

func NewCollectPartitions

func NewCollectPartitions() *CollectPartitions

func (*CollectPartitions) Function

func (b *CollectPartitions) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*CollectPartitions) GetMemoryCostInMB

func (b *CollectPartitions) GetMemoryCostInMB(partitionSize int64) int64

func (*CollectPartitions) Name

func (b *CollectPartitions) Name(prefix string) string

func (*CollectPartitions) SerializeToCommand

func (b *CollectPartitions) SerializeToCommand() *pb.Instruction

type Instruction

type Instruction interface {
	Name(string) string
	Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error
	SerializeToCommand() *pb.Instruction
	GetMemoryCostInMB(partitionSize int64) int64
}

type JoinPartitionedSorted

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

func NewJoinPartitionedSorted

func NewJoinPartitionedSorted(isLeftOuterJoin bool, isRightOuterJoin bool, indexes []int) *JoinPartitionedSorted

func (*JoinPartitionedSorted) Function

func (b *JoinPartitionedSorted) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*JoinPartitionedSorted) GetMemoryCostInMB

func (b *JoinPartitionedSorted) GetMemoryCostInMB(partitionSize int64) int64

func (*JoinPartitionedSorted) Name

func (b *JoinPartitionedSorted) Name(prefix string) string

func (*JoinPartitionedSorted) SerializeToCommand

func (b *JoinPartitionedSorted) SerializeToCommand() *pb.Instruction

type LocalDistinct

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

func NewLocalDistinct

func NewLocalDistinct(orderBys []OrderBy) *LocalDistinct

func (*LocalDistinct) Function

func (b *LocalDistinct) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*LocalDistinct) GetMemoryCostInMB

func (b *LocalDistinct) GetMemoryCostInMB(partitionSize int64) int64

func (*LocalDistinct) Name

func (b *LocalDistinct) Name(prefix string) string

func (*LocalDistinct) SerializeToCommand

func (b *LocalDistinct) SerializeToCommand() *pb.Instruction

type LocalGroupBySorted

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

func NewLocalGroupBySorted

func NewLocalGroupBySorted(indexes []int) *LocalGroupBySorted

func (*LocalGroupBySorted) Function

func (b *LocalGroupBySorted) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*LocalGroupBySorted) GetMemoryCostInMB

func (b *LocalGroupBySorted) GetMemoryCostInMB(partitionSize int64) int64

func (*LocalGroupBySorted) Name

func (b *LocalGroupBySorted) Name(prefix string) string

func (*LocalGroupBySorted) SerializeToCommand

func (b *LocalGroupBySorted) SerializeToCommand() *pb.Instruction

type LocalHashAndJoinWith

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

func NewLocalHashAndJoinWith

func NewLocalHashAndJoinWith(indexes []int) *LocalHashAndJoinWith

func (*LocalHashAndJoinWith) Function

func (b *LocalHashAndJoinWith) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*LocalHashAndJoinWith) GetMemoryCostInMB

func (b *LocalHashAndJoinWith) GetMemoryCostInMB(partitionSize int64) int64

func (*LocalHashAndJoinWith) Name

func (b *LocalHashAndJoinWith) Name(prefix string) string

func (*LocalHashAndJoinWith) SerializeToCommand

func (b *LocalHashAndJoinWith) SerializeToCommand() *pb.Instruction

type LocalLimit

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

func NewLocalLimit

func NewLocalLimit(n int, offset int) *LocalLimit

func (*LocalLimit) Function

func (b *LocalLimit) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*LocalLimit) GetMemoryCostInMB

func (b *LocalLimit) GetMemoryCostInMB(partitionSize int64) int64

func (*LocalLimit) Name

func (b *LocalLimit) Name(prefix string) string

func (*LocalLimit) SerializeToCommand

func (b *LocalLimit) SerializeToCommand() *pb.Instruction

type LocalSort

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

func NewLocalSort

func NewLocalSort(orderBys []OrderBy, memoryInMB int) *LocalSort

func (*LocalSort) Function

func (b *LocalSort) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*LocalSort) GetMemoryCostInMB

func (b *LocalSort) GetMemoryCostInMB(partitionSize int64) int64

func (*LocalSort) Name

func (b *LocalSort) Name(prefix string) string

func (*LocalSort) SerializeToCommand

func (b *LocalSort) SerializeToCommand() *pb.Instruction

type LocalTop

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

func NewLocalTop

func NewLocalTop(n int, orderBys []OrderBy) *LocalTop

func (*LocalTop) Function

func (b *LocalTop) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*LocalTop) GetMemoryCostInMB

func (b *LocalTop) GetMemoryCostInMB(partitionSize int64) int64

func (*LocalTop) Name

func (b *LocalTop) Name(prefix string) string

func (*LocalTop) SerializeToCommand

func (b *LocalTop) SerializeToCommand() *pb.Instruction

type MergeSortedTo

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

func NewMergeSortedTo

func NewMergeSortedTo(orderBys []OrderBy) *MergeSortedTo

func (*MergeSortedTo) Function

func (b *MergeSortedTo) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*MergeSortedTo) GetMemoryCostInMB

func (b *MergeSortedTo) GetMemoryCostInMB(partitionSize int64) int64

func (*MergeSortedTo) Name

func (b *MergeSortedTo) Name(prefix string) string

func (*MergeSortedTo) SerializeToCommand

func (b *MergeSortedTo) SerializeToCommand() *pb.Instruction

type MergeTo

type MergeTo struct{}

func NewMergeTo

func NewMergeTo() *MergeTo

func (*MergeTo) Function

func (b *MergeTo) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*MergeTo) GetMemoryCostInMB

func (b *MergeTo) GetMemoryCostInMB(partitionSize int64) int64

func (*MergeTo) Name

func (b *MergeTo) Name(prefix string) string

func (*MergeTo) SerializeToCommand

func (b *MergeTo) SerializeToCommand() *pb.Instruction

type Order

type Order int

type OrderBy

type OrderBy struct {
	Index int   // column index, starting from 1
	Order Order // Ascending or Descending
}

type PipeAsArgs

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

func NewPipeAsArgs

func NewPipeAsArgs(code string) *PipeAsArgs

func (*PipeAsArgs) Function

func (b *PipeAsArgs) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*PipeAsArgs) GetMemoryCostInMB

func (b *PipeAsArgs) GetMemoryCostInMB(partitionSize int64) int64

func (*PipeAsArgs) Name

func (b *PipeAsArgs) Name(prefix string) string

func (*PipeAsArgs) SerializeToCommand

func (b *PipeAsArgs) SerializeToCommand() *pb.Instruction

type RoundRobin

type RoundRobin struct {
}

func NewRoundRobin

func NewRoundRobin() *RoundRobin

func (*RoundRobin) Function

func (b *RoundRobin) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*RoundRobin) GetMemoryCostInMB

func (b *RoundRobin) GetMemoryCostInMB(partitionSize int64) int64

func (*RoundRobin) Name

func (b *RoundRobin) Name(prefix string) string

func (*RoundRobin) SerializeToCommand

func (b *RoundRobin) SerializeToCommand() *pb.Instruction

type ScatterPartitions

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

func NewScatterPartitions

func NewScatterPartitions(indexes []int) *ScatterPartitions

func (*ScatterPartitions) Function

func (b *ScatterPartitions) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*ScatterPartitions) GetMemoryCostInMB

func (b *ScatterPartitions) GetMemoryCostInMB(partitionSize int64) int64

func (*ScatterPartitions) Name

func (b *ScatterPartitions) Name(prefix string) string

func (*ScatterPartitions) SerializeToCommand

func (b *ScatterPartitions) SerializeToCommand() *pb.Instruction

type Select

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

func NewSelect

func NewSelect(keyIndexes, valueIndexes []int) *Select

func (*Select) Function

func (b *Select) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*Select) GetMemoryCostInMB

func (b *Select) GetMemoryCostInMB(partitionSize int64) int64

func (*Select) Name

func (b *Select) Name(prefix string) string

func (*Select) SerializeToCommand

func (b *Select) SerializeToCommand() *pb.Instruction

type Union

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

func NewUnion

func NewUnion(isParallel bool) *Union

func (*Union) Function

func (b *Union) Function() func(readers []io.Reader, writers []io.Writer, stats *pb.InstructionStat) error

func (*Union) GetMemoryCostInMB

func (b *Union) GetMemoryCostInMB(partitionSize int64) int64

func (*Union) Name

func (b *Union) Name(prefix string) string

func (*Union) SerializeToCommand

func (b *Union) SerializeToCommand() *pb.Instruction

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL