ExternalSort
Read onlyYes
FinalYes
With a limit, every run and merge stops at $limit rows.
Properties
- $batchSize : BatchSize
- $columns : array<string|int, mixed>
- $memoryLimit : Unit
- $merge : Buckets
- $mergeFanIn : int
- $spill : Buckets
Methods
- __construct() : mixed
- firstRows() : Generator<string|int, Rows>
- of() : self
- reduce() : BucketRun
- sort() : Generator<string|int, Rows>
- sorted() : Rows
- spill() : BucketRun
Properties
$batchSize
public
BatchSize
$batchSize
= new BatchSize(1000)
$columns
public
array<string|int, mixed>
$columns
$memoryLimit
public
Unit
$memoryLimit
$merge
public
Buckets
$merge
$mergeFanIn
public
int
$mergeFanIn
= 10
$spill
public
Buckets
$spill
Methods
__construct()
public
__construct(array<int, SortColumn> $columns, Buckets $spill, Buckets $merge, RandomValueGenerator $random, Unit $memoryLimit[, int<1, max> $mergeFanIn = 10 ][, BatchSize $batchSize = new BatchSize(1000) ]) : mixed
Parameters
- $columns : array<int, SortColumn>
- $spill : Buckets
- $merge : Buckets
- $random : RandomValueGenerator
- $memoryLimit : Unit
- $mergeFanIn : int<1, max> = 10
- $batchSize : BatchSize = new BatchSize(1000)
firstRows()
public
firstRows(Generator<string|int, Rows> $batches, null|int $limit) : Generator<string|int, Rows>
Parameters
- $batches : Generator<string|int, Rows>
- $limit : null|int
Return values
Generator<string|int, Rows>of()
public
static of(array<int, SortColumn> $columns, ExternalSortConfig $config, RandomValueGenerator $random) : self
Parameters
- $columns : array<int, SortColumn>
- $config : ExternalSortConfig
- $random : RandomValueGenerator
Return values
selfreduce()
public
reduce(array<int, BucketRun> $group, KWayMerge $merger, int $index, null|int $limit) : BucketRun
Parameters
Return values
BucketRun —the merged run, bound to the merge storage that wrote it
sort()
public
sort(Generator<string|int, Rows> $rows, Backend $backend[, null|int $limit = null ]) : Generator<string|int, Rows>
Parameters
Return values
Generator<string|int, Rows>sorted()
public
sorted(Rows $all, null|int $limit, Backend $backend) : Rows
Parameters
Return values
Rowsspill()
public
spill(Rows $run, string $runId, int $index) : BucketRun
Parameters
- $run : Rows
- $runId : string
- $index : int