shuffle

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shuffle

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

Shuffle shuffles messages among ISB

func NewShuffle

func NewShuffle(vertexName string, partitionCount int) *Shuffle

NewShuffle accepts list of buffer identifiers(unique identifier of isb) and returns new shuffle instance. It uses vertex-name as seed, without a seed, we will end with the problem where Shuffling before the Vnth vertex creates a key to edge-buffer-index affinity, which will not change from Vn to Vn+1 vertices if there is no re-keying between these vertices causing idle partitions.

func (*Shuffle) ShuffleMessages

func (s *Shuffle) ShuffleMessages(messages []*isb.Message) map[int32][]*isb.Message

ShuffleMessages accepts list of isb messages and returns the mapping of isb to messages

func (*Shuffle) ShuffleOnId added in v1.2.0

func (s *Shuffle) ShuffleOnId(msgId string) int32

ShuffleOnId shuffle based on the message-id. This is used to make sure we always have consistent hashing for a given message-id. This is used for non-reduce vertex.

func (*Shuffle) ShuffleOnKeys added in v1.2.0

func (s *Shuffle) ShuffleOnKeys(keys []string) int32

ShuffleOnKeys accepts array of keys and returns a shuffled identifier. We do not need message-id here because there is no multi-partitioning in Reduce streams.

Jump to

Keyboard shortcuts

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