Flow PHP

HashBucketing

FinalYes

Methods

__construct()  : mixed
bucketize()  : Generator<string|int, Bucket>
Distinct keys only: KeyGrouping groups a batch's rows by key first, so xxh128 runs once per distinct key.
id()  : string
indexOf()  : int

Methods

__construct()

public __construct(KeyEncoder $keys, int<1, max> $bucketsCount, RandomValueGenerator $random[, string $namespace = 'bucket' ][, int<0, 24> $hashOffset = 0 ]) : mixed
Parameters
$keys : KeyEncoder
$bucketsCount : int<1, max>

1 routes every row to bucket 0 without hashing

$random : RandomValueGenerator
$namespace : string = 'bucket'
$hashOffset : int<0, 24> = 0

the hex digit indexOf() reads 8 digits from: 0 for in-process spills, 8 for a shuffle, so a shuffled bucket's own spill spreads over other buckets

bucketize()

Distinct keys only: KeyGrouping groups a batch's rows by key first, so xxh128 runs once per distinct key.

public bucketize(Generator<string|int, Rows> $rows, RowsStorage $storage[, null|non-empty-string $runId = null ]) : Generator<string|int, Bucket>
Parameters
$rows : Generator<string|int, Rows>
$storage : RowsStorage
$runId : null|non-empty-string = null

null = random; given = the ids are "{namespace}-{runId}-{index}", the same in every process

Return values
Generator<string|int, Bucket>

id()

public static id(string $namespace, string $runId, int $index) : string
Parameters
$namespace : string
$runId : string
$index : int
Return values
string

indexOf()

public indexOf(string $key) : int
Parameters
$key : string
Return values
int
On this page

Search results